This commit is contained in:
LukeZGD 2024-04-09 21:29:28 +08:00
parent 3faf409a6b
commit b1d21f798b

View File

@ -761,12 +761,8 @@ device_get_info() {
device_proc=8;; # A8 device_proc=8;; # A8
iPhone8,[124] ) iPhone8,[124] )
device_proc=9;; # A9 device_proc=9;; # A9
iPhone9,[1234] | iPod9,1 ) iPhone9,[1234] | iPhone10* | iPad6* | iPod9,1 )
device_proc=10;; # A10 device_proc=10;; # A10 (or A9/A11 iOS 16 device)
iPhone10* | iPad6* )
device_proc=10
device_ios16=1
;;
iPhone* | iPad* ) iPhone* | iPad* )
device_proc=11;; # Newer devices device_proc=11;; # Newer devices
esac esac
@ -3525,8 +3521,7 @@ ipsw_prepare_patchcomp() {
zip -r0 "$ipsw_custom.ipsw" $path/$name.$ext zip -r0 "$ipsw_custom.ipsw" $path/$name.$ext
} }
ipsw_prepare_custom() { ipsw_prepare_s5l8900() {
if [[ $device_proc == 1 ]]; then
local rname="018-6494-014.dmg" local rname="018-6494-014.dmg"
local sha1E="4f6539d2032a1c7e1a068c667e393e62d8912700" local sha1E="4f6539d2032a1c7e1a068c667e393e62d8912700"
local sha1L local sha1L
@ -3546,6 +3541,7 @@ ipsw_prepare_custom() {
sha1E="f76cd3d4deaf82587dc758c6fbe724c31c9b6de2" sha1E="f76cd3d4deaf82587dc758c6fbe724c31c9b6de2"
ipsw_url="https://github.com/LukeZGD/Legacy-iOS-Kit-Keys/releases/download/jailbreak/iPod1.1_3.1.3_7E18_Custom.ipsw" ipsw_url="https://github.com/LukeZGD/Legacy-iOS-Kit-Keys/releases/download/jailbreak/iPod1.1_3.1.3_7E18_Custom.ipsw"
fi fi
if [[ $device_type == "iPhone1,2" && -e "$ipsw_custom.ipsw" ]]; then if [[ $device_type == "iPhone1,2" && -e "$ipsw_custom.ipsw" ]]; then
log "Checking RestoreRamdisk hash of custom IPSW" log "Checking RestoreRamdisk hash of custom IPSW"
unzip -o -j "$ipsw_custom.ipsw" $rname unzip -o -j "$ipsw_custom.ipsw" $rname
@ -3555,14 +3551,16 @@ ipsw_prepare_custom() {
sha1L=$($sha1sum "$ipsw_custom.ipsw" | awk '{print $1}') sha1L=$($sha1sum "$ipsw_custom.ipsw" | awk '{print $1}')
fi fi
if [[ $sha1L == "$sha1E" ]]; then if [[ $sha1L == "$sha1E" ]]; then
log "Found existing Custom IPSW. Skipping IPSW creation." log "Verified existing Custom IPSW. Skipping IPSW creation."
return return
else else
log "Verifying IPSW failed. Expected $sha1E, got $sha1L" log "Verifying IPSW failed. Expected $sha1E, got $sha1L"
fi fi
log "Deleting custom IPSW if it exists" if [[ -e "$ipsw_custom.ipsw" ]]; then
rm -f "$ipsw_custom.ipsw" log "Deleting existing custom IPSW"
rm "$ipsw_custom.ipsw"
fi
if [[ $device_type != "iPhone1,2" ]]; then if [[ $device_type != "iPhone1,2" ]]; then
log "Downloading IPSW: $ipsw_url" log "Downloading IPSW: $ipsw_url"
@ -3577,21 +3575,8 @@ ipsw_prepare_custom() {
return return
fi fi
elif [[ -e "$ipsw_custom.ipsw" ]]; then
log "Found existing Custom IPSW. Skipping IPSW creation."
return
elif [[ $device_target_vers == "4.1" && $ipsw_jailbreak != 1 ]]; then
log "No need to create custom IPSW for non-jailbroken restores on $device_type-$device_target_build"
return
fi
ipsw_prepare_jailbreak old ipsw_prepare_jailbreak old
if [[ $device_type == "iPod2,1" ]]; then
case $device_target_vers in
4.2.1 | 4.1 | 3.1.3 ) :;;
* ) ipsw_prepare_patchcomp LLB;;
esac
elif [[ $device_proc == 1 ]]; then
ipsw_prepare_patchcomp LLB ipsw_prepare_patchcomp LLB
ipsw_prepare_patchcomp iBoot ipsw_prepare_patchcomp iBoot
ipsw_prepare_patchcomp RestoreRamdisk ipsw_prepare_patchcomp RestoreRamdisk
@ -3602,6 +3587,24 @@ ipsw_prepare_custom() {
ipsw_prepare_patchcomp WTF2 ipsw_prepare_patchcomp WTF2
ipsw_prepare_patchcomp iBEC ipsw_prepare_patchcomp iBEC
fi fi
}
ipsw_prepare_custom() {
if [[ -e "$ipsw_custom.ipsw" ]]; then
log "Found existing Custom IPSW. Skipping IPSW creation."
return
elif [[ $device_target_vers == "4.1" && $ipsw_jailbreak != 1 ]]; then
log "No need to create custom IPSW for non-jailbroken restores on $device_type-$device_target_build"
return
fi
ipsw_prepare_jailbreak old
if [[ $device_type == "iPod2,1" ]]; then
case $device_target_vers in
4.2.1 | 4.1 | 3.1.3 ) :;;
* ) ipsw_prepare_patchcomp LLB;;
esac
else # 3GS else # 3GS
case $device_target_vers in case $device_target_vers in
6.1.6 | 4.1 ) :;; 6.1.6 | 4.1 ) :;;
@ -3629,7 +3632,7 @@ restore_download_bbsep() {
local build_id local build_id
local baseband_sha1 local baseband_sha1
local restore_baseband_check local restore_baseband_check
if [[ $device_latest_vers == "15"* ]]; then if [[ $device_latest_vers == "15"* || $device_latest_vers == "16"* ]]; then
return return
elif [[ $device_latest_vers == "$device_use_vers" || $device_target_vers == "10"* ]]; then elif [[ $device_latest_vers == "$device_use_vers" || $device_target_vers == "10"* ]]; then
build_id="$device_use_build" build_id="$device_use_build"
@ -4114,7 +4117,7 @@ restore_prepare() {
fi fi
;; ;;
esac esac
if [[ $device_latest_vers == "15"* ]]; then if [[ $device_latest_vers == "15"* || $device_latest_vers == "16"* ]]; then
if [[ $device_target_vers == "$device_latest_vers" ]]; then if [[ $device_target_vers == "$device_latest_vers" ]]; then
restore_latest restore_latest
return return
@ -4138,7 +4141,7 @@ ipsw_prepare() {
case $device_proc in case $device_proc in
1 ) 1 )
if [[ $ipsw_jailbreak == 1 ]]; then if [[ $ipsw_jailbreak == 1 ]]; then
ipsw_prepare_custom ipsw_prepare_s5l8900
fi fi
;; ;;
@ -4178,8 +4181,8 @@ ipsw_prepare() {
;; ;;
7 ) 7 )
if [[ $device_target_other != 1 && $device_target_vers == "10.3.3" ]]; then
# A7 devices 10.3.3 # A7 devices 10.3.3
if [[ $device_target_other != 1 && $device_target_vers == "10.3.3" ]]; then
ipsw_prepare_1033 ipsw_prepare_1033
fi fi
;; ;;
@ -5981,7 +5984,7 @@ menu_ipsw_browse() {
return return
;; ;;
esac esac
elif [[ $device_ios16 == 1 ]]; then elif [[ $device_latest_vers == "16"* ]]; then
case $device_target_build in case $device_target_build in
20[GH]* ) :;; # 16.6 and newer only 20[GH]* ) :;; # 16.6 and newer only
* ) * )
@ -6141,7 +6144,7 @@ menu_other() {
iPhone3,[13] | iPad1,1 | iPod3,1 ) menu_items+=("Disable/Enable Exploit");; iPhone3,[13] | iPad1,1 | iPod3,1 ) menu_items+=("Disable/Enable Exploit");;
iPhone2,1 ) menu_items+=("Install alloc8 Exploit");; iPhone2,1 ) menu_items+=("Install alloc8 Exploit");;
esac esac
if (( device_proc < 11 )) && [[ $device_ios16 != 1 ]]; then if (( device_proc < 11 )) && [[ $device_latest_vers != "16"* ]]; then
menu_items+=("SSH Ramdisk") menu_items+=("SSH Ramdisk")
fi fi
fi fi