debug-webview
4 views
4c69212c...
Description
enable android webview debugging
How to Use
Download the script and run it with Frida CLI:
Download ScriptThen run with Frida:
frida -U -f YOUR_PACKAGE_NAME -l debug-webview.js
Replace YOUR_PACKAGE_NAME with the target app's package name.
Source Code
JavaScript
Java.perform(() => {
const WebView = Java.use('android.webkit.WebView')
const Log = Java.use('android.util.Log')
const Exception = Java.use('java.lang.Exception')
WebView.setWebContentsDebuggingEnabled.implementation = function(
...args
) {
const exception = Exception.$new(
`WebView.setWebContentsDebuggingEnabled(${args})`
)
Log.e('natsuki', `setWebContentsDebuggingEnabled:${args}`, exception)
console.log(
`WebView.setWebContentsDebuggingEnabled: `,
...args,
Log.getStackTraceString(exception)
)
return this.setWebContentsDebuggingEnabled(true)
}
Java.scheduleOnMainThread(() => {
Log.e('natsuki', 'initialized to true')
WebView.setWebContentsDebuggingEnabled(true)
})
})
Comments