Disable remote debugging in Appgyver

216 views Asked by At

I am using Appgyver to create a hybrid app and need to be able to disable the ability for the app to be debugged in the chrome remote debugging tools.

Any input on how to do this would be greatly appreciated!

1

There are 1 answers

4
skarabel On

Here is a solution, I found here

Debugging WebViews

On Android 4.4 (KitKat) or later, you can use DevTools to debug WebView content in native Android appstrong textlications.

Configure WebViews for debugging

WebView debugging must be enabled from within your application. To enable WebView debugging, call the static method setWebContentsDebuggingEnabled on the WebView class.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      WebView.setWebContentsDebuggingEnabled(true);
  }

This setting applies to all of the application's WebViews.

Tip: WebView debugging is not affected by the state of the debuggable flag in the application's manifest. If you want to enable WebView debugging only when debuggable is true, test the flag at runtime.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE))
    { WebView.setWebContentsDebuggingEnabled(true); }
  }