Skip to content

Commit

Permalink
fourthree step 2 add waiting for disks, and other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeZGD committed Dec 5, 2024
1 parent e0193af commit 4a346b9
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5812,8 +5812,11 @@ device_ramdisk() {
;;

"TwistedMind2" )
log "Sending dd command for TwistedMind2"
log "Sending TwistedMind2"
$scp -P $ssh_port TwistedMind2 [email protected]:/
log "Waiting for disks..."
$ssh -p $ssh_port [email protected] 'while [[ ! $(ls /dev/rdisk* 2>/dev/null) ]]; do :; done'
log "Sending dd command for TwistedMind2"
$ssh -p $ssh_port [email protected] "dd if=/TwistedMind2 of=/dev/rdisk0 bs=8192; reboot_bak"
return
;;
Expand Down Expand Up @@ -8188,7 +8191,18 @@ menu_devicemanage() {

menu_print_info
while [[ -z "$mode" && -z "$back" ]]; do
menu_items=("Export Device Info" "Export Battery Info" "Pair Device" "Shutdown Device" "Restart Device" "Enter Recovery Mode" "Go Back")
menu_items=("Export Device Info")
if (( device_det < 5 )) && [[ $device_det != 1 ]]; then
warn "Device is on lower than iOS 5. Battery info is not available"
else
menu_items+=("Export Battery Info")
fi
if (( device_det < 4 )) && [[ $device_det != 1 ]]; then
warn "Device is on lower than iOS 4. Shutdown/Restart device options are not available"
else
menu_items+=("Shutdown Device" "Restart Device")
fi
menu_items+=("Pair Device" "Enter Recovery Mode" "Go Back")
print " > Main Menu > Device Management"
input "Select an option:"
select opt in "${menu_items[@]}"; do
Expand Down Expand Up @@ -9208,6 +9222,7 @@ device_fourthree_check() {
check="$($ssh -p $ssh_port [email protected] "ls /dev/disk0s3 2>/dev/null")"
if [[ $check != "/dev/disk0s3" ]]; then
if [[ $opt == 2 ]]; then
log "Step 2 is not complete. Proceeding"
return 1
fi
error "Cannot find /dev/disk0s3. Something went wrong with Step 2" \
Expand All @@ -9218,10 +9233,11 @@ device_fourthree_check() {
fi
log "Checking if Step 3 is complete"
local kcb="/System/Library/Caches/com.apple.kernelcaches/kernelcachb"
local kc="$($ssh -p $ssh_port [email protected] "ls $kcb")"
local llb="$($ssh -p $ssh_port [email protected] "ls /LLB")"
local kc="$($ssh -p $ssh_port [email protected] "ls $kcb 2>/dev/null")"
local llb="$($ssh -p $ssh_port [email protected] "ls /LLB 2>/dev/null")"
if [[ $kc != "$kcb" || $llb != "/LLB" ]]; then
if [[ $opt == 3 ]]; then
log "Step 3 is not complete. Proceeding"
return 2
fi
error "Cannot find Kernelcache/LLB. Something went wrong with Step 3" \
Expand Down Expand Up @@ -9434,8 +9450,9 @@ fi

case $1 in
"--just-boot" )
print "* Just Boot usage: --just-boot --device=<device> --build-id=<id>"
print "* Just Boot usage: --just-boot --device=<type> --build-id=<id>"
print "* Optional: --bootargs=\"<bootargs>\""
print "* Example: --just-boot --device=iPhone5,2 --build-id=12H321"
if [[ -z $device_type ]]; then
error "Just Boot (--just-boot) requires specifying device type (--device=<type>)"
fi
Expand Down

0 comments on commit 4a346b9

Please sign in to comment.