0

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 Answer 1

0

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); }
  }
4
  • Where would this config go? Jun 25, 2015 at 19:54
  • @SentraThis96 write it in your application code, try itWebView.setWebContentsDebuggingEnabled(false);
    – skarabel
    Jun 25, 2015 at 22:10
  • What provides the WebView class? I'm using Appgyver to write this Hybrid App Jun 26, 2015 at 0:05
  • You should use & instead of &= in the FLAG_DEBUGGABLE check. &= modifies flags by removing any flags other than FLAG_DEBUGGABLE. Jun 9, 2016 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.