Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions get-android-wifi-passwords-2
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

command -v adb > /dev/null || { printf "%s\\n" "This script requires adb to be installed. Find it on the Internet and install it, then try again." >&2; exit 1; }
command -v zlib-flate > /dev/null || { printf "%s\\n" "This script requires zlib-flate (from package qpdf) to be installed. Install qpdf (e.g, using apt install or brew) and then try again." >&2; exit 1; }
command -v awk > /dev/null || { printf "%s\\n" "This script requires awk to be installed. Try installing awk, then try again." >&2; exit 1; }

set -e
Expand All @@ -20,5 +19,5 @@ if [ ! -s settings.db ]; then
exit 2
fi

dd if=settings.db bs=1 skip=24 2>/dev/null | zlib-flate -uncompress | tar -x
( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 settings.db ) | tar xfvz - || true 2> /dev/null
awk '{gsub(/&quot;/,"\"")}/<string name="SSID">"/{sub(/^<string name="SSID">"/,"");sub(/"<\/string>$/,"");SSID=$0}/<null name="PreSharedKey" \/>/{printf("SSID: %s\nNo Password\n\n",SSID)}/<string name="PreSharedKey"/{sub(/^<string name="PreSharedKey">"/,"");sub(/"<\/string>$/,"");printf("SSID: %s\nPassword: %s\n\n",SSID,$0)}' apps/com.android.providers.settings/k/com.android.providers.settings.data