简体   繁体   English

将 WebView 用于 android 应用程序是否安全?

[英]is it safe to use WebView for android app?

I try to use HTML, CSS and JS instead of Java and XML, so I have to use WebView on Android Studio.我尝试使用 HTML、CSS 和 JS 而不是 Java 和 XML,所以我必须在 Android Studio 上使用 WebView。

I just afraid that with simple Reverse Engineering anybody could access my web files and APIs...我只是担心通过简单的逆向工程,任何人都可以访问我的网络文件和 API...

Is it possible to do that?有可能这样做吗? Is there any way to stop that?有什么办法可以阻止吗?

Although safety of your application is at stake when using WebView, but there are ways to solve those problems as well such as:尽管使用 WebView 时应用程序的安全性处于危险之中,但也有一些方法可以解决这些问题,例如:

You can keep all the URL's and Hardcoded text in String.xml file and call the URL's from there您可以将所有 URL 和硬编码文本保存在String.xml文件中,并从那里调用 URL

Also the other way is to obfuscate the code using PROGUARD .另一种方法是使用PROGUARD混淆代码。 This is primarily used to prevent reverse engineering.这主要用于防止逆向工程。

Refer https://developer.android.com/studio/build/shrink-code for better understanding.请参阅https://developer.android.com/studio/build/shrink-code以获得更好的理解。

Also, To obfuscate code in Android studio just go to your build.gradle file 
in your Android Studio project:

Change the minifyEnabled property from false to true

That's the basic obfuscation.这是基本的混淆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM