frida-python
frida-python copied to clipboard
frida.core.RPCException: ReferenceError: 'Java' is not defined
import frida
device = frida.get_usb_device(timeout=5)
session = device.attach('...')
session.create_script("""
function foo() {
Java.perform(() => {});
}
rpc.exports = { foo };
""")
script.load()
api = script.exports_sync
api.foo()
Frida server and frida for python are both on 17.0.5.
For some reason, "Java" is undefined in my script. This doesn't happen on older versions.
https://frida.re/news/2025/05/17/frida-17-0-0-released/
You need to compile your script to include the bridges you want, in your case "frida-java-bridge". The reason why you are not experiencing the same in Frida REPL is because REPL includes all three of them.