Android FileObserver for monitoring other apps?

2019-05-22 18:20发布

问题:

I suspect that I already know the answer to this question, but I wanted to ask the experts anyway.

Would it be possible to use the FileObserver class to monitor changes to files belonging to other apps (i.e. things in the /data directory that don't belong to the app implementing the FileObserver)?

It seems that even if I had a rooted device, there isn't a way to have my monitoring application run as root.

The only possible (and unappealing) solution I've come up with, is having a rooted device, and changing the privileges on all the files on the device so that they would be accessible by the monitoring app.

Thanks, Jarabek

回答1:

This would almost certainly have to be done in native code, and would only work on rooted devices.

You should look into inotify.



标签: android root