You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2020/11/04 05:15:34 UTC

[cordova-android] branch master updated: fix(android): allow file access for existing behavior (#1111)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new c144c08  fix(android): allow file access for existing behavior (#1111)
c144c08 is described below

commit c144c0811249e22f91253ef919cc767f892a8fdf
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Wed Nov 4 14:15:26 2020 +0900

    fix(android): allow file access for existing behavior (#1111)
---
 framework/src/org/apache/cordova/engine/SystemWebViewEngine.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
index 3201c74..e703f09 100755
--- a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
+++ b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java
@@ -152,6 +152,15 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
         settings.setJavaScriptCanOpenWindowsAutomatically(true);
         settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
 
+        /**
+         * https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)
+         * 
+         * SDK >= 30 has recently set this value to false by default.
+         * It is recommended to turn off this settings To prevent possible security issues targeting Build.VERSION_CODES.Q and earlier.
+         * For existing functionality, this setting is set to true. In a future release, this should be defaulted to false.
+         */
+        settings.setAllowFileAccess(true);
+
         String manufacturer = android.os.Build.MANUFACTURER;
         LOG.d(TAG, "CordovaWebView is running on device made by: " + manufacturer);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org