-
Notifications
You must be signed in to change notification settings - Fork 16
/
compile.sh
182 lines (143 loc) · 5.29 KB
/
compile.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/env bash
echo Credits : gghhkm [ https://github.com/gghhkm ] , Ryukendo9
echo " Hello, Thankyou for using this script "
echo " You can easily build orange fox with this script for your Xiaomi , Oneplus , Realme Device "
echo " First lets setup the environment "
echo " Press Enter to Start "
read Ans1
echo "_________________________________________________________________________________________"
echo " Have you used this script before ? [ Like have you synced your OFOX Source with this script ] "
echo " Ans 1 = yes and 2 = no "
read ANS
if [ $ANS = 2 ]
then
cd
git clone https://github.com/akhilnarang/scripts
bash scripts/setup/android_build_env.sh
echo " Tell me your UserEmail for github Config : "
read email
echo " Tell me your Name for github Config : "
read name
cd
cd scripts
mkdir Orangefox
cd
cd scripts/Orangefox/
git config --global user.email "$email"
git config --global user.name "$name"
echo "_________________________________________________________________________________________"
echo "Now lets sync the Latest Orange Fox Sources [ Latest 9.0 ]"
sleep 3
repo init --depth=1 -q -u https://gitlab.com/OrangeFox/Manifest.git -b fox_9.0
repo sync -c -f -q --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
echo "_________________________________________________________________________________________"
fi
clear
echo "_________________________________________________________________________________________"
echo " Now tell me your device codename "
read code
echo "_________________________________________________________________________________________"
echo " So which device you have ? "
echo " Answer 1 = xiaomi and 2 = oneplus and 3 = realme/oppo "
read Ans2
if [ $Ans2= 1 ]
then
echo " Give me your Xiaomi Device trees. [Give the github link ] "
read Xtree
cd
cd scripts/Orangefox/
git clone $Xtree device/xiaomi/$code
elif [ $Ans2 = 2 ]
then
echo " Give me your Oneplus Device trees. [Give the github link ] "
read Otree
cd
cd scripts/Orangefox/
git clone $Otree device/oneplus/$code
else [ $Ans2 = 3 ]
echo " Give me your Realme Device Trees. [Give the github link ] "
read Rtree
cd
cd scripts/Orangefox/
git clone $Rtree device/oppo/$code
fi
echo "_________________________________________________________________________________________"
echo " Now lets start building the environment "
cd
cd scripts/Orangefox/
source build/envsetup.sh
echo "_________________________________________________________________________________________"
echo " Now tell me the name of the maintainer "
read main
echo " Now tell me the Fox Version [ eg:- Official, Unofficial etc ] "
read ver
echo "_________________________________________________________________________________________"
echo " Now lets do some export things for your device "
echo " Have you already created a config file with the export settings for your device ? "
echo " Options "
echo " 1. You already have a config file created by this script "
echo " 2. You dont have a config file and now we will create it for you and will use it later when rebuilding Ofox "
echo "_________________________________________________________________________________________"
read Ans3
if [ $Ans3 = 1 ]
then
cd
ls scripts/Orangefox/configs/
echo ""
echo " Now write the name of config that you want to use "
read con
echo " Great then lets export your device settings "
echo " Press enter when ready "
read enter
cd
source ~/scripts/Orangefox/configs/$con
echo " Done exporting your Device Specific settings "
echo "_________________________________________________________________________________________"
elif [ $Ans3 = 2 ]
then
echo " Lets create a config for you to use for you device export settings "
cd
mkdir scripts/Orangefox/configs/
touch scripts/Orangefox/configs/$code
echo " Config file created "
echo ""
echo " Now i will open your config file and you just type the device specific export settings in it and save it "
echo " That config file will be used now and will be user later if you want "
echo " Dont Change the Name of the file, leave it as it is "
echo " Press enter when ready "
read enter
cd
nano scripts/Orangefox/configs/$code
cd
echo " Now your config file is saved "
echo ""
echo " Great then lets export your device settings "
echo " Press enter when ready "
read enter
cd
source ~/scripts/Orangefox/configs/$code
echo " Done exporting your Device Specific settings "
fi
echo "_________________________________________________________________________________________"
export OF_MAINTAINER="$main"
# Universal variables for building
export ALLOW_MISSING_DEPENDENCIES=true
export TW_DEFAULT_LANGUAGE="en"
# To use ccache to speed up building
export USE_CCACHE="1"
# Enforced by R11 rules
export FOX_R11="1"
export FOX_ADVANCED_SECURITY="1"
export FOX_RESET_SETTINGS="1"
export FOX_VERSION="$ver"
clear
echo "_________________________________________________________________________________________"
echo " Lets Lunch it all together 😉😋 "
lunch omni_$code-eng
echo "_________________________________________________________________________________________"
echo " Lets Start Building "
mka recoveryimage
echo "_________________________________________________________________________________________"
echo " Thankyou for using my Script "
echo " Do follow my Github Account for more scripts : https://github.com/Sammy970 "
echo " Would love to help you "