More fixes

This commit is contained in:
LukeeGD 2024-12-17 07:26:23 +08:00
parent ee263637e0
commit eeae47b1a7

View File

@ -963,19 +963,21 @@ device_get_info() {
[[ -z $device_type ]] && device_type=$($ideviceinfo -k ProductType) [[ -z $device_type ]] && device_type=$($ideviceinfo -k ProductType)
device_ecid=$($ideviceinfo -s -k UniqueChipID) device_ecid=$($ideviceinfo -s -k UniqueChipID)
fi fi
device_model=$($ideviceinfo -s -k HardwareModel) if [[ $main_argmode != "device_enter_ramdisk"* ]]; then
device_vers=$($ideviceinfo -s -k ProductVersion) device_model=$($ideviceinfo -s -k HardwareModel)
device_det=$(echo "$device_vers" | cut -c 1) device_vers=$($ideviceinfo -s -k ProductVersion)
device_det2=$(echo "$device_vers" | cut -c -2) device_det=$(echo "$device_vers" | cut -c 1)
device_build=$($ideviceinfo -s -k BuildVersion) device_det2=$(echo "$device_vers" | cut -c -2)
device_udid=$($ideviceinfo -s -k UniqueDeviceID) device_build=$($ideviceinfo -s -k BuildVersion)
[[ -z $device_udid ]] && device_udid=$($ideviceinfo -k UniqueDeviceID) device_udid=$($ideviceinfo -s -k UniqueDeviceID)
if [[ $device_type == "iPod2,1" ]]; then [[ -z $device_udid ]] && device_udid=$($ideviceinfo -k UniqueDeviceID)
device_newbr="$($ideviceinfo -k ModelNumber | grep -c 'C')" if [[ $device_type == "iPod2,1" ]]; then
elif [[ $device_type == "iPhone2,1" ]]; then device_newbr="$($ideviceinfo -k ModelNumber | grep -c 'C')"
device_serial="$($ideviceinfo -k SerialNumber | cut -c 3- | cut -c -3)" elif [[ $device_type == "iPhone2,1" ]]; then
device_serial="$($ideviceinfo -k SerialNumber | cut -c 3- | cut -c -3)"
fi
device_unactivated=$($ideviceactivation state | grep -c "Unactivated")
fi fi
device_unactivated=$($ideviceactivation state | grep -c "Unactivated")
;; ;;
esac esac
@ -1268,7 +1270,7 @@ device_find_mode() {
while (( i < timeout )); do while (( i < timeout )); do
if [[ $mode == "Restore" ]]; then if [[ $mode == "Restore" ]]; then
if [[ $platform == "macos" ]]; then if [[ $platform == "macos" ]]; then
opt="$(system_profiler SPUSBDataType 2> /dev/null | grep -B1 'Vendor ID: 0x05ac' | grep 'Product ID:' | cut -dx -f2 | cut -d' ' -f1 | tail -r)" opt="$(system_profiler SPUSBDataType 2> /dev/null | grep -B1 'Vendor ID: 0x05ac' | grep 'Product ID:' | cut -dx -f2 | cut -d' ' -f1 | tail -r | head -n 1)"
elif [[ $platform == "linux" ]]; then elif [[ $platform == "linux" ]]; then
opt="$(lsusb | cut -d' ' -f6 | grep '05ac:' | cut -d: -f2)" opt="$(lsusb | cut -d' ' -f6 | grep '05ac:' | cut -d: -f2)"
fi fi
@ -2289,11 +2291,19 @@ ipsw_preference_set() {
esac esac
fi fi
case $device_type in
iPad[23],[23] | "$device_disable_bbupdate" ) ipsw_nskip=1;;
esac
if [[ $device_target_vers == "4.2"* || $device_target_vers == "4.3"* || $ipsw_gasgauge_patch == 1 ]] ||
[[ $platform == "macos" && $platform_arch == "arm64" ]]; then
ipsw_nskip=1
fi
if [[ $device_target_powder == 1 ]]; then if [[ $device_target_powder == 1 ]]; then
case $device_target_vers in case $device_target_vers in
[98]* ) ipsw_canjailbreak=1;; [98]* ) ipsw_canjailbreak=1;;
esac esac
elif [[ $device_target_other == 1 && $ipsw_canjailbreak != 1 ]]; then elif [[ $device_target_other == 1 && $ipsw_canjailbreak != 1 && $ipsw_nskip != 1 ]]; then
return return
fi fi
@ -2364,14 +2374,6 @@ ipsw_preference_set() {
echo echo
fi fi
case $device_type in
iPad[23],[23] | "$device_disable_bbupdate" ) ipsw_nskip=1;;
esac
if [[ $device_target_vers == "4.2"* || $device_target_vers == "4.3"* || $ipsw_gasgauge_patch == 1 ]] ||
[[ $platform == "macos" && $platform_arch == "arm64" ]]; then
ipsw_nskip=1
fi
case $device_type in case $device_type in
iPhone2,1 | iPod2,1 ) ipsw_canmemory=1;; iPhone2,1 | iPod2,1 ) ipsw_canmemory=1;;
iPad[23],[23] ) ipsw_canmemory=1;; iPad[23],[23] ) ipsw_canmemory=1;;
@ -6638,7 +6640,7 @@ menu_datamanage() {
menu_items+=("Backup" "Restore") menu_items+=("Backup" "Restore")
fi fi
if [[ -z $ifuse ]]; then if [[ -z $ifuse ]]; then
warn "ifuse not installed. Mount Device options are not available. Install ifuse in Homebrew/MacPorts or your package manager to fix this" warn "ifuse not installed. Mount Device options are not available. Install ifuse from your package manager to fix this"
else else
menu_items+=("Mount Device" "Mount Device (Raw File System)" "Unmount Device") menu_items+=("Mount Device" "Mount Device (Raw File System)" "Unmount Device")
fi fi