Last active
September 24, 2023 00:14
-
-
Save 0xallie/75a520cd2b8a24e1a9408079113efacd to your computer and use it in GitHub Desktop.
Helper script to enter DFU mode from recovery on A11+ devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
step() { | |
for i in $(seq "$1" -1 1); do | |
printf '\r\e[1;36m%s (%d) ' "$2" "$i" | |
sleep 1 | |
done | |
printf '\r\e[0m%s (0)\n' "$2" | |
} | |
step 3 'get ready' | |
step 4 'hold volume down + side button' & | |
sleep 3 | |
irecovery -c reset | |
sleep 1 | |
step 10 'release side button but keep holding volume down' | |
if lsusb | grep -q 'DFU Mode'; then | |
echo 'successfully entered DFU' | |
else | |
echo 'failed to enter DFU, try again' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment