Frida 安卓报错 invalid address 解决方案
表现
运行 frida 服务器报错:
device:/data/local/tmp # ./frida-server-16.2.1-android-arm64
{"type":"error","description":"Error: invalid address","stack":"Error: invalid address\n at Object.value [as patchCode] (frida/runtime/core.js:207:1)\n at ln (frida/node_modules/frida-java-bridge/lib/android.js:1209:1)\n at pn.activate (frida/node_modules/frida-java-bridge/lib/android.js:1275:1)\n at mn.replace (frida/node_modules/frida-java-bridge/lib/android.js:1323:1)\n at Function.set [as implementation] (frida/node_modules/frida-java-bridge/lib/class-factory.js:1185:1)\n at Function.set [as implementation] (frida/node_modules/frida-java-bridge/lib/class-factory.js:1099:1)\n at installLaunchTimeoutRemovalInstrumentation (/internal-agent.js:424:24)\n at init (/internal-agent.js:51:3)\n at c.perform (frida/node_modules/frida-java-bridge/lib/vm.js:12:1)\n at _performPendingVmOps (frida/node_modules/frida-java-bridge/index.js:250:1)","fileName":"frida/runtime/core.js","lineNumber":207,"columnNumber":1}
查看当前 SELinux 配置:
device:/data/local/tmp # getenforce
Enforcing
解决方案
将 SELinux 设置为 permissive
即可。
device:/data/local/tmp # setenforce 0
device:/data/local/tmp # getenforce
Permissive
再启动 frida 服务器就可以了。