Android文件系统挂钩 [英] Android file system hooks
问题描述
请告知是否可以在Android设备上拦截/监视文件I/O.例如.在现有的Linux上,我们可能会使用LSM或syscalls陷阱.
我希望将所有新创建文件的文件名记录到-文本文件或SMS到另一部手机.
感谢任何帮助以开始使用.先感谢您.
Please advise if it is possible to intercept/monitor file I/Os on an Android device. E.g. on stock Linux we may use LSM or syscalls trap.
I hope to log the filenames of all newly created files - to a text file or SMS to another phone.
Appreciate any help to get started. Thank you in advance.
干杯, 比尔
推荐答案
您可以使用FileObserver类:
You can use the FileObserver class:
监视文件(使用intify)以在设备上的任何进程(包括该进程)访问或更改文件后触发事件.FileObserver是抽象类;子类必须实现事件处理程序onEvent(int,String )."
"Monitors files (using inotify) to fire an event after files are accessed or changed by by any process on the device (including this one). FileObserver is an abstract class; subclasses must implement the event handler onEvent(int, String)."
http://developer.android.com/reference/android/os/FileObserver.html
这篇关于Android文件系统挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!