Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save authenticationfailure/97c74d5475707598e6478395bc9bc9d6 to your computer and use it in GitHub Desktop.
Save authenticationfailure/97c74d5475707598e6478395bc9bc9d6 to your computer and use it in GitHub Desktop.
Enable Remote Debugging of Android WebViews at Runtime with Frida
/*
Enable remote debugging of Android WebViews at Runtime using Frida
*/
Java.perform(function() {
Java.choose("android.webkit.WebView", {
"onMatch": function(o) {
try {
// Use a Runnable to invoke the setWebContentsDebuggingEnabled
// method in the same thread as the WebView
var Runnable = Java.use('java.lang.Runnable');
var MyRunnable = Java.registerClass({
name: 'com.example.MyRunnable',
implements: [Runnable],
methods: {
'run': function() {
o.setWebContentsDebuggingEnabled(true);
console.log('WebView Debugging should be enabled');
}
}
});
var runnable = MyRunnable.$new();
o.post(runnable);
} catch (e) {
console.log("Execution failed " + e.message);
}
},
"onComplete": function() {
console.log("Execution completed")
}
})
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment