forked from cm13-microG/root-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch_microG.sh
executable file
·103 lines (90 loc) · 2.25 KB
/
switch_microG.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
switch_branches() {
TOPDIR=$PWD
cd $2
echo "-"
echo "$PWD"
git checkout $1 && git pull github $1
cd $TOPDIR
}
switch_zpatch() {
TOPDIR=$PWD
cd z_patches
echo "-"
echo "$PWD"
case "$2" in
R) ./patches_reverse.sh
git checkout $1
;;
S) ./patches_apply.sh
;;
esac
cd $TOPDIR
}
case "$1" in
microG)
BRANCH1="cm-14.1-microG"
BRANCH2="cm-14.1"
BRANCH3="cm-14.1-microG"
BRANCH4="cm-14.1-microG"
SW_PTCH="S"
;;
oms)
BRANCH1="cm-14.1-oms"
BRANCH2="cm-14.1-oms"
BRANCH3="cm-14.1"
BRANCH4="cm-14.1-microG"
SW_PTCH="S"
;;
mG-oms)
BRANCH1="cm-14.1-mG-oms"
BRANCH2="cm-14.1-oms"
BRANCH3="cm-14.1-microG"
BRANCH4="cm-14.1-microG"
SW_PTCH="S"
;;
default)
BRANCH1="cm-14.1"
BRANCH2="cm-14.1"
BRANCH3="cm-14.1"
BRANCH4="cm-14.1-microG"
SW_PTCH="S"
;;
reference)
BRANCH1="cm-14.1"
BRANCH2="cm-14.1"
BRANCH3="cm-14.1"
BRANCH4="cm-14.1"
SW_PTCH="X"
;;
*)
echo "usage: switch_microg default|microG|oms|mG-oms"
echo "-"
echo " reference - To synchronize the repository"
echo " default - cm-14.1 reference build (with patches)"
echo " microG - hardened microG build"
echo " oms - Substratum-enabled w/o microG & hardening"
echo " mG-oms - Substratum-enabled WITH microG & hardening"
exit
;;
esac
switch_zpatch $BRANCH1 R
switch_branches $BRANCH4 external/ffmpeg
switch_branches $BRANCH4 external/iptables
switch_branches $BRANCH3 external/sqlite
switch_branches $BRANCH1 frameworks/base
switch_branches $BRANCH1 frameworks/native
switch_branches $BRANCH1 packages/apps/Settings
switch_branches $BRANCH3 packages/apps/SetupWizard
switch_branches $BRANCH4 system/core
switch_branches $BRANCH1 system/sepolicy
switch_branches $BRANCH1 vendor/cm
switch_branches $BRANCH1 .repo/local_manifests
switch_branches $BRANCH1 OTA
switch_branches $BRANCH2 packages/apps/Contacts
switch_branches $BRANCH2 packages/apps/ContactsCommon
switch_branches $BRANCH1 packages/apps/Dialer
switch_branches $BRANCH2 packages/apps/ExactCalculator
switch_branches $BRANCH2 packages/apps/PackageInstaller
switch_branches $BRANCH2 packages/apps/PhoneCommon
switch_zpatch $BRANCH1 $SW_PTCH