Add Disable/Enable Exploit to ramdisk menu, also always show Start Restore option for 2G and touch 1 devices

This commit is contained in:
LukeeGD 2024-10-12 08:53:52 +08:00
parent efcdfb23d2
commit be0223dd9f

View File

@ -2201,7 +2201,9 @@ ipsw_preference_set() {
;; ;;
esac esac
if [[ $device_target_powder == 1 || $device_target_tethered == 1 || if [[ $device_proc == 1 && $device_type != "iPhone1,2" ]]; then
ipsw_canmemory=
elif [[ $device_target_powder == 1 || $device_target_tethered == 1 ||
$ipsw_jailbreak == 1 || $ipsw_gasgauge_patch == 1 || $ipsw_nskip == 1 || $ipsw_jailbreak == 1 || $ipsw_gasgauge_patch == 1 || $ipsw_nskip == 1 ||
$device_type == "$device_disable_bbupdate" ]]; then $device_type == "$device_disable_bbupdate" ]]; then
ipsw_canmemory=1 ipsw_canmemory=1
@ -5007,6 +5009,8 @@ ipsw_prepare() {
1 ) 1 )
if [[ $ipsw_jailbreak == 1 ]]; then if [[ $ipsw_jailbreak == 1 ]]; then
ipsw_prepare_s5l8900 ipsw_prepare_s5l8900
elif [[ $device_target_vers == "$device_latest_vers" && ! -s "../$ipsw_latest_path.ipsw" ]]; then
ipsw_download "../$ipsw_latest_path"
fi fi
;; ;;
@ -5712,6 +5716,21 @@ device_ramdisk() {
;; ;;
"setnvram" ) "setnvram" )
device_ramdisk_setnvram
log "Rebooting device"
$ssh -p $ssh_port root@127.0.0.1 "reboot_bak"
return
;;
* ) log "Device should now boot to SSH ramdisk mode.";;
esac
echo
print "* Mount filesystems with this command:"
print " mount.sh"
menu_ramdisk
}
device_ramdisk_setnvram() {
log "Sending commands for setting NVRAM variables..." log "Sending commands for setting NVRAM variables..."
$ssh -p $ssh_port root@127.0.0.1 "nvram -c; nvram boot-partition=$rec" $ssh -p $ssh_port root@127.0.0.1 "nvram -c; nvram boot-partition=$rec"
if [[ $rec == 2 ]]; then if [[ $rec == 2 ]]; then
@ -5736,17 +5755,7 @@ device_ramdisk() {
;; ;;
esac esac
fi fi
$ssh -p $ssh_port root@127.0.0.1 "reboot_bak" log "Done"
log "Done, your device should reboot now"
return
;;
* ) log "Device should now boot to SSH ramdisk mode.";;
esac
echo
print "* Mount filesystems with this command:"
print " mount.sh"
menu_ramdisk
} }
device_ramdisk_ios3exploit() { device_ramdisk_ios3exploit() {
@ -5812,7 +5821,6 @@ device_ramdisk_iosvers() {
menu_ramdisk() { menu_ramdisk() {
local loop local loop
local mode
local menu_items=("Connect to SSH" "Dump Blobs") local menu_items=("Connect to SSH" "Dump Blobs")
local reboot="reboot_bak" local reboot="reboot_bak"
if (( device_proc >= 7 )); then if (( device_proc >= 7 )); then
@ -5831,6 +5839,10 @@ menu_ramdisk() {
if (( device_proc >= 5 )); then if (( device_proc >= 5 )); then
menu_items+=("Erase All (iOS 9+)") menu_items+=("Erase All (iOS 9+)")
fi fi
case $device_type in
iPhone3,[13] | iPhone[45]* | iPad1,1 | iPad2,4 | iPod[35],1 ) menu_items+=("Disable/Enable Exploit");;
esac
menu_items+=("Disable/Enable Exploit")
menu_items+=("Clear NVRAM" "Get iOS Version" "Reboot Device" "Exit") menu_items+=("Clear NVRAM" "Get iOS Version" "Reboot Device" "Exit")
print "* For accessing data, note the following:" print "* For accessing data, note the following:"
@ -5865,9 +5877,11 @@ menu_ramdisk() {
"Erase All (iOS 9+)" ) mode="erase9";; "Erase All (iOS 9+)" ) mode="erase9";;
"Clear NVRAM" ) mode="clearnvram";; "Clear NVRAM" ) mode="clearnvram";;
"Dump SEP Firmware" ) mode="dump-sep";; "Dump SEP Firmware" ) mode="dump-sep";;
"Disable/Enable Exploit" ) menu_remove4;;
"Exit" ) mode="exit";; "Exit" ) mode="exit";;
esac esac
done done
case $mode in case $mode in
"ssh" ) "ssh" )
log "Use the \"exit\" command to go back to SSH Ramdisk Menu" log "Use the \"exit\" command to go back to SSH Ramdisk Menu"
@ -6019,6 +6033,7 @@ menu_ramdisk() {
$ssh -p $ssh_port root@127.0.0.1 "nvram oblit-inprogress=5" $ssh -p $ssh_port root@127.0.0.1 "nvram oblit-inprogress=5"
log "Done. Reboot to apply changes, or clear NVRAM now to cancel erase" log "Done. Reboot to apply changes, or clear NVRAM now to cancel erase"
;; ;;
"remove4" ) device_ramdisk_setnvram;;
esac esac
done done
} }
@ -7227,6 +7242,8 @@ menu_ipsw() {
if [[ -n $ipsw_path ]]; then if [[ -n $ipsw_path ]]; then
print "* Selected IPSW: $ipsw_path.ipsw" print "* Selected IPSW: $ipsw_path.ipsw"
menu_items+=("$start") menu_items+=("$start")
elif [[ $device_proc == 1 && $device_type != "iPhone1,2" ]]; then
menu_items+=("$start")
else else
print "* Select $1 IPSW to continue" print "* Select $1 IPSW to continue"
fi fi