Skip to content

Commit

Permalink
try to fix a6 ipwnder issue again
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeZGD committed Dec 3, 2024
1 parent e6680a3 commit e7131f2
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1706,10 +1706,6 @@ device_enter_mode() {

device_enter_mode DFU

if [[ $device_proc == 4 ]] || [[ $device_proc == 6 && $platform == "macos" && $platform_arch == "x86_64" ]]; then
tool_ipwndfu=1
fi

if (( device_proc > 7 )); then
# A8/A9/A10 uses gaster
log "Placing device to pwnDFU mode using gaster"
Expand All @@ -1723,7 +1719,7 @@ device_enter_mode() {
# also installing alloc8 requires pwning with ipwndfu
device_ipwndfu pwn
tool_pwned=$?
elif [[ $tool_ipwndfu == 1 ]]; then
elif [[ $device_proc == 4 ]] || [[ $device_proc == 6 && $platform == "macos" && $platform_arch == "x86_64" ]]; then
# A6 intel mac/A4/3gs/touch 3 uses ipwndfu/ipwnder
local selection=("ipwnder" "ipwndfu")
if [[ $platform == "linux" ]]; then
Expand All @@ -1744,7 +1740,7 @@ device_enter_mode() {
"ipwndfu" ) device_ipwndfu pwn; tool_pwned=$?; break;;
"ipwnder (SHAtter)" ) $ipwnder -s; tool_pwned=$?; break;;
"ipwnder (limera1n)" ) $ipwnder -p; tool_pwned=$?; break;;
"ipwnder" ) tool_ipwndfu=2; $ipwnder -d; tool_pwned=$?; break;;
"ipwnder" ) $ipwnder -d; tool_pwned=$?; break;;
esac
done
elif [[ $platform == "linux" ]]; then
Expand Down Expand Up @@ -1774,8 +1770,8 @@ device_enter_mode() {
log "Placing device to pwnDFU mode using $opt"
case $opt2 in
"ipwnder32" ) $ipwnder32 -p; tool_pwned=$?; break;;
"ipwndfu" ) tool_ipwndfu=1; device_ipwndfu pwn; tool_pwned=$?; break;;
* ) ${ipwnder}2 -p; tool_pwned=$?; break;;
"ipwndfu" ) device_ipwndfu pwn; tool_pwned=$?; break;;
* ) ${ipwnder}2 -p; tool_pwned=$?; break;;
esac
done
fi
Expand All @@ -1789,16 +1785,14 @@ device_enter_mode() {
if [[ $irec_pwned != 1 && $tool_pwned != 0 ]]; then
device_pwnerror
fi
if [[ $device_proc == 6 && $tool_ipwndfu == 2 ]]; then
if [[ $device_proc == 6 && $tool_pwndfu == "ipwndfu" ]]; then
device_ipwndfu send_ibss
return
fi
if [[ $platform == "macos" ]] || (( device_proc > 7 )); then
return
elif [[ $device_proc == 7 ]]; then
device_ipwndfu rmsigchks
elif [[ $device_proc != 4 ]]; then
device_ipwndfu send_ibss
fi
;;
esac
Expand All @@ -1817,7 +1811,7 @@ device_pwnerror() {
error_msg+=$'\n - https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/Restore-32-bit-Device'
echo
fi
elif [[ $platform == "macos" && -n $tool_ipwndfu ]]; then
elif [[ $platform == "macos" && $tool_pwndfu == "ipwndfu" ]]; then
error_msg+=$'\n* If you get the error "No backend available" in ipwndfu, install libusb in Homebrew/MacPorts'
elif [[ $platform == "macos" && $platform_arch == "x86_64" ]]; then
if [[ $device_proc == 4 || $device_proc == 6 ]]; then
Expand Down Expand Up @@ -1945,6 +1939,7 @@ device_ipwndfu() {
;;

"pwn" )
tool_pwndfu="ipwndfu"
log "Placing device to pwnDFU Mode using ipwndfu"
$p2_sudo "$python2" ipwndfu -p
tool_pwned=$?
Expand Down Expand Up @@ -4889,7 +4884,7 @@ restore_futurerestore() {
fi
echo "$fr_latest" > ${futurerestore2}-${fr_branch}_version
fi
futurerestore2+="-$fr_branch"
futurerestore2+="-${fr_branch}"
fi
# custom arg(s), either --use-pwndfu or --skip-blob, or both
if [[ -n "$1" ]]; then
Expand Down

0 comments on commit e7131f2

Please sign in to comment.