From dae4292ca4196ee9f3df6620699b5bde981df819 Mon Sep 17 00:00:00 2001 From: LukeeGD <26163116+LukeZGD@users.noreply.github.com> Date: Sun, 5 Jan 2025 14:09:30 +0800 Subject: [PATCH] Change way of finding device in SSH ramdisk mode --- restore.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/restore.sh b/restore.sh index 56d99c3..5345643 100755 --- a/restore.sh +++ b/restore.sh @@ -5796,11 +5796,7 @@ device_ramdisk64() { fi $irecovery -f $ramdisk_path/Kernelcache.img4 $irecovery -c bootx - if [[ $platform == "macos" ]]; then - print "* For some reason, macOS takes way too long to discover iOS devices on some Macs. You may need to wait for a while before it connects." - print "* If it still does not work/recognize your device, try restarting your Mac before trying again." - fi - device_find_mode Restore 30 + sleep 10 if [[ $ios8 == 1 ]]; then device_iproxy no-logging 44 @@ -5811,6 +5807,13 @@ device_ramdisk64() { fi device_sshpass alpine + local found + log "Waiting for device..." + while [[ $found != 1 ]]; do + found=$($ssh -p $ssh_port root@127.0.0.1 "echo 1") + sleep 1 + done + print "* Mount filesystems with this command (for iOS 11.3 and newer):" print " /usr/bin/mount_filesystems" print "* Mount filesystems with this command (for iOS 10.3.x):" @@ -6043,27 +6046,24 @@ device_ramdisk() { if [[ $1 == "justboot" ]]; then log "Device should now boot." return - elif [[ -n $1 && $platform == "macos" ]]; then - log "Booting, please wait..." - print "* For some reason, macOS takes way too long to discover iOS devices on some Macs. You may need to wait for a while." - print "* If it still does not work/recognize your device, try restarting your Mac before trying again." - device_find_mode Restore 90 - device_iproxy - elif [[ -n $1 ]]; then - log "Booting, please wait..." - device_find_mode Restore 30 + fi + log "Booting, please wait..." + sleep 10 + + if [[ -n $1 ]]; then device_iproxy else - log "Booting, please wait..." - if [[ $platform == "macos" ]]; then - print "* For some reason, macOS takes way too long to discover iOS devices on some Macs. You may need to wait for a while before it connects." - print "* If it still does not work/recognize your device, try restarting your Mac before trying again." - fi - device_find_mode Restore 30 device_iproxy no-logging fi device_sshpass alpine + local found + log "Waiting for device..." + while [[ $found != 1 ]]; do + found=$($ssh -p $ssh_port root@127.0.0.1 "echo 1") + sleep 1 + done + case $mode in "activation" | "baseband" ) return @@ -6081,7 +6081,7 @@ device_ramdisk() { "getversion" ) device_ramdisk_iosvers - log "Retrieved the current iOS version, rebooting device" + log "Retrieved the current iOS version" if [[ -n $device_vers ]]; then print "* iOS Version: $device_vers ($device_build)" else