How can I monitor another application's database for changes?

前端 未结 4 2071
北荒
北荒 2021-02-19 10:35

I\'d like to monitor changes to another applications SQLite database. Since the Android doesn\'t allow me to access another application\'s internal data, I need a root applicati

4条回答
  •  迷失自我
    2021-02-19 11:42

    inotify is the way to go here but you'll need something like the command-line inotifywait utility from inotify-tools, so that you can elevate it with su.

    You can either write your own (it's super easy) or use an existing port.

    Then, you run it elevated, in a separate thread, and either wait for it to tell you there's a change or to close down (depending on whether you run inotifywatch or inotifywait).

    P.S. This will likely fail miserably on 4.3 onwards with the SELinux contexts and whatnot.

提交回复
热议问题