Created
July 14, 2018 10:24
-
-
Save authenticationfailure/97c74d5475707598e6478395bc9bc9d6 to your computer and use it in GitHub Desktop.
Enable Remote Debugging of Android WebViews at Runtime with Frida
This file contains 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
/* | |
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