cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [8/8] android commit: Remove whitelist config.xml parsing
Date Wed, 11 Feb 2015 19:02:28 GMT
Remove whitelist config.xml parsing


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/0c3254fd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/0c3254fd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/0c3254fd

Branch: refs/heads/unplug-whitelist-4.0.0
Commit: 0c3254fd48531ad01e9e820cac3154879d870c5e
Parents: 0faf2f0
Author: Ian Clelland <iclelland@chromium.org>
Authored: Wed Oct 22 16:27:28 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Wed Feb 11 14:01:11 2015 -0500

----------------------------------------------------------------------
 .../src/org/apache/cordova/ConfigXmlParser.java | 35 --------------------
 1 file changed, 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/0c3254fd/framework/src/org/apache/cordova/ConfigXmlParser.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/ConfigXmlParser.java b/framework/src/org/apache/cordova/ConfigXmlParser.java
index 5dd9ff8..1ea30b0 100644
--- a/framework/src/org/apache/cordova/ConfigXmlParser.java
+++ b/framework/src/org/apache/cordova/ConfigXmlParser.java
@@ -36,18 +36,8 @@ public class ConfigXmlParser {
 
     private String launchUrl = "file:///android_asset/www/index.html";
     private CordovaPreferences prefs = new CordovaPreferences();
-    private Whitelist internalWhitelist = new Whitelist();
-    private Whitelist externalWhitelist = new Whitelist();
     private ArrayList<PluginEntry> pluginEntries = new ArrayList<PluginEntry>(20);
 
-    public Whitelist getInternalWhitelist() {
-        return internalWhitelist;
-    }
-
-    public Whitelist getExternalWhitelist() {
-        return externalWhitelist;
-    }
-
     public CordovaPreferences getPreferences() {
         return prefs;
     }
@@ -81,11 +71,6 @@ public class ConfigXmlParser {
     public void parse(XmlResourceParser xml) {
         int eventType = -1;
 
-        // Add implicitly allowed URLs
-        internalWhitelist.addWhiteListEntry("file:///*", false);
-        internalWhitelist.addWhiteListEntry("content:///*", false);
-        internalWhitelist.addWhiteListEntry("data:*", false);
-
         while (eventType != XmlResourceParser.END_DOCUMENT) {
             if (eventType == XmlResourceParser.START_TAG) {
                 handleStartTag(xml);
@@ -121,26 +106,6 @@ public class ConfigXmlParser {
             else if (paramType.equals("onload"))
                 onload = "true".equals(xml.getAttributeValue(null, "value"));
         }
-        else if (strNode.equals("access")) {
-            String origin = xml.getAttributeValue(null, "origin");
-            String subdomains = xml.getAttributeValue(null, "subdomains");
-            boolean external = (xml.getAttributeValue(null, "launch-external") != null);
-            if (origin != null) {
-                if (external) {
-                    externalWhitelist.addWhiteListEntry(origin, (subdomains != null) &&
(subdomains.compareToIgnoreCase("true") == 0));
-                } else {
-                    if ("*".equals(origin)) {
-                        // Special-case * origin to mean http and https when used for internal
-                        // whitelist. This prevents external urls like sms: and geo: from
being
-                        // handled internally.
-                        internalWhitelist.addWhiteListEntry("http://*/*", false);
-                        internalWhitelist.addWhiteListEntry("https://*/*", false);
-                    } else {
-                        internalWhitelist.addWhiteListEntry(origin, (subdomains != null)
&& (subdomains.compareToIgnoreCase("true") == 0));
-                    }
-                }
-            }
-        }
         else if (strNode.equals("preference")) {
             String name = xml.getAttributeValue(null, "name").toLowerCase(Locale.ENGLISH);
             String value = xml.getAttributeValue(null, "value");


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


Mime
View raw message