Repository navigation
Conversation
Since Frida 17 the Java/ObjC/Swift bridges are no longer injected into every script, so a bare session.create_script() has no Java global. frida-tools defines lazy getters and answers frida:load-bridge on the host; objection did neither, so scripts loaded with -S or import failed with a silent ReferenceError. Prepend the same lazy-bridge prelude to scripts loaded through attach_script(), answer frida:load-bridge from the output handlers, and print script errors instead of dropping them.
Frida before 17 defines Java, ObjC and Swift itself. Defining getters for them unconditionally would shadow the built-in objects on those versions, so skip any global that already exists.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #808.
Since Frida 17,
Java/ObjC/Swiftare no longer injected into every script. The host has to answerfrida:load-bridgeand the script needs the lazy getters frida-tools installs. Scripts loaded through-S/importgot neither, soJavawas undefined and the resultingReferenceErrorwas dropped byscript_on_message().Changes
attach_script()frida:load-bridgefromOutputHandlers, reading the bridge bundle from frida-tools'bridges/directorytype == "error"messages instead of dropping themJava/ObjC/Swiftare unaffectedTesting
On LDPlayer 14 (Android 14, x86_64), Frida 17.24.1, against an arm64 app, a script doing:
printed nothing before the change, and
TYPEOF_JAVA=object avail=true/ the device model after.pytest tests: 238 passed, 13 failed both before and after the change (pre-existing Windows-specific failures intest_repl.py,test_plugin_manager.pyandtest_android.py). Addedtests/utils/test_agent.pycovering the bridge request handling.