@@ -2176,12 +2176,12 @@ device_enter_mode() {
21762176 if [[ $device_type == " iPhone2,1" || $device_type == " iPod3,1" ]]; then
21772177 tool=" ipwnder"
21782178 if [[ $platform == " macos" ]]; then
2179- tool=" reipwnder "
2179+ tool=" ipwnder_lite "
21802180 fi
21812181 elif [[ $device_type == " iPod2,1" || $device_proc == 4 ]]; then
21822182 tool=" primepwn"
21832183 if [[ $platform == " macos" && $platform_arch == " arm64" && $device_type != " iPod2,1" ]]; then
2184- tool=" reipwnder "
2184+ tool=" ipwnder_lite "
21852185 fi
21862186 elif [[ $device_proc == 6 ]]; then
21872187 tool=" ipwnder"
@@ -2233,12 +2233,6 @@ device_enter_mode() {
22332233 log " Placing device to pwnDFU mode using primepwn"
22342234 $primepwn
22352235 tool_pwned=$?
2236- elif [[ $tool == " reipwnder" ]]; then
2237- log " Placing device in pwnDFU mode using reipwnder"
2238- mkdir shellcode
2239- cp ../resources/limera1n-shellcode.bin shellcode/
2240- ../bin/macos/reipwnder -p
2241- tool_pwned=$?
22422236 fi
22432237 sleep 1
22442238
@@ -2659,7 +2653,8 @@ ipsw_preference_set() {
26592653 case $device_latest_vers in
26602654 [76543]* ) ipsw_canjailbreak=1;;
26612655 esac
2662- if [[ $device_target_vers == " $device_latest_vers " && $device_deadbb == 1 ]]; then
2656+ if [[ $device_target_vers == " $device_latest_vers " && $device_deadbb == 1 ]] ||
2657+ [[ $device_proc == 6 && $target_vers_maj == 10 && $device_target_other == 1 ]]; then
26632658 ipsw_gasgauge_patch=1
26642659 fi
26652660 if (( device_proc >= 7 )) || [[ $device_target_vers == " $device_latest_vers " && $ipsw_canjailbreak != 1 && $ipsw_gasgauge_patch != 1 ]]; then
@@ -2807,6 +2802,8 @@ ipsw_preference_set() {
28072802 ipsw_canmemory=
28082803 elif [[ -n $device_type_special ]]; then
28092804 ipsw_canmemory=
2805+ elif [[ $device_proc == 6 && $target_vers_maj == 10 && $device_target_other == 1 ]]; then
2806+ ipsw_canmemory=
28102807 elif [[ $device_target_powder == 1 || $device_target_tethered == 1 ||
28112808 $ipsw_jailbreak == 1 || $ipsw_gasgauge_patch == 1 || $ipsw_nskip == 1 ||
28122809 $device_type == " $device_disable_bbupdate " ]]; then
@@ -3828,7 +3825,7 @@ ipsw_prepare_32bit() {
38283825 case $device_target_vers in
38293826 [23]* | 4.[01]* ) ipsw_prepare_jailbreak $1 ; return ;;
38303827 10* )
3831- if [[ ! -s " $ipsw_custom .ipsw" ]]; then
3828+ if [[ ! -s " $ipsw_custom .ipsw" && $ipsw_gasgauge_patch == 1 ]]; then
38323829 log " Copying custom IPSW..."
38333830 cp " $ipsw_path .ipsw" " $ipsw_custom .ipsw"
38343831 fi
@@ -4024,8 +4021,10 @@ ipsw_bbreplace() {
40244021 return
40254022 fi
40264023
4027- log " Extracting BuildManifest from IPSW"
4028- file_extract_from_archive temp.ipsw BuildManifest.plist
4024+ if [[ $1 != " exist" ]]; then
4025+ log " Extracting BuildManifest from IPSW"
4026+ file_extract_from_archive temp.ipsw BuildManifest.plist
4027+ fi
40294028 mkdir Firmware 2> /dev/null
40304029 restore_download_bbsep
40314030 cp $restore_baseband Firmware/$device_use_bb
@@ -4682,11 +4681,35 @@ ipsw_prepare_multipatch() {
46824681 [[ $device_type == " iPhone5," * ]] && ind+=(6)
46834682 fi
46844683 log " Modifying BuildManifest..."
4685- for i in " ${ind[@]} " ; do
4686- $PlistBuddy -c " Set BuildIdentities:$i :Manifest:RestoreDeviceTree:Info:Path Downgrade/RestoreDeviceTree" BuildManifest.plist
4687- $PlistBuddy -c " Set BuildIdentities:$i :Manifest:RestoreKernelCache:Info:Path Downgrade/RestoreKernelCache" BuildManifest.plist
4688- done
4689- zip -r0 temp.ipsw BuildManifest.plist
4684+ if [[ $platform == " macos" ]]; then
4685+ for i in " ${ind[@]} " ; do
4686+ $PlistBuddy -c " Set BuildIdentities:$i :Manifest:RestoreDeviceTree:Info:Path Downgrade/RestoreDeviceTree" BuildManifest.plist
4687+ $PlistBuddy -c " Set BuildIdentities:$i :Manifest:RestoreKernelCache:Info:Path Downgrade/RestoreKernelCache" BuildManifest.plist
4688+ done
4689+ else
4690+ awk -i inplace '
4691+ /^[[:space:]]*<key>RestoreDeviceTree<\/key>/ { mode = "rdt" }
4692+ /^[[:space:]]*<key>RestoreKernelCache<\/key>/ { mode = "rkc" }
4693+ /^[[:space:]]*<key>Path<\/key>/ && mode {
4694+ print
4695+ getline
4696+ match($0, /^[[:space:]]*/)
4697+ indent = substr($0, RSTART, RLENGTH)
4698+ if (mode == "rdt") {
4699+ sub(/^[[:space:]]*.*/, indent "<string>Downgrade/RestoreDeviceTree</string>")
4700+ } else if (mode == "rkc" && $0 ~ /<string>.*kernelcache.*<\/string>/) {
4701+ sub(/^[[:space:]]*.*/, indent "<string>Downgrade/RestoreKernelCache</string>")
4702+ }
4703+ mode = ""
4704+ }
4705+ { print }
4706+ ' BuildManifest.plist
4707+ fi
4708+ if [[ $device_proc == 6 && $target_vers_maj == 10 && $device_target_vers != " $device_latest_vers " ]]; then
4709+ ipsw_bbreplace exist
4710+ else
4711+ zip -r0 temp.ipsw BuildManifest.plist
4712+ fi
46904713 fi
46914714
46924715 mkdir -p $saved_path Downgrade Firmware/dfu 2> /dev/null
@@ -4736,7 +4759,8 @@ ipsw_prepare_multipatch() {
47364759 cp ${path} $name ${path} $getcomp .iphone5.RELEASE.dfu
47374760 cp ${path} $name ${path} $getcomp .iphone5b.RELEASE.dfu
47384761 cp ${path} $name ${path} $getcomp .ipad3b.RELEASE.dfu
4739- elif (( target_vers_maj >= 8 )) ; then
4762+ fi
4763+ if (( target_vers_maj >= 8 )) ; then
47404764 cp ${path} $name ${path} $getcomp .$device_model .RELEASE.dfu
47414765 fi
47424766 zip -r0 temp.ipsw ${path} $getcomp *
@@ -8948,14 +8972,15 @@ menu_ipsw() {
89488972 fi
89498973 if [[ $shsh_validate == 0 ]]; then
89508974 print " * Selected SHSH file is validated"
8975+ elif [[ $device_proc == 6 && $target_vers_maj == 10 ]]; then
8976+ warn " Validation does not work for 32-bit iOS 10 blobs."
89518977 else
89528978 warn " Selected SHSH file failed validation, proceed with caution"
89538979 if (( device_proc >= 7 )) ; then
89548980 print " * If this is an OTA/onboard/factory blob, it may be fine to use for restoring"
89558981 elif (( device_proc < 5 )) ; then
89568982 warn " Validation might be a false negative for A4 and older devices."
89578983 fi
8958- echo
89598984 fi
89608985 if (( device_proc >= 7 )) ; then
89618986 print " * Note: For OTA/onboard/factory blobs, try enabling the skip-blob flag"
@@ -9441,7 +9466,7 @@ menu_ipsw_browse() {
94419466 log " For restoring to latest iOS, select the \" Latest iOS\" option instead of \" Other\" "
94429467 pause
94439468 return
9444- elif [[ $device_target_vers == " 10" * && $device_proc == 6 ]]; then
9469+ elif [[ $device_target_vers == " 10" * && $device_proc == 6 && $device_target_other != 1 ]]; then
94459470 log " Selected IPSW ($device_target_vers ) is not supported as target version."
94469471 print " * iOS 10 versions that are not 10.3.4 are not supported for 32-bit devices."
94479472 pause
@@ -9692,6 +9717,10 @@ menu_shsh_browse() {
96929717 if (( device_proc >= 7 )) ; then
96939718 file_extract_from_archive " $val " BuildManifest.plist
96949719 shsh_validate=$( " $dir /img4tool" -s " $newpath " --verify BuildManifest.plist | tee /dev/tty | grep -c " APTicket is BAD!" )
9720+ elif [[ $device_proc == 6 && $target_vers_maj == 10 ]]; then
9721+ shsh_validate=1
9722+ shsh_path=" $newpath "
9723+ return
96959724 else
96969725 if [[ $1 == " base" ]]; then
96979726 val=" $ipsw_base_path .ipsw"
0 commit comments