A jailbreak update and some fixes

- install corona/rocky racoon for 5.0.1/5.1.1 jailbreaks
- fix restoring to 4.3.3/5.1.1 for 3gs
- add 3.1.3 jailbreaking thru sshrd
- add back kloader5 to use for ios 5
This commit is contained in:
LukeZGD 2023-07-21 15:12:01 +08:00
parent c075398587
commit 3577f5c5ee
12 changed files with 53 additions and 31 deletions

View File

@ -129,7 +129,8 @@
- [idevicerestore](https://github.com/libimobiledevice/idevicerestore) - libimobiledevice; [LukeZGD fork](https://github.com/LukeZGD/idevicerestore) - [idevicerestore](https://github.com/libimobiledevice/idevicerestore) - libimobiledevice; [LukeZGD fork](https://github.com/LukeZGD/idevicerestore)
- [idevicererestore](https://github.com/LukeZGD/daibutsuCFW/tree/main/src/idevicererestore) from daibutsuCFW (used on custom IPSW restores for A5/A6 devices) - [idevicererestore](https://github.com/LukeZGD/daibutsuCFW/tree/main/src/idevicererestore) from daibutsuCFW (used on custom IPSW restores for A5/A6 devices)
- [kloader from Odysseus](https://www.youtube.com/watch?v=fh0tB6fp0Sc) - [kloader from Odysseus](https://www.youtube.com/watch?v=fh0tB6fp0Sc)
- [kloader from axi0mX](https://github.com/axi0mX/ios-kexec-utils/blob/master/kloader) (used on iOS 4/5 only) - [kloader from axi0mX](https://github.com/axi0mX/ios-kexec-utils/blob/master/kloader) (used on iOS 4 only)
- [kloader for iOS 5](https://www.pmbonneau.com/cydia/com.pmbonneau.kloader5_1.2_iphoneos-arm.deb)
- [kloader_hgsp from nyan_satan](https://twitter.com/nyan_satan/status/945203180522045440) (used on h3lix only) - [kloader_hgsp from nyan_satan](https://twitter.com/nyan_satan/status/945203180522045440) (used on h3lix only)
- [partial-zip](https://github.com/matteyeux/partial-zip) - [partial-zip](https://github.com/matteyeux/partial-zip)
- [zenity](https://github.com/GNOME/zenity); [macOS/Windows builds](https://github.com/ncruces/zenity) - [zenity](https://github.com/GNOME/zenity); [macOS/Windows builds](https://github.com/ncruces/zenity)
@ -143,6 +144,7 @@
- [unthredeh4il](https://www.theiphonewiki.com/wiki/Unthredera1n#unthredeh4il) - [unthredeh4il](https://www.theiphonewiki.com/wiki/Unthredera1n#unthredeh4il)
- [evasi0n](https://www.theiphonewiki.com/wiki/Evasi0n) - [evasi0n](https://www.theiphonewiki.com/wiki/Evasi0n)
- [pris0nbarake](https://github.com/LukeZGD/pris0nbarake) - LukeZGD fork - [pris0nbarake](https://github.com/LukeZGD/pris0nbarake) - LukeZGD fork
- [Corona](https://www.theiphonewiki.com/wiki/Corona) and [Rocky Racoon](https://www.theiphonewiki.com/wiki/Rocky_Racoon)
- [greenpois0n](https://github.com/OpenJailbreak/greenpois0n/tree/0f1eac8e748abb200fc36969e616aaad009f7ebf) - [greenpois0n](https://github.com/OpenJailbreak/greenpois0n/tree/0f1eac8e748abb200fc36969e616aaad009f7ebf)
- Some patches from [PwnageTool](https://www.theiphonewiki.com/wiki/PwnageTool) and [sn0wbreeze](https://www.theiphonewiki.com/wiki/sn0wbreeze) - Some patches from [PwnageTool](https://www.theiphonewiki.com/wiki/PwnageTool) and [sn0wbreeze](https://www.theiphonewiki.com/wiki/sn0wbreeze)
- SSH Ramdisk tar from [SSH-Ramdisk-Maker-and-Loader](https://github.com/Ralph0045/SSH-Ramdisk-Maker-and-Loader) and [msftguy's ssh-rd](https://github.com/msftguy/ssh-rd) - SSH Ramdisk tar from [SSH-Ramdisk-Maker-and-Loader](https://github.com/Ralph0045/SSH-Ramdisk-Maker-and-Loader) and [msftguy's ssh-rd](https://github.com/msftguy/ssh-rd)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
resources/kloader/kloader5 Executable file

Binary file not shown.

View File

@ -3,6 +3,7 @@
ipsw_openssh=1 # OpenSSH will be added to jailbreak/custom IPSW if set to 1. ipsw_openssh=1 # OpenSSH will be added to jailbreak/custom IPSW if set to 1.
device_ramdisk_build="" # You can change the version of SSH Ramdisk and Pwned iBSS/iBEC here. (default is 10B329 for most devices) device_ramdisk_build="" # You can change the version of SSH Ramdisk and Pwned iBSS/iBEC here. (default is 10B329 for most devices)
device_verbose_boot=0 # By setting this to 1 and changing the build version above, the SSH Ramdisk option turns to tethered verbose boot. device_verbose_boot=0 # By setting this to 1 and changing the build version above, the SSH Ramdisk option turns to tethered verbose boot.
jelbrek="../resources/jailbreak"
print() { print() {
echo "${color_B}${1}${color_N}" echo "${color_B}${1}${color_N}"
@ -41,10 +42,6 @@ clean() {
} }
clean_and_exit() { clean_and_exit() {
if [[ $platform == "windows" ]]; then
input "Press Enter/Return to exit."
read -s
fi
kill $httpserver_pid $iproxy_pid $sudoloop_pid $usbmuxd_pid 2>/dev/null kill $httpserver_pid $iproxy_pid $sudoloop_pid $usbmuxd_pid 2>/dev/null
clean clean
} }
@ -222,6 +219,7 @@ set_tool_paths() {
sudo systemctl stop usbmuxd sudo systemctl stop usbmuxd
sudo usbmuxd -pz sudo usbmuxd -pz
usbmuxd_pid=$! usbmuxd_pid=$!
sleep 1
fi fi
fi fi
@ -338,7 +336,7 @@ install_depends() {
pause pause
elif [[ $platform == "windows" ]]; then elif [[ $platform == "windows" ]]; then
print "* Legacy iOS Kit will be installing dependencies from MSYS2" print "* Legacy iOS Kit will be installing dependencies from MSYS2"
print "* You may have to run the script more than once. If the prompt exits on its own, just run restore.cmd again" print "* You may have to run the script more than once. If the prompt exits on its own, just run restore.sh again"
pause pause
fi fi
@ -437,7 +435,7 @@ version_update() {
popd >/dev/null popd >/dev/null
log "Updating..." log "Updating..."
cp resources/firstrun tmp 2>/dev/null cp resources/firstrun tmp 2>/dev/null
rm -r bin/ resources/ LICENSE README.md restore.cmd restore.sh rm -r bin/ resources/ LICENSE README.md restore.sh
unzip -q tmp/latest.zip -d . unzip -q tmp/latest.zip -d .
cp tmp/firstrun resources 2>/dev/null cp tmp/firstrun resources 2>/dev/null
log "Done! Please run the script again" log "Done! Please run the script again"
@ -857,7 +855,10 @@ device_enter_mode() {
/tmp/kloader /tmp/pwnediBSS' >> kloaders /tmp/kloader /tmp/pwnediBSS' >> kloaders
sendfiles+=("../resources/kloader/hgsp") sendfiles+=("../resources/kloader/hgsp")
sendfiles+=("../resources/kloader/kloader") sendfiles+=("../resources/kloader/kloader")
elif (( device_det < 6 )); then elif [[ $device_det == 5 ]]; then
echo "/tmp/kloader5 /tmp/pwnediBSS" >> kloaders
sendfiles+=("../resources/kloader/kloader5")
elif (( device_det < 5 )); then
echo "/tmp/axi0mX /tmp/pwnediBSS" >> kloaders echo "/tmp/axi0mX /tmp/pwnediBSS" >> kloaders
sendfiles+=("../resources/kloader/axi0mX") sendfiles+=("../resources/kloader/axi0mX")
else else
@ -1332,8 +1333,9 @@ ipsw_preference_set() {
return return
fi fi
if [[ $device_target_vers == "3.1.3" || $device_target_vers == "4.0" ]]; then if [[ $device_target_vers == "3.1.3" || $device_target_vers == "4.0" ]] ||
log "Jailbreak Option is always enabled for $device_target_vers" [[ $device_target_vers == "4.3.3" && $device_type == "iPhone2,1" ]]; then
#log "Jailbreak Option is always enabled for $device_target_vers"
ipsw_jailbreak=1 ipsw_jailbreak=1
elif [[ $device_target_other != 1 || $ipsw_canjailbreak == 1 ]] && [[ -z $ipsw_jailbreak ]]; then elif [[ $device_target_other != 1 || $ipsw_canjailbreak == 1 ]] && [[ -z $ipsw_jailbreak ]]; then
input "Jailbreak Option" input "Jailbreak Option"
@ -1562,21 +1564,21 @@ ipsw_prepare_jailbreak() {
echo "nvram -d boot-partition; nvram -d boot-ramdisk" | tee -a reboot.sh echo "nvram -d boot-partition; nvram -d boot-ramdisk" | tee -a reboot.sh
echo "/usr/bin/haxx_overwrite --${device_type}_${device_target_build}" | tee -a reboot.sh echo "/usr/bin/haxx_overwrite --${device_type}_${device_target_build}" | tee -a reboot.sh
if [[ $ipsw_openssh == 1 ]]; then if [[ $ipsw_openssh == 1 ]]; then
JBFiles=("../resources/jailbreak/sshdeb.tar") JBFiles=("$jelbrek/sshdeb.tar")
fi fi
JBFiles2=("daibutsu/bin.tar" "daibutsu/untether.tar" "freeze.tar") JBFiles2=("daibutsu/bin.tar" "daibutsu/untether.tar" "freeze.tar")
for i in {0..2}; do for i in {0..2}; do
cp ../resources/jailbreak/${JBFiles2[$i]} . cp $jelbrek/${JBFiles2[$i]} .
done done
cp -R ../resources/firmware/JailbreakBundles FirmwareBundles cp -R ../resources/firmware/JailbreakBundles FirmwareBundles
ExtraArgs+="-daibutsu" # use daibutsuCFW ExtraArgs+="-daibutsu" # use daibutsuCFW
elif [[ $device_target_vers == "6.1.3" ]]; then elif [[ $device_target_vers == "6.1.3" ]]; then
JBFiles+=("fstab_rw.tar" "p0sixspwn.tar" "freeze.tar") JBFiles+=("fstab_rw.tar" "p0sixspwn.tar" "freeze.tar")
for i in {0..2}; do for i in {0..2}; do
JBFiles[i]=../resources/jailbreak/${JBFiles[$i]} JBFiles[i]=$jelbrek/${JBFiles[$i]}
done done
if [[ $ipsw_openssh == 1 ]]; then if [[ $ipsw_openssh == 1 ]]; then
JBFiles+=("../resources/jailbreak/sshdeb.tar") JBFiles+=("$jelbrek/sshdeb.tar")
fi fi
cp -R ../resources/firmware/FirmwareBundles . cp -R ../resources/firmware/FirmwareBundles .
ExtraArgs+="-S 30" # system partition add ExtraArgs+="-S 30" # system partition add
@ -1875,7 +1877,6 @@ ipsw_prepare_bundle() {
ipsw_prepare_32bit() { ipsw_prepare_32bit() {
local ExtraArgs local ExtraArgs
local daibutsu local daibutsu
local jelbrek="../resources/jailbreak"
local JBFiles=() local JBFiles=()
if [[ $device_target_vers == "3"* || $device_target_vers == "4"* ]]; then if [[ $device_target_vers == "3"* || $device_target_vers == "4"* ]]; then
if [[ $device_type == "iPad2"* ]]; then if [[ $device_type == "iPad2"* ]]; then
@ -1935,6 +1936,15 @@ ipsw_prepare_32bit() {
for i in {0..2}; do for i in {0..2}; do
JBFiles[i]=$jelbrek/${JBFiles[$i]} JBFiles[i]=$jelbrek/${JBFiles[$i]}
done done
case $device_target_vers in
5.1.1 ) JBFiles+=("$jelbrek/rockyracoon.tar");;
5.0.1 ) JBFiles+=("$jelbrek/corona.tar");;
5.0 )
if [[ $device_type == "iPhone4,1" ]]; then
JBFiles+=("$jelbrek/corona.tar")
fi
;;
esac
if [[ $ipsw_openssh == 1 ]]; then if [[ $ipsw_openssh == 1 ]]; then
JBFiles+=("$jelbrek/sshdeb.tar") JBFiles+=("$jelbrek/sshdeb.tar")
fi fi
@ -1970,13 +1980,17 @@ ipsw_prepare_powder() {
fi fi
JBFiles+=("fstab_rw.tar" "freeze.tar") JBFiles+=("fstab_rw.tar" "freeze.tar")
for i in {0..2}; do for i in {0..2}; do
JBFiles[i]=../resources/jailbreak/${JBFiles[$i]} JBFiles[i]=$jelbrek/${JBFiles[$i]}
done done
case $device_target_vers in
5.1.1 ) JBFiles+=("$jelbrek/rockyracoon.tar");;
5.0.1 ) JBFiles+=("$jelbrek/corona.tar");;
esac
fi fi
if [[ $ipsw_openssh == 1 ]]; then if [[ $ipsw_openssh == 1 ]]; then
JBFiles+=("../resources/jailbreak/sshdeb.tar") JBFiles+=("$jelbrek/sshdeb.tar")
fi fi
cp ../resources/jailbreak/freeze.tar . cp $jelbrek/freeze.tar .
fi fi
cp -R ../resources/firmware/powdersn0wBundles ./FirmwareBundles cp -R ../resources/firmware/powdersn0wBundles ./FirmwareBundles
@ -2078,9 +2092,9 @@ ipsw_prepare_powder2() {
ExtraArgs+=" ../saved/$device_type/activation.tar" ExtraArgs+=" ../saved/$device_type/activation.tar"
fi fi
if [[ $ipsw_jailbreak == 1 ]]; then if [[ $ipsw_jailbreak == 1 ]]; then
cp ../resources/jailbreak/freeze.tar . cp $jelbrek/freeze.tar .
if [[ $ipsw_openssh == 1 ]]; then if [[ $ipsw_openssh == 1 ]]; then
ExtraArgs+=" ../resources/jailbreak/sshdeb.tar" ExtraArgs+=" $jelbrek/sshdeb.tar"
fi fi
fi fi
log "Preparing custom IPSW: $dir/powdersn0w $ipsw_path.ipsw temp.ipsw -base $ipsw_base_path.ipsw $ExtraArgs" log "Preparing custom IPSW: $dir/powdersn0w $ipsw_path.ipsw temp.ipsw -base $ipsw_base_path.ipsw $ExtraArgs"
@ -2104,7 +2118,6 @@ ipsw_prepare_custom() {
local decrypt local decrypt
local patch="../resources/patch/old/$device_type/$device_target_vers" local patch="../resources/patch/old/$device_type/$device_target_vers"
local RootSize local RootSize
local jelbrek="../resources/jailbreak"
if [[ -e "$ipsw_custom.ipsw" ]]; then if [[ -e "$ipsw_custom.ipsw" ]]; then
log "Found existing Custom IPSW. Skipping IPSW creation." log "Found existing Custom IPSW. Skipping IPSW creation."
@ -2116,7 +2129,8 @@ ipsw_prepare_custom() {
if [[ $device_target_vers == "5"* ]]; then if [[ $device_target_vers == "5"* ]]; then
comps+=("iBEC") comps+=("iBEC")
elif [[ $device_type == "iPod2,1" && $device_target_vers == "3.1.3" ]]; then fi
if [[ $device_type == "iPod2,1" && $device_target_vers == "3.1.3" ]]; then
: :
else else
case $device_target_vers in case $device_target_vers in
@ -2195,7 +2209,8 @@ ipsw_prepare_custom() {
log "Extracting Cydia" log "Extracting Cydia"
"$dir/hfsplus" out.dmg untar $jelbrek/freeze.tar "$dir/hfsplus" out.dmg untar $jelbrek/freeze.tar
case $device_target_vers in case $device_target_vers in
"3.1.3" | "4.0" ) "$dir/hfsplus" out.dmg add $jelbrek/fstab_old private/etc/fstab;; "5.1.1" ) "$dir/hfsplus" out.dmg untar $jelbrek/rockyracoon.tar;;
"3.1.3" | "4.0" | "4.3.3" ) "$dir/hfsplus" out.dmg add $jelbrek/fstab_old private/etc/fstab;;
"4.2.1" | "4.1" ) "4.2.1" | "4.1" )
"$dir/hfsplus" out.dmg add $jelbrek/fstab_old private/etc/fstab "$dir/hfsplus" out.dmg add $jelbrek/fstab_old private/etc/fstab
if [[ $device_target_vers == "4.2.1" ]]; then if [[ $device_target_vers == "4.2.1" ]]; then
@ -2695,7 +2710,6 @@ device_remove4() {
} }
device_ramdisktar() { device_ramdisktar() {
local jelbrek="../resources/jailbreak"
local target="/mnt1" local target="/mnt1"
if [[ $2 == "data" ]]; then if [[ $2 == "data" ]]; then
target+="/private/var" target+="/private/var"
@ -2873,7 +2887,6 @@ device_ramdisk() {
local vers local vers
local build local build
local untether local untether
local jelbrek="../resources/jailbreak"
log "Mounting root filesystem" log "Mounting root filesystem"
$ssh -p 2222 root@127.0.0.1 "mount.sh root" $ssh -p 2222 root@127.0.0.1 "mount.sh root"
sleep 2 sleep 2
@ -2902,8 +2915,8 @@ device_ramdisk() {
6.1.[3456] ) untether="p0sixspwn.tar";; 6.1.[3456] ) untether="p0sixspwn.tar";;
6* ) untether="evasi0n6-untether.tar";; 6* ) untether="evasi0n6-untether.tar";;
5* ) untether="pris0nbarake/tar-${device_model}_$build.tar";; 5* ) untether="pris0nbarake/tar-${device_model}_$build.tar";;
4.2.1 | 4.1 | 4.0* | 3.2.2 ) untether="greenpois0n/${device_type}_${build}.tar";; 4.2.1 | 4.1 | 4.0* | 3.2.2 | 3.1.3 ) untether="greenpois0n/${device_type}_${build}.tar";;
4.3* | 4.2* ) untether="unthredeh4il.tar";; 4.3* | 4.2* ) untether="unthredeh4il.tar";;
'' ) '' )
warn "Something wrong happened. Failed to get iOS version." warn "Something wrong happened. Failed to get iOS version."
$ssh -p 2222 root@127.0.0.1 "reboot_bak" $ssh -p 2222 root@127.0.0.1 "reboot_bak"
@ -2920,8 +2933,15 @@ device_ramdisk() {
log "Nice, iOS $vers is compatible." log "Nice, iOS $vers is compatible."
log "Sending $untether" log "Sending $untether"
$scp -P 2222 $jelbrek/$untether root@127.0.0.1:/mnt1 $scp -P 2222 $jelbrek/$untether root@127.0.0.1:/mnt1
# 3.2.2-4.1 untether needs to be extracted early (before data partition is mounted) # 3.1.3-4.1 untether needs to be extracted early (before data partition is mounted)
case $vers in case $vers in
5.1.1 ) device_ramdisktar rockyracoon.tar;;
5.0.1 ) device_ramdisktar corona.tar;;
5.0 )
if [[ $device_type == "iPhone4,1" ]]; then
device_ramdisktar corona.tar
fi
;;
4.1 | 4.0* | 3* ) 4.1 | 4.0* | 3* )
untether="${device_type}_${build}.tar" untether="${device_type}_${build}.tar"
log "Extracting $untether" log "Extracting $untether"
@ -3149,10 +3169,10 @@ menu_main() {
fi fi
if [[ $device_type == "iPad2"* && $device_vers == "4"* ]]; then if [[ $device_type == "iPad2"* && $device_vers == "4"* ]]; then
: :
elif (( device_proc < 7 )) && [[ $platform != "windows" ]]; then elif (( device_proc < 7 )); then
if [[ $device_mode == "Normal" ]]; then if [[ $device_mode == "Normal" ]]; then
case $device_vers in case $device_vers in
8* | 7* | 6* | 5* | 4* | 3.2.2 ) menu_items+=("Jailbreak Device");; 8* | 7* | 6* | 5* | 4* | 3.2.2 | 3.1.3 ) menu_items+=("Jailbreak Device");;
esac esac
elif [[ $device_mode != "none" ]]; then elif [[ $device_mode != "none" ]]; then
menu_items+=("Jailbreak Device") menu_items+=("Jailbreak Device")
@ -3743,7 +3763,7 @@ device_jailbreakrd() {
return return
fi fi
case $device_vers in case $device_vers in
8* | 7* | 6* | 5* | 4* | 3.2.2 ) :;; 8* | 7* | 6* | 5* | 4* | 3.2.2 | 3.1.3 ) :;;
* ) warn "This version is not supported for jailbreaking with SSHRD."; return;; * ) warn "This version is not supported for jailbreaking with SSHRD."; return;;
esac esac
fi fi