-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebview-debug.js
More file actions
34 lines (33 loc) · 1.35 KB
/
Copy pathwebview-debug.js
File metadata and controls
34 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* alab · android/webview-debug.js
*
* Force-enable WebView remote debugging on production builds.
* After loading, open chrome://inspect on the host to see the WebView.
*
* Usage: frida -U -f com.target.app -l webview-debug.js --no-pause
*
* Pattern from iddoeldor/frida-snippets · WithSecureLabs cheatsheets.
*/
Java.perform(function () {
var C = '[webview-debug]';
try {
var WV = Java.use('android.webkit.WebView');
WV.setWebContentsDebuggingEnabled.implementation = function (e) {
console.log(C, 'WebView.setWebContentsDebuggingEnabled(true) forced');
return this.setWebContentsDebuggingEnabled.call(this, true);
};
// Also flip after construction
WV.$init.overloads.forEach(function (o) {
o.implementation = function () {
var ret = o.apply(this, arguments);
this.getSettings().setJavaScriptEnabled(true);
this.getSettings().setAllowFileAccess(true);
this.getSettings().setAllowFileAccessFromFileURLs(true);
this.getSettings().setAllowUniversalAccessFromFileURLs(true);
WV.setWebContentsDebuggingEnabled(true);
return ret;
};
});
console.log(C, 'open chrome://inspect on the host to see WebViews.');
} catch (e) { console.log(C, e); }
});