Skip to content

Commit 7ffdbb0

Browse files
committed
Some jailbreak fixes and other stuff
idk if the pangu ipod stuff is actually needed, but since it seemingly does have a different xpcd cache named for ipods, lets use it
1 parent 86d6aed commit 7ffdbb0

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed
360 KB
Binary file not shown.

restore.sh

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ clean() {
5757
popd &>/dev/null
5858
rm -rf "$(dirname "$0")/tmp$$/"* "$(dirname "$0")/iP"*/ "$(dirname "$0")/tmp$$/" 2>/dev/null
5959
if [[ $platform == "macos" && $(ls "$(dirname "$0")" | grep -v tmp$$ | grep -c tmp) == 0 ]]; then
60-
killall -CONT AMPDevicesAgent AMPDeviceDiscoveryAgent MobileDeviceUpdater
60+
# ill disable this for now since finder is annoying, ill just keep them in a stopped state.
61+
: killall -CONT AMPDevicesAgent AMPDeviceDiscoveryAgent MobileDeviceUpdater
6162
fi
6263
}
6364

@@ -1715,7 +1716,7 @@ device_enter_mode() {
17151716
fi
17161717

17171718
if [[ $device_proc == 5 ]]; then
1718-
print "* DFU mode for A5 device - Make sure that your device is in PWNED DFU mode."
1719+
print "* DFU mode for A5(X) device - Make sure that your device is in PWNED DFU mode."
17191720
print "* You need to have an Arduino and USB Host Shield for checkm8-a5."
17201721
print "* Use my fork of checkm8-a5: https://github.com/LukeZGD/checkm8-a5"
17211722
print "* You may also use checkm8-a5 for the Pi Pico: https://www.reddit.com/r/LegacyJailbreak/comments/1djuprf/working_checkm8a5_on_the_raspberry_pi_pico/"
@@ -2269,6 +2270,11 @@ ipsw_preference_set() {
22692270
ipsw_canjailbreak=
22702271
fi
22712272

2273+
# jailbreak option: available for versions 3.1.3 to 9.3.4, with some exceptions:
2274+
# 3.1-4.1: option is disabled due to an issue with putting .launchd_use_gmalloc in the correct partition.
2275+
# it should be in system, but restore puts it in data instead due to it being in var.
2276+
# for some reason though, it does it correctly on 4.x for 3gs and touch 2, so its enabled for those.
2277+
# it also does it correctly on 3.1.3-4.x for s5l8900 devices, so its also enabled there.
22722278
case $device_target_vers in
22732279
9.3.[4321] | 9.3 | 9.[21]* | [8765]* | 4.[32]* ) ipsw_canjailbreak=1;;
22742280
3.1.3 )
@@ -2295,6 +2301,8 @@ ipsw_preference_set() {
22952301
esac
22962302
fi
22972303

2304+
# ipsw_nskip being 1 means that it will always create/use a custom ipsw.
2305+
# useful for disabling baseband update, or in the case of macos arm64, not having to use futurerestore.
22982306
case $device_type in
22992307
iPad[23],[23] | "$device_disable_bbupdate" ) ipsw_nskip=1;;
23002308
esac
@@ -2303,6 +2311,8 @@ ipsw_preference_set() {
23032311
ipsw_nskip=1
23042312
fi
23052313

2314+
# make jailbreak version available for all of 8.x-9.x if the restore is a powdersn0w one.
2315+
# meanwhile, exit this function if ipsw_canjailbreak is not set to 1 and/or other options will not be used.
23062316
if [[ $device_target_powder == 1 ]]; then
23072317
case $device_target_vers in
23082318
[98]* ) ipsw_canjailbreak=1;;
@@ -2311,6 +2321,8 @@ ipsw_preference_set() {
23112321
return
23122322
fi
23132323

2324+
# detect certain ios betas now. for ios 8, disable betas 1 and 2 since powdersn0w cant patch the kernels for those.
2325+
# for betas below ios 6, disable the jailbreak option, its not supported since (currently) no patchfinders used there and stuff.
23142326
if [[ $ipsw_isbeta == 1 ]]; then
23152327
case $device_target_vers in
23162328
8* )
@@ -2664,6 +2676,7 @@ ipsw_prepare_1033() {
26642676
ipsw_prepare_rebootsh() {
26652677
log "Generating reboot.sh"
26662678
echo '#!/bin/bash' | tee reboot.sh
2679+
echo "nvram -d boot-partition; nvram -d boot-ramdisk" | tee -a reboot.sh
26672680
echo "mount_hfs /dev/disk0s1s1 /mnt1; mount_hfs /dev/disk0s1s2 /mnt2" | tee -a reboot.sh
26682681
echo "nvram -d boot-partition; nvram -d boot-ramdisk" | tee -a reboot.sh
26692682
echo "/usr/bin/haxx_overwrite --${device_type}_${device_target_build}" | tee -a reboot.sh
@@ -3498,11 +3511,16 @@ ipsw_prepare_32bit() {
34983511
if [[ $ipsw_jailbreak == 1 ]]; then
34993512
case $device_target_vers in
35003513
9.3.[1234] | 9.3 ) JBFiles+=("untetherhomedepot.tar");;
3501-
9.2* | 9.1 ) JBFiles+=("untetherhomedepot921.tar");;
3502-
7.1* ) JBFiles+=("panguaxe.tar");;
3503-
7* ) JBFiles+=("evasi0n7-untether.tar");;
3504-
6.1.[3456] ) JBFiles+=("p0sixspwn.tar");;
3505-
6* ) JBFiles+=("evasi0n6-untether.tar");;
3514+
9.2* | 9.1 ) JBFiles+=("untetherhomedepot921.tar");;
3515+
7.1* )
3516+
case $device_type in
3517+
iPod* ) JBFiles+=("panguaxe-ipod.tar");;
3518+
* ) JBFiles+=("panguaxe.tar");;
3519+
esac
3520+
;;
3521+
7* ) JBFiles+=("evasi0n7-untether.tar");;
3522+
6.1.[3456] ) JBFiles+=("p0sixspwn.tar");;
3523+
6* ) JBFiles+=("evasi0n6-untether.tar");;
35063524
5* | 4.[32]* ) JBFiles+=("g1lbertJB/${device_type}_${device_target_build}.tar");;
35073525
esac
35083526
if [[ -n ${JBFiles[0]} ]]; then
@@ -4131,6 +4149,7 @@ ipsw_prepare_multipatch() {
41314149
"$dir/hfsplus" RestoreRamdisk.dec chown 0:0 sbin/reboot
41324150
"$dir/hfsplus" RestoreRamdisk.dec add $exploit exploit
41334151
elif [[ $ipsw_jailbreak == 1 && $device_target_vers == "8"* ]]; then
4152+
# daibutsu haxx overwrite
41344153
"$dir/hfsplus" RestoreRamdisk.dec untar bin.tar
41354154
"$dir/hfsplus" RestoreRamdisk.dec mv sbin/reboot sbin/reboot_
41364155
"$dir/hfsplus" RestoreRamdisk.dec add reboot.sh sbin/reboot
@@ -4357,7 +4376,13 @@ ipsw_prepare_powder() {
43574376
case $device_target_vers in
43584377
5* ) ExtraArgs+=" $jelbrek/cydiasubstrate.tar $jelbrek/g1lbertJB.tar $jelbrek/g1lbertJB/${device_type}_${device_target_build}.tar";;
43594378
7.0* ) ExtraArgs+=" $jelbrek/evasi0n7-untether.tar $jelbrek/fstab7.tar";;
4360-
7.1* ) ExtraArgs+=" $jelbrek/panguaxe.tar $jelbrek/fstab7.tar";;
4379+
7.1* )
4380+
ExtraArgs+=" $jelbrek/fstab7.tar"
4381+
case $device_type in
4382+
iPod* ) ExtraArgs+=" panguaxe-ipod.tar";;
4383+
* ) ExtraArgs+=" panguaxe.tar";;
4384+
esac
4385+
;;
43614386
esac
43624387
case $device_target_vers in
43634388
[689]* ) :;;
@@ -5880,7 +5905,12 @@ device_ramdisk() {
58805905
9.3.[4231] | 9.3 ) untether="untetherhomedepot.tar";;
58815906
9.2* | 9.1 ) untether="untetherhomedepot921.tar";;
58825907
8* ) untether="daibutsu/untether.tar";;
5883-
7.1* ) untether="panguaxe.tar";;
5908+
7.1* )
5909+
case $device_type in
5910+
iPod* ) untether="panguaxe-ipod.tar";;
5911+
* ) untether="panguaxe.tar";;
5912+
esac
5913+
;;
58845914
7* ) untether="evasi0n7-untether.tar";;
58855915
6.1.[6543] ) untether="p0sixspwn.tar";;
58865916
6* ) untether="evasi0n6-untether.tar";;
@@ -7692,7 +7722,7 @@ ipsw_print_warnings() {
76927722
#7[CD]* ) warn "Jailbreak option is not supported for this version. It is recommended to select 3.1.3 instead";;
76937723
8E* ) warn "iOS 4.2.x for the CDMA 4 is not supported. It may not restore/boot properly";;
76947724
8* ) warn "Not all devices support iOS 4 versions. It may not restore/boot properly";;
7695-
#7B* ) warn "Not all devices support 3.2.x. It may not restore/boot properly";;
7725+
7B* ) :;;
76967726
7* ) warn "iOS 3.1.x for the touch 3 is not supported. It will get stuck at the activation screen";;
76977727
esac
76987728
return
@@ -8418,7 +8448,7 @@ device_alloc8() {
84188448

84198449
device_jailbreak_confirm() {
84208450
if [[ $device_proc == 1 ]]; then
8421-
print "* The \"Jailbreak Device\" option is not supported for this device."
8451+
print "* The \"Jailbreak Device\" option (ramdisk method) is not supported for this device."
84228452
print "* To jailbreak, go to \"Restore/Downgrade\" instead, select 4.2.1, 4.1, or 3.1.3, then enable the jailbreak option."
84238453
pause
84248454
return
@@ -8531,21 +8561,15 @@ device_jailbreak_confirm() {
85318561
pause
85328562
return
85338563
;;
8534-
9.3.[1234] | 9.3 | 9.2* | 9.1 | [8765]* | 4.3* | 4.2.[8761] | 4.[10]* | 3.2* | 3.1.3 ) :;;
8564+
[765]* | 4.3* | 4.2.[8761] | 4.[10]* | 3.2* | 3.1.3 ) :;;
85358565
3.[10]* )
85368566
if [[ $device_type != "iPhone2,1" ]]; then
8537-
warn "This version ($device_vers) is not supported for jailbreaking with SSHRD."
8567+
warn "This version ($device_vers) is not supported for jailbreaking with ramdisk method."
85388568
print "* Supported versions are: 3.1.3 to 9.3.4 (excluding 9.0.x)"
85398569
pause
85408570
return
85418571
fi
85428572
;;
8543-
* )
8544-
warn "This version ($device_vers) is not supported for jailbreaking with SSHRD."
8545-
print "* Supported versions are: 3.1.3 to 9.3.4 (excluding 9.0.x)"
8546-
pause
8547-
return
8548-
;;
85498573
esac
85508574
if [[ $device_type == "iPhone2,1" && $device_vers == "3"* ]]; then
85518575
warn "For 3.x versions on the 3GS, the \"Jailbreak Device\" option will only work on devices restored with Legacy iOS Kit."

0 commit comments

Comments
 (0)