Q:

Webview app code security

I have an app which runs mostly in webview and opens an html file from my server and most of the logic happens in its javascript files. If you open the html file on your browser you will have all the code with a simple inspect element. I wanted to ask how can I secure my application and prevent my code from being seen and copied.
Thanks

A:

By default WebView doesn't allow debugging of its contents (unlike Chrome), unless it runs on a debug build of Android. Thus if you don't reveal the URL anywhere, users will simply not know what to open in a browser.
You can also minify/obfuscate your JavaScript code to make it barely readable, even if anyone somehow opens it. This also has a benefit of reducing download size.
A radical approach would be to generate all the results on the server and send them to clients. This way, your clients will not have any code at all on them. But this will greatly complicate any attempts to make the results interactive.

