0

I have an .apk file for an old version of an app but don't have the ability to rebuild the app from source using cordova. I'm trying to debug an error and would like to enable remote debugging. Is it possible to enable remote debugging of the webview without rebuilding the app?

I've tried unpacking the app using apktool, adding android:debuggable="true" to the AndroidManifest.xml and then repacking and resigning the .apk.

When I run the app I can see the device in the device list of chrome://inspect#devices but the webview is not appearing. Am I missing something?

View of chrome inspect devices. The device is recognised but the webview is note://

Jack O'Neill
  • 452
  • 4
  • 11
  • Note that in code `WebView.setWebContentsDebuggingEnabled(true);` has be set, https://developer.chrome.com/docs/devtools/remote-debugging/webviews/ – Morrison Chang Sep 16 '21 at 21:44
  • Thanks for that @MorrisonChang! That seems to be the problem. If you'd like to to add this as an answer I'll accept it – Jack O'Neill Sep 17 '21 at 12:20

1 Answers1

2

On Android in order to debug a WebView inside of an app, the following must be set in the app's code:

WebView.setWebContentsDebuggingEnabled(true);

From: https://developer.chrome.com/docs/devtools/remote-debugging/webviews/

Given that you are reverse engineering an APK, you may want to look to see if the code exists and needs a special flag or attempt to add in the Smali code yourself.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77