-
Notifications
You must be signed in to change notification settings - Fork 3
/
Required-Fix.sh
executable file
·268 lines (268 loc) · 6.98 KB
/
Required-Fix.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
#!/bin/bash
set -e
ps -fA | grep 2022 | grep -v grep | awk '{print $2}' | xargs kill
cd support_files/7.1.2/Ramdisk
./ipwndfu -p
echo "Sending iBSS and iBEC"
./irecovery -f iBSS.n90ap.RELEASE.dfu
./irecovery -f iBEC.n90ap.RELEASE.dfu
echo "Waiting for Connection, This Might Take Some Time..."
while !(system_profiler SPUSBDataType 2> /dev/null | grep "Apple Mobile Device (Recovery Mode)" 2> /dev/null); do
sleep 1
done
n=0
until [ $n -ge 5 ]
do
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn -noecho ./irecovery2 -s
expect "iRecovery>"
send "/send DeviceTree.n90ap.img3\r"
expect "iRecovery>"
send "devicetree\r"
expect "iRecovery>"
send "/send 058-1056-002.dmg\r"
expect "iRecovery>"
send "ramdisk\r"
expect "iRecovery>"
send "/send kernelcache.release.n90\r"
expect "iRecovery>"
send "bootx\r"
expect "iRecovery>"
send "/exit\r"
expect eof
)&& break
n=$[$n+1]
echo "Retrying iRecovery (This Might Take A Few Tries)"
sleep 3
done
echo "Booting..."
sleep 2
while !(system_profiler SPUSBDataType 2> /dev/null | grep "iPhone" 2> /dev/null); do
sleep 1
done
echo "Establishing Connection (5s)..."
sleep 5
./tcprelay.py > /dev/null 2>&1 -t 22:2022 &
cd ../Jailbreak
echo "Establishing Jailbreak Environment (8s)..."
sleep 8
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p 2022 root@localhost
expect "root@localhost's password:"
send "alpine\r"
expect "sh-4.0#"
send "mount_hfs /dev/disk0s1 /mnt1 \r"
expect "sh-4.0#"
send "mount_hfs /dev/disk0s2s1 /mnt1/private/var \r"
expect "sh-4.0#"
send "exit \r"
expect eof
)
echo "Waiting For Filesystem (5s)..."
sleep 5
echo "Sending Tar and DD..."
sleep 2
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 tar dd root@localhost:/bin
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Waiting For Filesystem (5s)..."
sleep 5
echo "Sending Jailbreak Files 1/5..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 panguaxe.tar root@localhost:/mnt1/private/var
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Sending Jailbreak Files 2/5..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 Cydia.tar root@localhost:/mnt1/private/var
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Sending Jailbreak Files 3/5..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 APT.tar root@localhost:/mnt1/private/var
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Sending Jailbreak Files 4/5..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 panguaxe-APT.tar root@localhost:/mnt1/private/var
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Sending Jailbreak Files 5/5..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 panguaxe root@localhost:/mnt1/private/var
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Sending Tar and DD..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 tar dd root@localhost:/bin
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Jailbreaking..."
sleep 2
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p 2022 root@localhost
expect "root@localhost's password:"
send "alpine\r"
expect "sh-4.0#"
send "tar -x --no-overwrite-dir -f /mnt1/private/var/panguaxe.tar -C /mnt1 \r"
expect "sh-4.0#"
send "tar -x --no-overwrite-dir -f /mnt1/private/var/Cydia.tar -C /mnt1 \r"
expect "sh-4.0#"
send "tar -x --no-overwrite-dir -f /mnt1/private/var/APT.tar -C /mnt1 \r"
expect "sh-4.0#"
send "tar -x --no-overwrite-dir -f /mnt1/private/var/panguaxe-APT.tar -C /mnt1 \r"
expect "sh-4.0#"
send "rm -rf /mnt1/panguaxe \r"
expect "sh-4.0#"
send "cp -a /mnt1/private/var/panguaxe /mnt1 \r"
expect "sh-4.0#"
send "touch /mnt1/panguaxe.installed \r"
expect "sh-4.0#"
send "touch /mnt1/private/var/mobile/Media/panguaxe.installed \r"
expect "sh-4.0#"
send "mkdir -p /mnt1/private/var/root/Media/Cydia/AutoInstall \r"
expect "sh-4.0#"
send "exit \r"
expect eof
)
echo "Sending Debs..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 org.thebigboss.repo.icons_1.0.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 com.nyansatan.dualbootstuff_1.0.7a.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
spawn scp -P 2022 cydia_1.1.9_iphoneos-arm.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 cydia-lproj_1.1.12_iphoneos-arm.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 openssl_0.9.8zg-13_iphoneos-arm.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 openssh_6.7p1-13_iphoneos-arm.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 coreutils_8.12-13_iphoneos-arm.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 bigbosshackertools_1.3.2-2.deb root@localhost:/mnt1/private/var/root/Media/Cydia/AutoInstall
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Fetching Springboard..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 root@localhost:/mnt1/var/mobile/Library/Preferences/com.apple.springboard.plist $(pwd)
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Patching Springboard"
plutil -insert SBShowNonDefaultSystemApps -bool YES com.apple.springboard.plist
echo "Sending Springboard"
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 com.apple.springboard.plist root@localhost:/mnt1/var/mobile/Library/Preferences
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo "Patching Fstab..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn scp -P 2022 fstab root@localhost:/mnt1/etc
expect "root@localhost's password:"
send "alpine\r"
expect eof
)
echo ""
echo "Rebooting..."
/usr/bin/expect <(cat << EOF
log_user 0
set timeout -1
spawn ssh -p 2022 root@localhost
expect "root@localhost's password:"
send "alpine\r"
expect "sh-4.0#"
send "reboot_bak\r"
expect eof
)
echo "Done!"