Fix Android Webview is Vulnerable to Cross app Scripting GooglePlay Warning

How to Fix Webview is vulnerable to cross app scripting Error Google Play Warning in Android Studio

Have you faced this warning in your google play development console? That’s because your app has a Webview that is not safe for the users.

If Webview isn’t safe, attackers can steal data such as cookies of users, card details, login details etc, so as a developer, it is our responsibility to ensure that data of our users are safe when they are using our apps.


Fixing the Android Webview is vulnerable to cross scripting Error

There are some options to fix this issue, It is easy to fix this error

Option A:

Go to the android Manifest, and if the web activity has the “android:exported=”true“, “Change it to “android:exported=”false

This is the google recommended way to fix the problem, but this is not useful for your app if it needs receive data from external apps. in that case, we will try option B

Option B:

Go to the manifest, and add the following lines in the Webview activity, see the screenshot to get a clear understanding

<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true" />

Screenshot

That’s it. Let me know in the comments if this fixed your issue

,

Post navigation

2 thoughts on “Fix Android Webview is Vulnerable to Cross app Scripting GooglePlay Warning

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.