From ed78b557cd078f6d7cfd402d37ad167e191bd706 Mon Sep 17 00:00:00 2001 From: Ian Clelland Date: Wed, 22 Oct 2014 16:27:28 -0400 Subject: [PATCH] Remove whitelist config.xml parsing --- .../org/apache/cordova/ConfigXmlParser.java | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/framework/src/org/apache/cordova/ConfigXmlParser.java b/framework/src/org/apache/cordova/ConfigXmlParser.java index 5dd9ff88..1ea30b01 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 pluginEntries = new ArrayList(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");