enable remote debugging WIP

This commit is contained in:
iddoeldor 2019-05-23 16:24:33 +03:00 committed by GitHub
parent 4f18af7edd
commit 94e0fd3b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
/*
Enable remote debugging of Android WebViews at Runtime using Frida
run "adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'" to get the current activity
*/
Java.perform(function() {
Java.deoptimizeEverything();
var injected = false;
Java.choose('com.app.SomeActivity', {
'onMatch': function(o) {
var Runnable = Java.use('java.lang.Runnable');
var MyRunnable = Java.registerClass({
name: 'com.example.MyRunnable',
implements: [Runnable],
methods: {
'run': function() {
Java.use('android.webkit.WebView').setWebContentsDebuggingEnabled(true);
}
}
});
var runnable = MyRunnable.$new();
o.runOnUiThread(runnable);
console.log('\nWebview debug enabled......');
},
'onComplete': function() {
console.log('completed');
}
})
});