-
Notifications
You must be signed in to change notification settings - Fork 2
/
start.sh
executable file
·283 lines (268 loc) · 11.1 KB
/
start.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
#!/bin/bash
HEKATE_RELEASE=$(cat config.env | grep -w "HEKATE_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_ATMOSPHERE=$(cat config.env | grep -w "ENABLE_ATMOSPHERE" | head -n 1 | cut -d "=" -f 2)
ATMOSPHERE_RELEASE=$(cat config.env | grep -w "ATMOSPHERE_RELEASE" | head -n 1 | cut -d "=" -f 2)
CFW_EMU_BOOT=$(cat config.env | grep -w "CFW_EMU_BOOT" | head -n 1 | cut -d "=" -f 2)
CFW_SYS_BOOT=$(cat config.env | grep -w "CFW_SYS_BOOT" | head -n 1 | cut -d "=" -f 2)
OFW_SYS_BOOT=$(cat config.env | grep -w "OFW_SYS_BOOT" | head -n 1 | cut -d "=" -f 2)
DNS_MITM_EMU=$(cat config.env | grep -w "DNS_MITM_EMU" | head -n 1 | cut -d "=" -f 2)
DNS_MITM_SYS=$(cat config.env | grep -w "DNS_MITM_SYS" | head -n 1 | cut -d "=" -f 2)
ENABLE_EXOSPHERE=$(cat config.env | grep -w "ENABLE_EXOSPHERE" | head -n 1 | cut -d "=" -f 2)
BLANK_PRODINFO_EMU=$(cat config.env | grep -w "BLANK_PRODINFO_EMU" | head -n 1 | cut -d "=" -f 2)
BLANK_PRODINFO_SYS=$(cat config.env | grep -w "BLANK_PRODINFO_SYS" | head -n 1 | cut -d "=" -f 2)
ENABLE_TESLA=$(cat config.env | grep -w "ENABLE_TESLA" | head -n 1 | cut -d "=" -f 2)
TESLA_LOADER_RELEASE=$(cat config.env | grep -w "TESLA_LOADER_RELEASE" | head -n 1 | cut -d "=" -f 2)
TESLA_MENU_RELEASE=$(cat config.env | grep -w "TESLA_MENU_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_LOCKPICK_RCM=$(cat config.env | grep -w "ENABLE_LOCKPICK_RCM" | head -n 1 | cut -d "=" -f 2)
LOCKPICK_RCM_RELEASE=$(cat config.env | grep -w "LOCKPICK_RCM_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_TEGRA_EXPLORER=$(cat config.env | grep -w "ENABLE_TEGRA_EXPLORER" | head -n 1 | cut -d "=" -f 2)
TEGRA_EXPLORER_RELEASE=$(cat config.env | grep -w "TEGRA_EXPLORER_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_GOLDLEAF=$(cat config.env | grep -w "ENABLE_GOLDLEAF" | head -n 1 | cut -d "=" -f 2)
GOLDLEAF_RELEASE=$(cat config.env | grep -w "GOLDLEAF_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_JKSV=$(cat config.env | grep -w "ENABLE_JKSV" | head -n 1 | cut -d "=" -f 2)
JKSV_RELEASE=$(cat config.env | grep -w "JKSV_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_WILIWILI=$(cat config.env | grep -w "ENABLE_WILIWILI" | head -n 1 | cut -d "=" -f 2)
WILIWILI_RELEASE=$(cat config.env | grep -w "WILIWILI_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_STATUS_MONITOR=$(cat config.env | grep -w "ENABLE_STATUS_MONITOR" | head -n 1 | cut -d "=" -f 2)
STATUS_MONITOR_RELEASE=$(cat config.env | grep -w "STATUS_MONITOR_RELEASE" | head -n 1 | cut -d "=" -f 2)
SALTYNX_RELEASE=$(cat config.env | grep -w "SALTYNX_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_SYS_CLK=$(cat config.env | grep -w "ENABLE_SYS_CLK" | head -n 1 | cut -d "=" -f 2)
SYS_CLK_RELEASE=$(cat config.env | grep -w "SYS_CLK_RELEASE" | head -n 1 | cut -d "=" -f 2)
ENABLE_EMUIIBO=$(cat config.env | grep -w "ENABLE_EMUIIBO" | head -n 1 | cut -d "=" -f 2)
EMUIIBO_RELEASE=$(cat config.env | grep -w "EMUIIBO_RELEASE" | head -n 1 | cut -d "=" -f 2)
echo "Preparing..."
rm -r ./sdmc/
curl -sL $HEKATE_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading hekate & Nyx: {}"
curl -sL $HEKATE_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o hekate.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq hekate.zip "bootloader/*" -d ./sdmc/
rm hekate.zip
echo "Importing hekate config..."
cp ./res/hekate_ipl_config.ini ./sdmc/bootloader/hekate_ipl.ini
fi
if [ $ENABLE_ATMOSPHERE = "true" ]; then
curl -sL $ATMOSPHERE_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading Atmosphère: {}"
curl -sL $ATMOSPHERE_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o atmosphere.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq atmosphere.zip -d ./sdmc/
rm atmosphere.zip
cp ./sdmc/atmosphere/reboot_payload.bin ./sdmc/bootloader/payloads/fusee.bin
echo "Payload imported: fusée"
if [ $CFW_EMU_BOOT = "true" ]; then
echo "Updating hekate config: Atmosphère emuMMC"
cp ./res/cfw_emu.bmp ./sdmc/bootloader/res/cfw_emu.bmp
cat ./res/cfw_emu.ini >> ./sdmc/bootloader/hekate_ipl.ini
fi
if [ $CFW_SYS_BOOT = "true" ]; then
echo "Updating hekate config: Atmosphère sysMMC"
cp ./res/cfw_sys.bmp ./sdmc/bootloader/res/cfw_sys.bmp
cat ./res/cfw_sys.ini >> ./sdmc/bootloader/hekate_ipl.ini
fi
if [ $OFW_SYS_BOOT = "true" ]; then
echo "Updating hekate config: Stock sysMMC"
cp ./res/ofw_sys.bmp ./sdmc/bootloader/res/ofw_sys.bmp
cat ./res/ofw_sys.ini >> ./sdmc/bootloader/hekate_ipl.ini
fi
if [ $DNS_MITM_EMU = "true" ]; then
mkdir -p ./sdmc/atmosphere/hosts
cp ./res/hosts.txt ./sdmc/atmosphere/hosts/emummc.txt
echo "DNS.mitm enabled for emuMMC."
fi
if [ $DNS_MITM_SYS = "true" ]; then
mkdir -p ./sdmc/atmosphere/hosts
cp ./res/hosts.txt ./sdmc/atmosphere/hosts/sysmmc.txt
echo "DNS.mitm enabled for sysMMC."
fi
if [ $ENABLE_EXOSPHERE = "true" ]; then
echo "Importing Exosphère config..."
cp ./sdmc/atmosphere/config_templates/exosphere.ini ./sdmc/exosphere.ini
if [ $BLANK_PRODINFO_EMU = "true" ]; then
sed -i "s/blank_prodinfo_emummc=0/blank_prodinfo_emummc=1/g" ./sdmc/exosphere.ini
echo "Blank prodinfo for emuMMC."
fi
if [ $BLANK_PRODINFO_SYS = "true" ]; then
sed -i "s/blank_prodinfo_sysmmc=0/blank_prodinfo_sysmmc=1/g" ./sdmc/exosphere.ini
echo "Blank prodinfo for sysMMC."
fi
fi
fi
fi
if [ $ENABLE_TESLA = "true" ]; then
curl -sL $TESLA_LOADER_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading nx-ovlloader: {}"
curl -sL $TESLA_LOADER_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o nx-ovlloader.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq nx-ovlloader.zip -d ./sdmc/
rm nx-ovlloader.zip
echo "Imported: nx-ovlloader"
fi
curl -sL $TESLA_MENU_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading Tesla-Menu: {}"
curl -sL $TESLA_MENU_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o ovlmenu.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq ovlmenu.zip -d ./sdmc/
rm ovlmenu.zip
echo "Overlay Imported: Tesla-Menu"
fi
fi
if [ $ENABLE_LOCKPICK_RCM = "true" ]; then
curl -sL $LOCKPICK_RCM_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading Lockpick_RCM: {}"
curl -sL $LOCKPICK_RCM_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o ./sdmc/bootloader/payloads/Lockpick_RCM.bin
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Payload imported: Lockpick_RCM"
fi
fi
if [ $ENABLE_TEGRA_EXPLORER = "true" ]; then
curl -sL $TEGRA_EXPLORER_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading TegraExplorer: {}"
curl -sL $TEGRA_EXPLORER_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o ./sdmc/bootloader/payloads/TegraExplorer.bin
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Payload imported: TegraExplorer"
fi
fi
if [ $ENABLE_GOLDLEAF = "true" ]; then
curl -sL $GOLDLEAF_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading Goldleaf: {}"
curl -sL $GOLDLEAF_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o ./sdmc/switch/Goldleaf.nro
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Application imported: Goldleaf"
fi
fi
if [ $ENABLE_JKSV = "true" ]; then
curl -sL $JKSV_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading JKSV: {}"
curl -sL $JKSV_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o ./sdmc/switch/JKSV.nro
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Application imported: JKSV"
fi
fi
if [ $ENABLE_WILIWILI = "true" ]; then
curl -sL $WILIWILI_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading wiliwili: {}"
curl -sL $WILIWILI_RELEASE \
| jq '.assets' | jq '.[8].browser_download_url' \
| xargs -I {} curl -sL {} -o wiliwili.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uqj wiliwili.zip "wiliwili/wiliwili.nro" -d ./sdmc/switch/
rm wiliwili.zip
echo "Application imported: wiliwili"
fi
fi
if [ $ENABLE_STATUS_MONITOR = "true" ]; then
curl -sL $STATUS_MONITOR_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading Status Monitor Overlay: {}"
curl -sL $STATUS_MONITOR_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o Status-Monitor-Overlay.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq Status-Monitor-Overlay.zip -d ./sdmc/
rm Status-Monitor-Overlay.zip
echo "Overlay Imported: Status Monitor Overlay"
fi
curl -sL $SALTYNX_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading SaltyNX: {}"
curl -sL $SALTYNX_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o SaltyNX.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq SaltyNX.zip -d ./sdmc/
rm SaltyNX.zip
echo "Imported: SaltyNX"
fi
fi
if [ $ENABLE_SYS_CLK = "true" ]; then
curl -sL $SYS_CLK_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading sys-clk: {}"
curl -sL $SYS_CLK_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o sys-clk.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq sys-clk.zip -d ./sdmc/
rm sys-clk.zip
echo "Overlay Imported: sys-clk"
fi
fi
if [ $ENABLE_EMUIIBO = "true" ]; then
curl -sL $EMUIIBO_RELEASE \
| jq '.tag_name' \
| xargs -I {} echo "Downloading emuiibo: {}"
curl -sL $EMUIIBO_RELEASE \
| jq '.assets' | jq '.[0].browser_download_url' \
| xargs -I {} curl -sL {} -o emuiibo.zip
if [ $? -ne 0 ]; then
echo "Download failed."
else
echo "Unzipping files..."
unzip -uq emuiibo.zip -d ./sdmc/
rm emuiibo.zip
cp -r ./sdmc/SdOut/* ./sdmc/
rm -r ./sdmc/SdOut/
echo "Overlay Imported: emuiibo"
fi
fi
echo "Merge custom into sdmc..."
rsync -rv --exclude ".gitkeep" ./custom/ ./sdmc
echo "All prepared."