Skip to content

Instantly share code, notes, and snippets.

@ivaniskandar
Last active December 13, 2017 13:44
Show Gist options
  • Save ivaniskandar/57ff1467ea2b30126dd30d6071850d5b to your computer and use it in GitHub Desktop.
Save ivaniskandar/57ff1467ea2b30126dd30d6071850d5b to your computer and use it in GitHub Desktop.
usual java reflection to see overlay apk and see the overlayed apk
for (PackageInfo pi : context.getPackageManager().getInstalledPackages(0)) {
try {
Class piClass = pi.getClass();
Field overlaytargetField = piClass.getDeclaredField("overlayTarget");
overlaytargetField.setAccessible(true);
String target = overlaytargetField.get(pi).toString();
if (target != null) {
Log.d("lmao", pi.packageName + " is overlaying: " + target);
}
} catch (Exception e1) {
Log.e("lmao", "error", e1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment