Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
- echo "\n"
- SSID=($(grep 'name="SSID"' $config | sed "s/.*>"//;s/".*//;s/ /-_-/g"))
- if [ -z $MMRL ]; then
- 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"))
- else
- PSK=($(grep 'name="PreSharedKey"' $config | sed "s/<null.*/NONE/;s/.*>"//;s/".*//;s/ /-_-/g"))
- fi
- for i in ${!SSID[@]}; do
- if [ -z $MMRL ]; then
- echo "\e[01;37m${SSID[$i]}\e[00;37;40m - ${PSK[$i]}" | sed "s/-_-/ /g"
- else
- echo " ${SSID[$i]} : ${PSK[$i]}" | sed "s/-_-/ /g"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement