-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: gum-js-loop (21): EXC_BAD_ACCESS #426
Comments
(Sorry for the delay here, I'm terrible at context-switching.) Did you try ensuring that the code is run on the main thread? E.g.: ObjC.schedule(ObjC.mainQueue, function () {
webview.stringByEvaluatingJavaScriptFromString_('document.body.innerHTML += "<marquee>Testing JS Injection</marquee>";');
}); UIKit-based APIs typically require methods to be invoked on the main thread. The |
Another gotcha: If you use Objective-C APIs from a thread that doesn't have an var NSAutoreleasePool = ObjC.classes.NSAutoreleasePool;
var pool = NSAutoreleasePool.alloc().init();
try {
/* Call Objective-C methods here. */
} finally {
pool.release();
} Note that |
Would ensure running it on main thread.
Hiya Ole!
It would seem I have encountered a bug in frida-gum which is preventing the creation of a tool for assessing iOS/iPadOS applications. This was encountered when I was trying to inject some JavaScript into a UIWebView and WKWebView via their methods:
Below is the crash report generated when Xcode was attached to the application's process.
And the (snipped) log generated by Frida when the crash happens:
Full crash report is in the text file below:
FridaCrashReport.txt
To trigger this crash, I did the following:
var webview = new ObjC.Object(ptr('[WEBVIEW-ADDRESS]'));
)webview.stringByEvaluatingJavaScriptFromString_('document.body.innerHTML += "<marquee>Testing JS Injection</marquee>";');
Upon submitting step 2, the application crashes and reports what's at the top of this ticket.
The expected outcome was that a marquee would be added to the bottom of the loaded page. When testing the JavaScript via Safari Web Inspector attached to the WebView, all works as expected.
Can provide any extra information to help debug this bug for you.
As always, so many thanks for creating and maintaining Frida!
The text was updated successfully, but these errors were encountered: