Fix bb stitch condition, add warnings/messages for residual tmp folder(s) that may cause problems especially for Linux on device detection, since usbmuxd won't run if LiK detects other instances thru checking of existing tmp folders

This commit is contained in:
LukeZGD 2024-08-26 00:10:15 +08:00
parent 87a9242331
commit d676325dc9

View File

@ -242,7 +242,11 @@ set_tool_paths() {
fi fi
#sudo killall usbmuxd 2>/dev/null #sudo killall usbmuxd 2>/dev/null
#sleep 1 #sleep 1
log "Running usbmuxd"
sudo -b $dir/usbmuxd -pf &>../saved/usbmuxd.log sudo -b $dir/usbmuxd -pf &>../saved/usbmuxd.log
elif [[ $othertmp != 0 ]]; then
log "Detected existing tmp folder(s), there might be other Legacy iOS Kit instance(s) running"
log "Not running usbmuxd"
fi fi
fi fi
@ -774,6 +778,9 @@ device_get_info() {
log "Finding device in Normal mode..." log "Finding device in Normal mode..."
if [[ $platform == "linux" ]]; then if [[ $platform == "linux" ]]; then
print "* If it gets stuck here, try to restart your PC" print "* If it gets stuck here, try to restart your PC"
if [[ $othertmp != 0 ]]; then
print "* If it fails to detect devices, try to delete all \"tmp\" folders in your Legacy iOS Kit folder"
fi
fi fi
fi fi
@ -2525,7 +2532,7 @@ ipsw_prepare_jailbreak() {
ExtraArgs+=" -ramdiskgrow 10" ExtraArgs+=" -ramdiskgrow 10"
if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then
ExtraArgs+=" -bbupdate" ExtraArgs+=" -bbupdate"
elif [[ $device_type == "$device_disable_bbupdate" && $device_type == "iPhone"* && $device_deadbb != 1 ]]; then elif [[ $device_type == "$device_disable_bbupdate" && $device_deadbb != 1 ]]; then
device_dump baseband device_dump baseband
ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar" ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar"
fi fi
@ -3177,7 +3184,7 @@ ipsw_prepare_32bit() {
ExtraArgs+=" -ramdiskgrow 10" ExtraArgs+=" -ramdiskgrow 10"
if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then
ExtraArgs+=" -bbupdate" ExtraArgs+=" -bbupdate"
elif [[ $device_type == "$device_disable_bbupdate" && $device_type == "iPhone"* && $device_deadbb != 1 ]]; then elif [[ $device_type == "$device_disable_bbupdate" && $device_deadbb != 1 ]]; then
device_dump baseband device_dump baseband
ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar" ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar"
fi fi
@ -4035,7 +4042,7 @@ ipsw_prepare_powder() {
fi fi
if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then if [[ $device_use_bb != 0 && $device_type != "$device_disable_bbupdate" ]]; then
ExtraArgs+=" -bbupdate" ExtraArgs+=" -bbupdate"
elif [[ $device_type == "$device_disable_bbupdate" && $device_type == "iPhone"* && $device_deadbb != 1 ]]; then elif [[ $device_type == "$device_disable_bbupdate" && $device_deadbb != 1 ]]; then
device_dump baseband device_dump baseband
ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar" ExtraArgs+=" ../saved/$device_type/baseband-$device_ecid.tar"
fi fi
@ -8650,8 +8657,6 @@ trap "exit 1" INT TERM
clean clean
othertmp=$(ls "$(dirname "$0")" | grep -c tmp) othertmp=$(ls "$(dirname "$0")" | grep -c tmp)
mkdir "$(dirname "$0")/tmp$$"
pushd "$(dirname "$0")/tmp$$" >/dev/null
if [[ $no_color != 1 ]]; then if [[ $no_color != 1 ]]; then
TERM=xterm-256color # fix colors for msys2 terminal TERM=xterm-256color # fix colors for msys2 terminal
@ -8662,6 +8667,17 @@ if [[ $no_color != 1 ]]; then
color_N=$(tput sgr0) color_N=$(tput sgr0)
fi fi
if [[ $othertmp != 0 ]]; then
log "Detected existing tmp folder(s)."
print "* There might be other Legacy iOS Kit instance(s) running, or residual tmp folder(s) not deleted."
print "* Running multiple instances is not fully supported and can cause unexpected behavior."
print "* It is recommended to only use a single instance and/or delete all existing \"tmp\" folders in your Legacy iOS Kit folder before continuing."
pause
fi
mkdir "$(dirname "$0")/tmp$$"
pushd "$(dirname "$0")/tmp$$" >/dev/null
main main
popd >/dev/null popd >/dev/null