This repository was archived by the owner on Jul 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackagebuild.sh
More file actions
134 lines (113 loc) · 3.58 KB
/
packagebuild.sh
File metadata and controls
134 lines (113 loc) · 3.58 KB
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
#!/bin/bash
mkdir SDOUTPUT
cd SDOUTPUT
# ATMOS DL
download_and_extract_atmos() {
url=$1
filename=$(basename "$url")
wget "$url" -O "$filename"
if [[ "$filename" == *.zip ]]; then
unzip "$filename"
rm "$filename"
fi
}
pre_release_url=$(curl -s "https://api.github.com/repos/Atmosphere-NX/Atmosphere/releases" | grep "browser_download_url" | awk -F '"' '{print $4}' | head -n 1)
if [[ -n "$pre_release_url" ]]; then
download_and_extract_atmos "$pre_release_url"
fi
release_url=$(curl -s "https://api.github.com/repos/Atmosphere-NX/Atmosphere/releases/latest" | grep "browser_download_url" | awk -F '"' '{print $4}')
download_and_extract_atmos "$release_url"
# Hekate DL
download_and_extract_hekate() {
url=$1
filename=$(basename "$url")
wget "$url" -O "$filename"
if [[ "$filename" == *.zip ]]; then
unzip "$filename"
rm "$filename"
fi
}
pre_release_url=$(curl -s "https://api.github.com/repos/CTCaer/hekate/releases" | grep "browser_download_url" | awk -F '"' '{print $4}' | head -n 1)
if [[ -n "$pre_release_url" ]]; then
download_and_extract_hekate "$pre_release_url"
fi
release_url=$(curl -s "https://api.github.com/repos/CTCaer/hekate/releases/latest" | grep "browser_download_url" | awk -F '"' '{print $4}')
download_and_extract_hekate "$release_url"
# Sigpatches
wget https://sigmapatches.coomer.party/sigpatches.zip && unzip sigpatches.zip
# Prepare stuff
rm nyx_usb_max_rate__run_only_once_per_windows_pc.reg
rm atmosphere/reboot_payload.bin
cp hekate_ctcaer* atmosphere/reboot_payload.bin
mv fusee.bin bootloader/payloads/fusee.bin
# Configs
touch bootloader/hekate_ipl.ini
touch exosphere.ini
mkdir atmosphere/hosts
touch atmosphere/hosts/emummc.txt
echo "[config]
autoboot=0
autoboot_list=0
bootwait=3
backlight=100
autohosoff=0
autonogc=1
updater2p=0
bootprotect=0
[emuMMC]
payload=bootloader/payloads/fusee.bin
icon=bootloader/res/icon_payload.bmp
[sysMMC]
fss0=atmosphere/package3
emummc_force_disable=1
icon=bootloader/res/icon_switch.bmp
[Stock]
fss0=atmosphere/package3
stock=1
emummc_force_disable=1" > bootloader/hekate_ipl.ini
echo "[exosphere]
debugmode=1
debugmode_user=0
disable_user_exception_handlers=0
enable_user_pmu_access=0
blank_prodinfo_sysmmc=0
blank_prodinfo_emummc=1
allow_writing_to_cal_sysmmc=0
log_port=0
log_baud_rate=115200
log_inverted=0" > exosphere.ini
echo "# Block Nintendo Servers
127.0.0.1 *nintendo.*
127.0.0.1 *nintendo-europe.com
127.0.0.1 *nintendoswitch.*
95.216.149.205 *conntest.nintendowifi.net
95.216.149.205 *ctest.cdn.nintendo.net" > atmosphere/hosts/emummc.txt
# Cleaning out
cd ../
cp -r SDOUTPUT SD_Out_Tools
mv SDOUTPUT SD_Out
cd SD_Out
zip -r SD.zip ./*
cd ../
# Tools Output
cd SD_Out_Tools
download_file() {
url=$1
filename=$(basename "$url")
wget "$url" -O "$filename"
}
RELEASE_INFO=$(curl -s "https://api.github.com/repos/fortheusers/hb-appstore/releases/latest")
TAG_NAME=$(echo "$RELEASE_INFO" | grep -o '"tag_name": *"[^"]*"' | grep -o '[^"]*$')
DOWNLOAD_URL=$(echo "$RELEASE_INFO" | grep -o "browser_download_url\": *\"[^\"]*" | grep "appstore.nro" | grep -o '[^"]*$')
curl -LO "${DOWNLOAD_URL}"
mv appstore.nro switch/appstore.nro
RELEASE_INFO=$(curl -s "https://api.github.com/repos/rashevskyv/dbi/releases/latest")
TAG_NAME=$(echo "$RELEASE_INFO" | grep -o '"tag_name": *"[^"]*"' | grep -o '[^"]*$')
DOWNLOAD_URL=$(echo "$RELEASE_INFO" | grep -o "browser_download_url\": *\"[^\"]*" | grep "DBI.nro" | grep -o '[^"]*$')
curl -LO "${DOWNLOAD_URL}"
mv DBI.nro switch/DBI.nro
zip -r SD_T.zip ./*
cd ../
zip -r output.zip ./*
mv SD_Out_Tools/SD_T.zip SD_T.zip
mv SD_Out/SD.zip SD.zip