From 34c832473ffcdd671d9704a4f90d09c12baba0a8 Mon Sep 17 00:00:00 2001 From: LukeZGD <26163116+LukeZGD@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:45:14 +0800 Subject: [PATCH] Some fixes to device_entry --- restore.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/restore.sh b/restore.sh index aa1bd9a..df5bcc2 100755 --- a/restore.sh +++ b/restore.sh @@ -506,9 +506,11 @@ device_entry() { until [[ -n $device_type ]]; do read -p "$(input 'Enter device type (eg. iPad2,1): ')" device_type done - until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do - read -p "$(input 'Enter device ECID (must be decimal): ')" device_ecid - done + if [[ $device_proc != 1 ]]; then + until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do + read -p "$(input 'Enter device ECID (must be decimal): ')" device_ecid + done + fi } device_manufacturing() { @@ -623,15 +625,15 @@ device_get_info() { fi case $device_mode in "DFU" | "Recovery" ) - #device_type=$($irecovery -q | grep "PRODUCT" | cut -c 10-) - local ProdCut=7 # cut 7 for ipod/ipad - device_type=$($irecovery -qv 2>&1 | grep "Connected to iP" | cut -c 14-) - if [[ $(echo "$device_type" | cut -c 3) == 'h' ]]; then - ProdCut=9 # cut 9 for iphone - fi if [[ -n $device_argmode ]]; then device_entry else + #device_type=$($irecovery -q | grep "PRODUCT" | cut -c 10-) + local ProdCut=7 # cut 7 for ipod/ipad + device_type=$($irecovery -qv 2>&1 | grep "Connected to iP" | cut -c 14-) + if [[ $(echo "$device_type" | cut -c 3) == 'h' ]]; then + ProdCut=9 # cut 9 for iphone + fi device_type=$(echo "$device_type" | cut -c -$ProdCut) device_ecid=$(printf "%d" $($irecovery -q | grep "ECID" | cut -c 7-)) # converts hex ecid to dec fi