Some fixes to device_entry

This commit is contained in:
LukeZGD 2024-04-30 11:45:14 +08:00
parent 8a3646b5a4
commit 34c832473f

View File

@ -506,9 +506,11 @@ device_entry() {
until [[ -n $device_type ]]; do until [[ -n $device_type ]]; do
read -p "$(input 'Enter device type (eg. iPad2,1): ')" device_type read -p "$(input 'Enter device type (eg. iPad2,1): ')" device_type
done done
until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do if [[ $device_proc != 1 ]]; then
read -p "$(input 'Enter device ECID (must be decimal): ')" device_ecid until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do
done read -p "$(input 'Enter device ECID (must be decimal): ')" device_ecid
done
fi
} }
device_manufacturing() { device_manufacturing() {
@ -623,15 +625,15 @@ device_get_info() {
fi fi
case $device_mode in case $device_mode in
"DFU" | "Recovery" ) "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 if [[ -n $device_argmode ]]; then
device_entry device_entry
else 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_type=$(echo "$device_type" | cut -c -$ProdCut)
device_ecid=$(printf "%d" $($irecovery -q | grep "ECID" | cut -c 7-)) # converts hex ecid to dec device_ecid=$(printf "%d" $($irecovery -q | grep "ECID" | cut -c 7-)) # converts hex ecid to dec
fi fi