Skip to content

Commit 1195a28

Browse files
committed
Add Update DateTime option in Other Utilities, and add Jailbroken/pwnDFU Mode Option for some modes
1 parent 7178ee4 commit 1195a28

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

restore.sh

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,7 @@ device_enter_mode() {
17361736
print "* You may also use checkm8-a5 for the Pi Pico: https://www.reddit.com/r/LegacyJailbreak/comments/1djuprf/working_checkm8a5_on_the_raspberry_pi_pico/"
17371737
print "* Also make sure that you have NOT sent a pwned iBSS yet."
17381738
print "* If you do not know what you are doing, restart your device in normal mode."
1739+
print "* For more details, go to: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/checkm8-a5"
17391740
echo
17401741
if [[ $device_todfu == 1 ]]; then
17411742
log "* After putting your device in PWNED DFU, plug it back in your PC/Mac before pressing Enter/Return."
@@ -5133,6 +5134,29 @@ device_buttons() {
51335134
done
51345135
}
51355136

5137+
device_buttons2() {
5138+
local selection=("Jailbroken" "pwnDFU")
5139+
if [[ $device_mode != "Normal" ]]; then
5140+
device_enter_mode pwnDFU
5141+
return
5142+
fi
5143+
input "Jailbroken/pwnDFU Mode Option"
5144+
print "* This device needs to be jailbroken/in kDFU mode before proceeding."
5145+
print "* Selecting 1 (Jailbroken) is recommended. Your device must be jailbroken and have OpenSSH installed for this option."
5146+
print "* Selecting 2 (pwnDFU) is for those that prefer the ramdisk method instead."
5147+
if [[ $device_proc == 5 ]]; then
5148+
warn "Selecting 2 will require usage of checkm8-a5."
5149+
print "* For more details, go to: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/checkm8-a5"
5150+
fi
5151+
input "Select your option:"
5152+
select opt2 in "${selection[@]}"; do
5153+
case $opt2 in
5154+
"Jailbroken" ) break;;
5155+
*"DFU" ) device_enter_mode $opt2; break;;
5156+
esac
5157+
done
5158+
}
5159+
51365160
restore_prepare() {
51375161
case $device_proc in
51385162
1 )
@@ -5849,7 +5873,7 @@ device_ramdisk() {
58495873
elif [[ $device_proc == 1 ]]; then
58505874
device_enter_mode DFU
58515875
else
5852-
device_enter_mode kDFU
5876+
device_buttons2
58535877
fi
58545878

58555879
if [[ $device_type == "iPad1,1" && $build_id != "9"* ]]; then
@@ -6052,16 +6076,13 @@ device_ramdisk() {
60526076

60536077
"clearnvram" )
60546078
log "Sending command for clearing NVRAM..."
6055-
$ssh -p $ssh_port root@127.0.0.1 "nvram -c; reboot_bak"
6056-
log "Done, your device should reboot now"
6057-
return
6079+
$ssh -p $ssh_port root@127.0.0.1 "nvram -c"
6080+
log "Done. Proceeding to SSH Ramdisk Menu. You may reboot from there."
60586081
;;
60596082

60606083
"setnvram" )
60616084
device_ramdisk_setnvram
6062-
log "Rebooting device"
6063-
$ssh -p $ssh_port root@127.0.0.1 "reboot_bak"
6064-
return
6085+
log "Done. Proceeding to SSH Ramdisk Menu. You may reboot from there."
60656086
;;
60666087

60676088
* ) log "Device should now boot to SSH ramdisk mode.";;
@@ -6139,15 +6160,15 @@ device_ramdisk_ios3exploit() {
61396160
fi
61406161
}
61416162

6142-
device_ramdisk_datetime() {
6163+
device_datetime_cmd() {
61436164
log "Running command to Update DateTime"
61446165
$ssh -p $ssh_port root@127.0.0.1 "date -s @$(date +%s)"
61456166
}
61466167

61476168
device_ramdisk_iosvers() {
61486169
device_vers=
61496170
device_build=
6150-
device_ramdisk_datetime
6171+
device_datetime_cmd
61516172
if (( device_proc < 7 )); then
61526173
log "Mounting root filesystem"
61536174
$ssh -p $ssh_port root@127.0.0.1 "mount.sh root"
@@ -6382,7 +6403,7 @@ menu_ramdisk() {
63826403
log "Done. Reboot to apply changes, or clear NVRAM now to cancel erase"
63836404
;;
63846405
"remove4" ) device_ramdisk_setnvram;;
6385-
"datetime" ) device_ramdisk_datetime;;
6406+
"datetime" ) device_datetime_cmd;;
63866407
esac
63876408
done
63886409
}
@@ -8413,6 +8434,7 @@ menu_other() {
84138434
if [[ $device_mode != "DFU" ]]; then
84148435
menu_items+=("DFU Mode Helper")
84158436
fi
8437+
menu_items+=("Update DateTime")
84168438
fi
84178439
if (( device_proc < 7 )); then
84188440
menu_items+=("Create Custom IPSW")
@@ -8422,6 +8444,7 @@ menu_other() {
84228444
fi
84238445
menu_items+=("(Re-)Install Dependencies" "Go Back")
84248446
menu_print_info
8447+
# other utilities menu
84258448
print " > Main Menu > Other Utilities"
84268449
input "Select an option:"
84278450
select opt in "${menu_items[@]}"; do
@@ -8446,11 +8469,25 @@ menu_other() {
84468469
"Get iOS Version" ) mode="getversion";;
84478470
"Enable Flags" ) menu_flags;;
84488471
"Just Boot" ) menu_justboot;;
8472+
"Update DateTime" ) mode="device_update_datetime";;
84498473
"Go Back" ) back=1;;
84508474
esac
84518475
done
84528476
}
84538477

8478+
device_update_datetime() {
8479+
device_buttons2
8480+
if [[ $device_mode == "Normal" ]]; then
8481+
log "Proceeding on Nzormal mode."
8482+
device_ssh_message
8483+
device_iproxy
8484+
device_sshpass
8485+
device_datetime_cmd
8486+
else
8487+
device_ramdisk getversion
8488+
fi
8489+
}
8490+
84548491
device_pair() {
84558492
log "Attempting idevicepair"
84568493
"$dir/idevicepair" pair
@@ -8691,6 +8728,8 @@ device_dump() {
86918728
fi
86928729
if [[ $device_mode == "Recovery" ]]; then
86938730
device_enter_mode pwnDFU
8731+
elif [[ $device_mode == "Normal" ]]; then
8732+
device_buttons2
86948733
fi
86958734
if [[ $device_mode == "Normal" ]]; then
86968735
device_ssh_message
@@ -8707,7 +8746,8 @@ device_dump() {
87078746
device_dumpbb
87088747
fi
87098748
cp $arg-$device_ecid.tar $dump
8710-
elif [[ $device_mode == "DFU" ]]; then
8749+
fi
8750+
if [[ $device_mode == "DFU" ]]; then
87118751
log "This operation requires an SSH ramdisk, proceeding"
87128752
print "* I recommend dumping baseband/activation on Normal mode instead of Recovery/DFU mode if possible"
87138753
device_enter_ramdisk $arg

0 commit comments

Comments
 (0)