简体   繁体   中英

How to detect the presence of another app?

This is a theoretical situation:

  • I am writing an app to detect the presence of another on the phone
  • The classpath, name, Activity names etc. of the target app have been randomized, I can't just check if it's there (it is semantically the same but syntactically unique)
  • I have root access to the phone
  • The app is open source, and (apart from the package name and application name) I know everything about it.
  • The app generates no Log output.

I've been thinking of ways to detect whether this other app is present on the phone (assuming it is actually run from time to time), are the following methods feasible at all?

  • Look periodically for the presence of certain classes in memory
  • Search for known chunks of the compiled code in each installed apk
  • Detect the app running by inspecting the memory of the device at certain intervals and look for usage patterns matching the app

Are there any other ways of detecting another app under these circumstances?

Use PackageManager . It has a method returning info about all the apps, installed on the system: getInstalledPackages() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM