frida-python icon indicating copy to clipboard operation
frida-python copied to clipboard

frida.core.RPCException: ReferenceError: 'Java' is not defined

Open trueToastedCode opened this issue 7 months ago • 1 comments

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.

trueToastedCode avatar May 25 '25 22:05 trueToastedCode

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.

NSEcho avatar May 26 '25 10:05 NSEcho