Android文件系统挂钩 [英] Android file system hooks

查看:98
本文介绍了Android文件系统挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告知是否可以在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆