Skip to content

Instantly share code, notes, and snippets.

@tolpp
Created December 13, 2019 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolpp/693da480ff2ba8f55cac53b79a5a4236 to your computer and use it in GitHub Desktop.
Save tolpp/693da480ff2ba8f55cac53b79a5a4236 to your computer and use it in GitHub Desktop.
Script that lists Android applications with BIND_ACCESSIBILITY_SERVICE or SYSTEM_ALERT_WINDOW permissions.
#!/bin/bash
packageList=$(adb shell pm list packages | sed s/package://g)
while IFS='' read -r line <&4
do
adb shell "echo $line"
adb shell dumpsys package "$line" | egrep ".*(BIND_ACCESSIBILITY_SERVICE|SYSTEM_ALERT_WINDOW).*"
done 4<<< "$packageList"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment