要改下代码
device = frida.get_usb_device()
match_s = str(app.match_regex_list).replace('u'', ''')
black_s = str(app.black_regex_list).replace('u'', ''')
device.on("child-added", _on_child_added)
application = device.get_frontmost_application()
#target = 'Gadget' if application.identifier == 're.frida.Gadget' else application.identifier
target = application.name
for process in device.enumerate_processes():
if target in process.name:
_attach(process.name)
网上教程都是老版本,我用的是lineageos ,root的机器 1+9pro
示例 ( ZenTracer ):hook java.io.File类的所有方法我们来完整的演示一遍,比如现在看java.io.File类的所有方法,我们可以这样操作,首先是精准匹配:
- 点击打开 "设置" 应用;
- 选择 Action → Match RegEx
- 输入E:java.io.File,点击add,然后关闭窗口
- 输入M:java.io.File,模糊匹配
- 点击 Action → Start
可以看到 java.io.File 类的所有方法都被 hook 了,并且像 java.io.File.createTempFile 方法的所有重载也被 hook 了。



