From c4b76662101c63c025ccb608c7cff3332070d7ea Mon Sep 17 00:00:00 2001
From: LukeZGD <26163116+LukeZGD@users.noreply.github.com>
Date: Thu, 5 Oct 2023 15:12:31 +0800
Subject: [PATCH] Allow 7.x targets for powdersn0w
---
README.md | 6 +++---
restore.sh | 56 +++++++++++++++++++++++++++++++-----------------------
2 files changed, 35 insertions(+), 27 deletions(-)
diff --git a/README.md b/README.md
index e056ec0..07b0d8b 100644
--- a/README.md
+++ b/README.md
@@ -80,9 +80,9 @@
- iPad Air 1, mini 2, mini 3
- iPod touch 6
- Restoring with powdersn0w is supported on the following devices:
- - iPhone 4 GSM - targets iOS 4.3 to 6.1.3
- - iPhone 4 CDMA - targets iOS 5.0 to 6.1.3
- - iPhone 4S, 5, 5C, iPad 2 Rev A, iPod touch 5 - targets iOS 5.0 to 9.3.5 (not iOS 7)
+ - iPhone 4 GSM - targets iOS 4.3 to 7.1.1
+ - iPhone 4 CDMA - targets iOS 5.0 to 7.1.1
+ - iPhone 4S, 5, 5C, iPad 2 Rev A, iPod touch 5 - targets iOS 5.0 to 9.3.5
- Using powdersn0w requires iOS 7.1.x blobs for your device (7.0.x blobs can also be used for iPhone 5)
- Restoring with 24Kpwn/alloc8 is supported on the following devices:
- iPhone 3GS - targets iOS 3.1.3 to 5.1.1
diff --git a/restore.sh b/restore.sh
index 2eb1174..622a53c 100755
--- a/restore.sh
+++ b/restore.sh
@@ -1743,6 +1743,9 @@ ipsw_verify() {
if (( device_proc > 7 )); then
return
fi
+ case $build_id in
+ *[bcdefgkpquv] ) return;;
+ esac
if [[ $(echo "$IPSWSHA1" | grep -c '<') != 0 ]]; then
rm "$device_fw_dir/$build_id/sha1sum"
IPSWSHA1=
@@ -1932,12 +1935,12 @@ ipsw_prepare_keys() {
;;
"KernelCache" )
- if [[ $vers != "5"* ]]; then
+ if [[ $vers != "5"* && $vers != "7"* ]]; then
echo -e "$compFile$nameIV$ivKey$keyDecryptPathDowngrade/$compPatch" >> $NewPlist
fi
;;
esac
- if [[ $comp == "KernelCache" && $vers == "5"* ]]; then
+ if [[ $comp == "KernelCache" ]] && [[ $vers == "5"* || $vers == "7"* ]]; then
return
fi
echo -e "Decrypt" >> $NewPlist
@@ -2041,7 +2044,7 @@ ipsw_prepare_bundle() {
build="$device_base_build"
FirmwareBundle+="BASE_"
elif [[ $1 == "target" ]]; then
- if [[ $ipsw_jailbreak == 1 && $vers != "5"* ]]; then
+ if [[ $ipsw_jailbreak == 1 && $vers != "5"* && $vers != "7"* ]]; then
ipsw_prepare_config true true
else
ipsw_prepare_config false true
@@ -2092,19 +2095,20 @@ ipsw_prepare_bundle() {
echo -e "RamdiskExploit" >> $NewPlist
echo -e "exploitsrc/target/$hw/$base_build/exploit" >> $NewPlist
echo -e "injectsrc/target/$hw/$base_build/partition" >> $NewPlist
- elif [[ $1 == "target" && $vers == "5"* ]]; then
- echo -e "FilesystemPackageRamdiskPackagepackagesrc/bin.tariosios5" >> $NewPlist
elif [[ $1 == "target" ]]; then
echo -e "FilesystemPackagebootstrapfreeze.tar" >> $NewPlist
case $vers in
- 6* ) echo -e "RamdiskPackagepackagesrc/bin.tariosios6" >> $NewPlist;;
- 7* ) error "iOS 7 targets are not supported.";;
- 8* | 9* ) printf "packagesrc/ios9.tarRamdiskPackagepackagesrc/bin.tariosios" >> $NewPlist;;
+ 8* | 9* ) echo -e "packagesrc/ios9.tar" >> $NewPlist;;
esac
+ printf "RamdiskPackagepackagesrc/bin.tariosios" >> $NewPlist
case $vers in
- 8* ) echo -e "8" >> $NewPlist;;
- 9* ) echo -e "9" >> $NewPlist;;
+ 5* ) printf "5" >> $NewPlist;;
+ 6* ) printf "6" >> $NewPlist;;
+ 7* ) printf "7" >> $NewPlist;;
+ 8* ) printf "8" >> $NewPlist;;
+ 9* ) printf "9" >> $NewPlist;;
esac
+ echo -e "" >> $NewPlist
else
echo -e "FilesystemPackageRamdiskPackage" >> $NewPlist
fi
@@ -2118,7 +2122,7 @@ ipsw_prepare_bundle() {
ipsw_prepare_keys RestoreRamdisk $1
ipsw_prepare_keys RestoreDeviceTree $1
ipsw_prepare_keys RestoreLogo $1
- if [[ $1 != "target" || $vers == "5"* ]]; then
+ if [[ $1 != "target" || $vers == "5"* || $vers == "7"* ]]; then
ipsw_prepare_keys RestoreKernelCache $1
else
ipsw_prepare_keys KernelCache $1
@@ -2358,9 +2362,11 @@ ipsw_prepare_powder() {
fi
if [[ $ipsw_jailbreak == 1 ]]; then
cp $jelbrek/freeze.tar .
- if [[ $device_target_vers == "5"* ]]; then
- ExtraArgs+=" freeze.tar $jelbrek/cydiasubstrate.tar $jelbrek/g1lbertJB.tar $jelbrek/g1lbertJB/${device_type}_${device_target_build}.tar"
- fi
+ case $device_target_vers in
+ "5"* ) ExtraArgs+=" freeze.tar $jelbrek/cydiasubstrate.tar $jelbrek/g1lbertJB.tar $jelbrek/g1lbertJB/${device_type}_${device_target_build}.tar";;
+ "7.0"* ) ExtraArgs+=" freeze.tar $jelbrek/evasi0n7-untether.tar $jelbrek/fstab7.tar";;
+ "7.1"* ) ExtraArgs+=" freeze.tar $jelbrek/panguaxe.tar $jelbrek/fstab7.tar";;
+ esac
if [[ $ipsw_openssh == 1 ]]; then
ExtraArgs+=" $jelbrek/sshdeb.tar"
fi
@@ -3922,12 +3928,12 @@ menu_ipsw() {
else
print "* Select Target IPSW to continue"
case $device_type in
- iPhone3,1 ) print "* Any iOS version from 4.3 to 6.1.3 is supported";;
- iPhone3,3 ) print "* Any iOS version from 5.0 to 6.1.3 is supported";;
- iPhone4,1 | iPad2,[123] ) print "* Any iOS version from 5.0 to 9.3.5 is supported (not iOS 7)";;
- iPad2,4 | iPad3,[123] ) print "* Any iOS version from 5.1 to 9.3.5 is supported (not iOS 7)";;
- iPhone5,[12] | iPad3,[456] ) print "* Any iOS version from 6.0 to 9.3.5 is supported (not iOS 7)";;
- iPhone5,[34] ) print "* Any iOS version from 8.0 to 9.3.5 is supported";;
+ iPhone3,1 ) print "* Any iOS version from 4.3 to 7.1.1 is supported";;
+ iPhone3,3 ) print "* Any iOS version from 5.0 to 7.1.1 is supported";;
+ iPhone4,1 | iPad2,[123] ) print "* Any iOS version from 5.0 to 9.3.5 is supported";;
+ iPad2,4 | iPad3,[123] ) print "* Any iOS version from 5.1 to 9.3.5 is supported";;
+ iPhone5,[12] | iPad3,[456] ) print "* Any iOS version from 6.0 to 9.3.5 is supported";;
+ iPhone5,[34] ) print "* Any iOS version from 7.0 to 9.3.5 is supported";;
esac
fi
echo
@@ -4161,7 +4167,7 @@ menu_ipsw_browse() {
;;
*"powdersn0w"* )
case $device_target_build in
- "8A"* | "8B"* | "8C"* | "8G4" | "8H7" | "8K2" | "11"* | "14"* )
+ "8A"* | "8B"* | "8C"* | "8G4" | "8H7" | "8K2" | "14"* )
log "Selected IPSW ($device_target_vers) is not supported as target version."
if [[ $device_target_build == "8"* ]]; then
print "* Supported iOS 4.3.x versions: 4.3, 4.3.3, 4.3.5"
@@ -4384,9 +4390,11 @@ device_dump() {
cp $arg.tar $dump
elif [[ $device_mode == "DFU" ]]; then
device_ramdisk $arg
- device_find_mode Recovery
- device_enter_mode DFU
- device_enter_mode pwnDFU
+ if [[ $mode != "baseband" ]]; then
+ device_find_mode Recovery
+ device_enter_mode DFU
+ device_enter_mode pwnDFU
+ fi
fi
kill $iproxy_pid
if [[ ! -e $dump ]]; then