-
-
Save veez21/4f2541d271809864411e3ffbbe8e3df9 to your computer and use it in GitHub Desktop.
View wifi passwords through Termux for Android Oreo+ (Root)
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
#!/system/bin/sh | |
[ "$(whoami)" != "root" ] && { echo "root required"; exit 1; } | |
configs=( /data/misc/wifi/WifiConfigStore.xml /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml ) | |
for z in ${configs[@]}; do | |
if [ -f $z ]; then | |
config=$z | |
break | |
fi | |
done | |
SSID=($(grep 'name="SSID"' $config | sed "s/.*>"//;s/".*//;s/ /-_-/g")) | |
PSK=($(grep 'name="PreSharedKey"' $config | sed "s/<null.*/\e[01;30mNONE\e[00;37;40m/;s/.*>"/\e[01;32m/;s/".*/\e[00;37;40m/;s/ /-_-/g")) | |
echo "WiFi Password Viewer" | |
echo "veez21 @ xda-developers\n" | |
for i in ${!SSID[@]}; do | |
echo "\e[01;37m${SSID[$i]}\e[00;37;40m - ${PSK[$i]}" | sed "s/-_-/ /g" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment