From 88f9b5e3430b3524ba5ac92954fe64010892fee5 Mon Sep 17 00:00:00 2001 From: LukeZGD <26163116+LukeZGD@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:18:49 +0800 Subject: [PATCH] Add option to use iOS 8 ramdisk for A7 devices --- README.md | 2 +- .../sshrd/ios8/iBEC.j71.RELEASE.im4p.patch | Bin 0 -> 287 bytes .../sshrd/ios8/iBEC.j72.RELEASE.im4p.patch | Bin 0 -> 287 bytes .../sshrd/ios8/iBEC.j73.RELEASE.im4p.patch | Bin 0 -> 287 bytes .../sshrd/ios8/iBEC.j85.RELEASE.im4p.patch | Bin 0 -> 283 bytes .../sshrd/ios8/iBEC.j85m.RELEASE.im4p.patch | Bin 0 -> 290 bytes .../sshrd/ios8/iBEC.j86.RELEASE.im4p.patch | Bin 0 -> 283 bytes .../sshrd/ios8/iBEC.j86m.RELEASE.im4p.patch | Bin 0 -> 290 bytes .../sshrd/ios8/iBEC.j87.RELEASE.im4p.patch | Bin 0 -> 283 bytes .../sshrd/ios8/iBEC.j87m.RELEASE.im4p.patch | Bin 0 -> 290 bytes .../sshrd/ios8/iBEC.n51.RELEASE.im4p.patch | Bin 0 -> 286 bytes .../sshrd/ios8/iBEC.n53.RELEASE.im4p.patch | Bin 0 -> 288 bytes .../sshrd/ios8/iBSS.j71.RELEASE.im4p.patch | Bin 0 -> 172 bytes .../sshrd/ios8/iBSS.j72.RELEASE.im4p.patch | Bin 0 -> 172 bytes .../sshrd/ios8/iBSS.j73.RELEASE.im4p.patch | Bin 0 -> 172 bytes .../sshrd/ios8/iBSS.j85.RELEASE.im4p.patch | Bin 0 -> 173 bytes .../sshrd/ios8/iBSS.j85m.RELEASE.im4p.patch | Bin 0 -> 174 bytes .../sshrd/ios8/iBSS.j86.RELEASE.im4p.patch | Bin 0 -> 173 bytes .../sshrd/ios8/iBSS.j86m.RELEASE.im4p.patch | Bin 0 -> 174 bytes .../sshrd/ios8/iBSS.j87.RELEASE.im4p.patch | Bin 0 -> 173 bytes .../sshrd/ios8/iBSS.j87m.RELEASE.im4p.patch | Bin 0 -> 174 bytes .../sshrd/ios8/iBSS.n51.RELEASE.im4p.patch | Bin 0 -> 172 bytes .../sshrd/ios8/iBSS.n53.RELEASE.im4p.patch | Bin 0 -> 172 bytes restore.sh | 108 ++++++++++++++---- 24 files changed, 87 insertions(+), 23 deletions(-) create mode 100644 resources/sshrd/ios8/iBEC.j71.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j72.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j73.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j85.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j85m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j86.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j86m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j87.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.j87m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.n51.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBEC.n53.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j71.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j72.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j73.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j85.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j85m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j86.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j86m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j87.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.j87m.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.n51.RELEASE.im4p.patch create mode 100644 resources/sshrd/ios8/iBSS.n53.RELEASE.im4p.patch diff --git a/README.md b/README.md index 6ad3080..bacabeb 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,6 @@ - Some patches from [PwnageTool](https://www.theiphonewiki.com/wiki/PwnageTool), [sn0wbreeze](https://www.theiphonewiki.com/wiki/sn0wbreeze), [redsn0w](https://www.theiphonewiki.com/wiki/redsn0w) - Some patches made using patchers from [Bundle-Creation](https://github.com/Merculous/Bundle-Creation) - SSH Ramdisk tars 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) -- A7 SSH Ramdisk stuff is based on [SSHRD_Script](https://github.com/verygenericname/SSHRD_Script) +- A7 SSH Ramdisk stuff is based on [SSHRD_Script](https://github.com/verygenericname/SSHRD_Script) (iOS 12) and [iarchive.app](https://ios7.iarchive.app/downgrade/making-ramdisk.html) (iOS 8) - [img4lib](https://github.com/xerub/img4lib) - xerub - [img4tool](https://github.com/tihmstar/img4tool) - tihmstar diff --git a/resources/sshrd/ios8/iBEC.j71.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j71.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b4f083b7356785a785dd82cee8e007dea7fa477 GIT binary patch literal 287 zcmZ)U}P}1C_#?$bnRmzC1*T}?S)U}P}1C_#?$bnRmzC1*T}?S)U}P}1C_#?$bnRmzC1*T}?SV zQv(H7egaceD_YJIT{`YPtJ)jAZ$|kru&J3fpvC+15*MM z1H*pxxj^SCX>L;EY53AAWyIENWa6;$r!hlNK<-|7(K8AX5h8K77SwZt%@V2>`^f+R D<#twz literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.j85m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j85m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ebb06b191af941605fe45c5a1c70ddf469a6865 GIT binary patch literal 290 zcmZm&9H$J%yNp#urzdxR11zg*0Jv_1B1jh*GdgR2L=ZPCkF-w z2L=HJ2193G0|pbfo;LRtXO+Y639u|(u<-FF_nKlp|D$&%`iZC*F4EuZfH3I8`qG08 zjFJDtZ@2)>QDR_pU}9ht0Gg%1k|N;1!2pB`3?W8~m3^AkE>tyXx;0LAVBCLd$%B9; z8jB5_fAsJ@-zf MIT{{9)nY#x03}>oX#fBK literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.j86.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j86.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..428318de7a28cab4b57c866bb4cb2373ebdbec89 GIT binary patch literal 283 zcmZV zQv(H7egaceD_YJIT{`YPtJ)jAZ$|kru&J3fpvC+15*MM z1H*pxxj^SCX>L;EY53AAWyIENWa6;$r!hlNK<-|7(K8AX5h8K77SwZt%@V2>`^f+R D<#twz literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.j86m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j86m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ebb06b191af941605fe45c5a1c70ddf469a6865 GIT binary patch literal 290 zcmZm&9H$J%yNp#urzdxR11zg*0Jv_1B1jh*GdgR2L=ZPCkF-w z2L=HJ2193G0|pbfo;LRtXO+Y639u|(u<-FF_nKlp|D$&%`iZC*F4EuZfH3I8`qG08 zjFJDtZ@2)>QDR_pU}9ht0Gg%1k|N;1!2pB`3?W8~m3^AkE>tyXx;0LAVBCLd$%B9; z8jB5_fAsJ@-zf MIT{{9)nY#x03}>oX#fBK literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.j87.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j87.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..428318de7a28cab4b57c866bb4cb2373ebdbec89 GIT binary patch literal 283 zcmZV zQv(H7egaceD_YJIT{`YPtJ)jAZ$|kru&J3fpvC+15*MM z1H*pxxj^SCX>L;EY53AAWyIENWa6;$r!hlNK<-|7(K8AX5h8K77SwZt%@V2>`^f+R D<#twz literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.j87m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.j87m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ebb06b191af941605fe45c5a1c70ddf469a6865 GIT binary patch literal 290 zcmZm&9H$J%yNp#urzdxR11zg*0Jv_1B1jh*GdgR2L=ZPCkF-w z2L=HJ2193G0|pbfo;LRtXO+Y639u|(u<-FF_nKlp|D$&%`iZC*F4EuZfH3I8`qG08 zjFJDtZ@2)>QDR_pU}9ht0Gg%1k|N;1!2pB`3?W8~m3^AkE>tyXx;0LAVBCLd$%B9; z8jB5_fAsJ@-zf MIT{{9)nY#x03}>oX#fBK literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.n51.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.n51.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..0fa81a2ba2b1484240a174acf17d51c3a7caa014 GIT binary patch literal 286 zcmZ5z#tjs@KeJvK!Ayd!NGw+ zK!HJVkqNKdVntsgLqkK!{@Cp$j9gzd9{-rpXxy7tr}w0*V4))4!ola56Aj z*M(njabRFjVqs(eLI;Kf78d~rjsOk@4h4n~qh6K-pR5E|4Jo!+j8j&voWmt`U=`yQ zCJw!sOiE3OS*jaL+>%!RKlNtS@4X)xSQ-MH8OEn`O}yoC?I#QyyzJPi3pLnTMO#BcPh=%@DQpN H`^f+R2b@#D literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBEC.n53.RELEASE.im4p.patch b/resources/sshrd/ios8/iBEC.n53.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..6dba70fc9b8ed4a89b02b632160ff68617f5e257 GIT binary patch literal 288 zcmZO(47p7 z)^*_*T!8wOSQs4`85kWH5?EXW95@6x7&sIdLX4JOG??LbIhZA=aY5z+$+Mw84+5^S z2Jk)*a4b0?C?b4MYsUE%vx@Fce^#~G|L+b450=J*;?y>1SSTC{pxdp?p4y-MM!m0|QIMfdT~<1_vO^fkA=6 zkcUI_m*Xp;>KB_`9+s;Fw{r5|o_$LIp{u>xgOPz@OHj!H2L>euMivGJCIuE20R|2Q vh7gAfCQMVEoqc8t&HE@=ekD-9bZ+9@_Z6-D;zh0&0TV!4K?Xs1AlCo@$a*bt literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBSS.j85m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBSS.j85m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f70b4016046c7094eceb4a86f1c64d0a0ead471 GIT binary patch literal 174 zcmZ z@^DDyIxc1nJSXma^v*;-5fyf>pbrfQT@I-MM!m0|QIMfdT~<1_vO^fkA=6 zkcUI_m*Xp;>KB_`9+s;Fw{r5|o_$LIp{u>xgOPz@OHj!H2L>euMivGJCIuE20R|2Q vh7gAfCQMVEoqc8t&HE@=ekD-9bZ+9@_Z6-D;zh0&0TV!4K?Xs1AlCo@$a*bt literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBSS.j86m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBSS.j86m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f70b4016046c7094eceb4a86f1c64d0a0ead471 GIT binary patch literal 174 zcmZ z@^DDyIxc1nJSXma^v*;-5fyf>pbrfQT@I-MM!m0|QIMfdT~<1_vO^fkA=6 zkcUI_m*Xp;>KB_`9+s;Fw{r5|o_$LIp{u>xgOPz@OHj!H2L>euMivGJCIuE20R|2Q vh7gAfCQMVEoqc8t&HE@=ekD-9bZ+9@_Z6-D;zh0&0TV!4K?Xs1AlCo@$a*bt literal 0 HcmV?d00001 diff --git a/resources/sshrd/ios8/iBSS.j87m.RELEASE.im4p.patch b/resources/sshrd/ios8/iBSS.j87m.RELEASE.im4p.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f70b4016046c7094eceb4a86f1c64d0a0ead471 GIT binary patch literal 174 zcmZ z@^DDyIxc1nJSXma^v*;-5fyf>pbrfQT@I`(D8L=$(mvA}ahF@4svSnIm50Y7sC2`(D8L=$(mvA}ahF@4svSnIm50Y7sC2/dev/null & + if [[ -n $1 ]]; then + port=$1 + fi + $iproxy $ssh_port $port >/dev/null & iproxy_pid=$! sleep 1 } @@ -4015,7 +4019,7 @@ device_send_rdtar() { device_ramdisk64() { local sshtar="../saved/ssh-64.tar" - local comps=("iBSS" "iBEC" "DeviceTree" "Kernelcache" "Trustcache" "RestoreRamdisk") + local comps=("iBSS" "iBEC" "DeviceTree" "Kernelcache" "RestoreRamdisk") local name local iv local key @@ -4023,16 +4027,41 @@ device_ramdisk64() { local url local decrypt local build_id="16A366" - local ramdisk_path="../saved/$device_type/ramdisk_$build_id" - device_target_build="$build_id" + local ios8 + local opt - if [[ ! -e $sshtar ]]; then - log "Downloading ssh.tar from SSHRD_Script..." - curl -LO https://github.com/verygenericname/sshtars/raw/a6a93db54cc30a72f577744e50fb66ae57b24990/ssh.tar.gz - mv ssh.tar.gz $sshtar.gz - gzip -d $sshtar.gz + print "* Version Selection" + print "* The version of the SSH Ramdisk is set to iOS 12 by default." + print "* There is also an option to use iOS 8 ramdisk. Select N to fix devices on iOS 7 or 8 not booting after using iOS 12 ramdisk." + print "* If not sure, just press Enter/Return. This will select the default version." + read -p "$(input "Select Y to use iOS 12, select N to use iOS 8 (Y/n) ")" opt + if [[ $opt == 'n' || $opt == 'N' ]]; then + ios8=1 fi + if [[ $ios8 == 1 ]]; then + build_id="12B410" + if [[ $device_type == "iPhone"* ]]; then + build_id="12B411" + fi + sshtar="../saved/iram.tar" + if [[ ! -e $sshtar ]]; then + log "Downloading iram.tar from iarchive.app..." + curl -LO https://iarchive.app/Download/iram.tar + mv iram.tar $sshtar + fi + else + comps+=("Trustcache") + if [[ ! -e $sshtar ]]; then + log "Downloading ssh.tar from SSHRD_Script..." + curl -LO https://github.com/verygenericname/sshtars/raw/a6a93db54cc30a72f577744e50fb66ae57b24990/ssh.tar.gz + mv ssh.tar.gz $sshtar.gz + gzip -d $sshtar.gz + fi + fi + + local ramdisk_path="../saved/$device_type/ramdisk_$build_id" + device_target_build="$build_id" device_fw_key_check ipsw_get_url $build_id @@ -4047,6 +4076,9 @@ device_ramdisk64() { "Trustcache" ) path="Firmware/";; * ) path="";; esac + if [[ $ios8 == 1 && $getcomp == "DeviceTree" ]]; then + path+="all_flash.${device_model}ap.production/" + fi if [[ -z $name ]]; then local hwmodel case $device_type in @@ -4075,20 +4107,45 @@ device_ramdisk64() { local reco="-i $getcomp.orig -o $getcomp.img4 -M ../resources/sshrd/IM4M -T " case $getcomp in "iBSS" | "iBEC" ) + reco+="$(echo $getcomp | tr '[:upper:]' '[:lower:]') -A" "$dir/img4" -i $getcomp.orig -o $getcomp.dec -k ${iv}${key} mv $getcomp.orig $getcomp.orig0 - $bspatch $getcomp.dec $getcomp.orig ../resources/sshrd/$name.patch - reco+="$(echo $getcomp | tr '[:upper:]' '[:lower:]') -A" + if [[ $ios8 == 1 ]]; then + $bspatch $getcomp.dec $getcomp.orig ../resources/sshrd/ios8/$name.patch + else + $bspatch $getcomp.dec $getcomp.orig ../resources/sshrd/$name.patch + fi + ;; + "Kernelcache" ) + reco+="rkrn" + if [[ $ios8 == 1 ]]; then + mv $getcomp.orig $getcomp.orig0 + "$dir/img4" -i $getcomp.orig0 -o $getcomp.orig -k ${iv}${key} -D + else + reco+=" -P ../resources/sshrd/$name.bpatch" + fi + ;; + "DeviceTree" ) + reco+="rdtr" + if [[ $ios8 == 1 ]]; then + reco+=" -A" + mv $getcomp.orig $getcomp.orig0 + "$dir/img4" -i $getcomp.orig0 -o $getcomp.orig -k ${iv}${key} + [[ -e DeviceTree.orig ]] && echo nice + fi ;; - "Kernelcache" ) reco+="rkrn -P ../resources/sshrd/$name.bpatch";; - "DeviceTree" ) reco+="rdtr";; "Trustcache" ) reco+="rtsc";; "RestoreRamdisk" ) - mv $getcomp.orig $getcomp.orig0 - "$dir/img4" -i $getcomp.orig0 -o $getcomp.orig - "$dir/hfsplus" $getcomp.orig grow 210000000 - "$dir/hfsplus" $getcomp.orig untar $sshtar reco+="rdsk -A" + mv $getcomp.orig $getcomp.orig0 + if [[ $ios8 == 1 ]]; then + "$dir/img4" -i $getcomp.orig0 -o $getcomp.orig -k ${iv}${key} + "$dir/hfsplus" $getcomp.orig grow 50000000 + else + "$dir/img4" -i $getcomp.orig0 -o $getcomp.orig + "$dir/hfsplus" $getcomp.orig grow 210000000 + fi + "$dir/hfsplus" $getcomp.orig untar $sshtar ;; esac "$dir/img4" $reco @@ -4106,15 +4163,22 @@ device_ramdisk64() { $irecovery -c ramdisk $irecovery -f $ramdisk_path/DeviceTree.img4 $irecovery -c devicetree - $irecovery -f $ramdisk_path/Trustcache.img4 - $irecovery -c firmware + if [[ $ios8 != 1 ]]; then + $irecovery -f $ramdisk_path/Trustcache.img4 + $irecovery -c firmware + fi $irecovery -f $ramdisk_path/Kernelcache.img4 $irecovery -c bootx - device_iproxy + if [[ $ios8 == 1 ]]; + device_iproxy 44 + print "* Booted SSH ramdisk is based on: https://ios7.iarchive.app/downgrade/making-ramdisk.html" + else + device_iproxy + print "* Booted SSH ramdisk is based on: https://github.com/verygenericname/SSHRD_Script" + fi device_sshpass alpine - print "* Booted SSH ramdisk is based on: https://github.com/verygenericname/SSHRD_Script" print "* Mount filesystems with this command (for newer iOS versions only!):" print " mount_filesystems" print "* Mount root filesystem with this command (tested for iOS 10.3.x):" @@ -5982,7 +6046,7 @@ device_enter_ramdisk() { return elif (( device_proc >= 5 )); then print "* To mount /var (/mnt2) for iOS 9-10, I recommend using 9.0.2 (13A452)." - print "* If not sure, just press Enter/Return. This will select the default build version." + print "* If not sure, just press Enter/Return. This will select the default version." read -p "$(input 'Enter build version (eg. 10B329): ')" device_rd_build fi device_ramdisk