You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
So with Frida 17, runtime bridges, such as the Java runtime bridge, must be added manually to a custom agent script.
This works for me when concatenating the bridge code with whatever other Frida script I want to load, and then calling script.load from python.
The problem is that it's harder to debug bugs in a Frida script, when the error message points to line ~13'000, because the buggy Frida script was appended to the bridge script. Is there a way to load the bridge script separately?
The following script shows the problem:
importfridaimportosimporttimeprocess="SOME APP"device=frida.get_usb_device()
pid=device.get_process(process).pidsession=device.attach(pid)
withopen('/home/user/frida_java_bridge.js', 'r') asbridgefile:
bridge_source=bridgefile.read()
script1_source="""console.log('hello form script1')"""script2_source="""console.log('hello form script2a');Java.perform(function() {console.log('inside Java runtime')});console.log('hello form script2b');"""bridge=session.create_script(bridge_source)
script1=session.create_script(script1_source)
script2=session.create_script(script2_source)
print("one by one:")
bridge.load()
script1.load()
script2.load()
print("concatenated:")
script3=session.create_script(bridge_source+script2_source)
script3.load()
output:
one by one:
hello form script1
hello form script2a
concatenated:
hello form script2a
inside Java runtime
hello form script2b
Activity
jie64 commentedon Aug 26, 2025
Where does this frida_java_bridge come from? I would like a copy too.
rloretan commentedon Sep 1, 2025
@jie64 You can generate it from https://github.com/frida/frida-java-bridge. Or you could take it from some other project, for example https://github.com/Ch0pin/medusa/blob/master/libraries/js/frida_java_bridge.js.