Cordova - Enable Webview Debugging

by
4 views b2bbbb48...

Description

Enable debugging option of webview for android applications to use the browser developer tools such as debugguer, console, network monitor. This script is useful when you need to set breakpoints and inspect the flow of an application.

How to Use

Download the script and run it with Frida CLI:

Download Script

Then run with Frida:

frida -U -f YOUR_PACKAGE_NAME -l cordova---enable-webview-debugging.js

Replace YOUR_PACKAGE_NAME with the target app's package name.

Source Code

JavaScript
// Usage : frida -U -f bundle_id -l enable_debug.js --no-pause 
// Blog link to be added 
// Written by @67616d654661636 and @sunnyrockzzs

Java.perform(function() {
    var Webview = Java.use("android.webkit.WebView")
    Webview.loadUrl.overload("java.lang.String").implementation = function(url) {
        console.log("\n[+]Loading URL from", url);
        console.log("[+]Setting the value of setWebContentsDebuggingEnabled() to TRUE");
        this.setWebContentsDebuggingEnabled(true);
        this.loadUrl.overload("java.lang.String").call(this, url);
    }
});
Share this script:
Twitter LinkedIn

Comments

Login or Sign up to leave a comment.
Loading comments...