how to access /data/app,/proc on Android for norma

2020-08-01 05:26发布

问题:

Do you know how to access /data/app, /proc in the app? Without root the Andoird phone.

I finkd Dr. Web can do this. http://download.drweb.com/android/?lng=en How does it achieve this?

回答1:

You will have read access to most of it, but not write access.

Runtime.getRuntime().exec("ls -l /proc");

will give you the folder contents, for example. What do you want to achieve?

Only system apps have access to /data/app, so unless you obtain such key from Google, you're out of luck (at least, for non-rooted phones).

To search for installed apps, your best bet is to use class PackageManager :

public abstract List<ApplicationInfo> getInstalledApplications (int flags)

Check the API HERE

PS: before the question comes, I don't have any clue on how to get (if ever possible) a system app key (at least, I don't know how to sign an apk that can be acceptable for the market with such key).