From 85bdf38fe78b098b5175bef5d723eb3ab9d41891 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 27 Aug 2018 10:00:56 +0000 Subject: [PATCH] Added network security config to allow cleartext in webview --- app/src/main/AndroidManifest.xml | 1 + app/src/main/java/eu/faircode/email/FragmentWebView.java | 2 +- app/src/main/res/xml/network_security_config.xml | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/xml/network_security_config.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 028edcc5..c7ebaaf6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ android:appCategory="productivity" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppThemeLight"> diff --git a/app/src/main/java/eu/faircode/email/FragmentWebView.java b/app/src/main/java/eu/faircode/email/FragmentWebView.java index 6b773a86..73dd836c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentWebView.java +++ b/app/src/main/java/eu/faircode/email/FragmentWebView.java @@ -52,7 +52,7 @@ public class FragmentWebView extends FragmentEx { settings.setJavaScriptEnabled(true); settings.setLoadWithOverviewMode(true); settings.setUseWideViewPort(true); - //settings.setBuiltInZoomControls(true); + settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 00000000..75f1d4c9 --- /dev/null +++ b/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file