Compare commits

..

5 Commits
3.7.1 ... 3.7.x

Author SHA1 Message Date
caoyr
c1c0a63e5e CB-9135 fix the vulnerability bug
This closes 181
https://github.com/apache/cordova-android/pull/181
2015-06-10 08:59:31 -07:00
Steve Gill
d654de809a CB-9042 reverted changes to cordova.js, should be same as 3.7.1 2015-05-20 16:31:28 -07:00
Steve Gill
86f9b618ef CB-9042 updated releasenotes for 3.7.2 release 2015-05-20 16:11:41 -07:00
Steve Gill
ec1cc70c8b CB-9042 updated for release 3.7.2 2015-05-20 15:44:14 -07:00
Joe Bowser
a64203f817 Removing Intent funtionality out of 3.7 2015-05-15 14:14:18 -07:00
9 changed files with 14 additions and 114 deletions

View File

@@ -20,6 +20,10 @@
-->
## Release Notes for Cordova (Android) ##
### Release 3.7.2 (May 2015) ###
* Removed Intent Functionality from Preferences - Preferences can no longer be set by intents
### Release 3.7.1 (January 2015) ###
* CB-8411 Initialize plugins only after `createViews()` is called (regression in 3.7.0)

View File

@@ -1 +1 @@
3.7.1
3.7.2

View File

@@ -20,6 +20,6 @@
*/
// Coho updates this line:
var VERSION = "3.7.1";
var VERSION = "3.7.2";
console.log(VERSION);

View File

@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '3.7.1';
var PLATFORM_VERSION_BUILD_LABEL = '3.7.2';
// file: src/scripts/require.js
/*jshint -W079 */
@@ -1977,4 +1977,4 @@ window.cordova = require('cordova');
require('cordova/init');
})();
})();

View File

@@ -37,7 +37,6 @@ public class Config {
parser = new ConfigXmlParser();
parser.parse(action);
parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras());
parser.getPreferences().copyIntoIntentExtras(action);
}
// Intended to be used for testing only; creates an empty configuration.

View File

@@ -232,7 +232,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
parser.parse(this);
preferences = parser.getPreferences();
preferences.setPreferencesBundle(getIntent().getExtras());
preferences.copyIntoIntentExtras(this);
internalWhitelist = parser.getInternalWhitelist();
externalWhitelist = parser.getExternalWhitelist();
launchUrl = parser.getLaunchUrl();

View File

@@ -61,13 +61,6 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return Boolean.parseBoolean(value);
} else if (preferencesBundleExtras != null) {
Object bundleValue = preferencesBundleExtras.get(name);
if (bundleValue instanceof String) {
return "true".equals(bundleValue);
}
// Gives a nice warning if type is wrong.
return preferencesBundleExtras.getBoolean(name, defaultValue);
}
return defaultValue;
}
@@ -78,13 +71,6 @@ public class CordovaPreferences {
if (value != null) {
// Use Integer.decode() can't handle it if the highest bit is set.
return (int)(long)Long.decode(value);
} else if (preferencesBundleExtras != null) {
Object bundleValue = preferencesBundleExtras.get(name);
if (bundleValue instanceof String) {
return Integer.valueOf((String)bundleValue);
}
// Gives a nice warning if type is wrong.
return preferencesBundleExtras.getInt(name, defaultValue);
}
return defaultValue;
}
@@ -94,14 +80,7 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return Double.valueOf(value);
} else if (preferencesBundleExtras != null) {
Object bundleValue = preferencesBundleExtras.get(name);
if (bundleValue instanceof String) {
return Double.valueOf((String)bundleValue);
}
// Gives a nice warning if type is wrong.
return preferencesBundleExtras.getDouble(name, defaultValue);
}
}
return defaultValue;
}
@@ -110,69 +89,8 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return value;
} else if (preferencesBundleExtras != null && !"errorurl".equals(name)) {
Object bundleValue = preferencesBundleExtras.get(name);
if (bundleValue != null) {
return bundleValue.toString();
}
}
}
return defaultValue;
}
// Plugins should not rely on values within the intent since this does not work
// for apps with multiple webviews. Instead, they should retrieve prefs from the
// Config object associated with their webview.
public void copyIntoIntentExtras(Activity action) {
for (String name : prefs.keySet()) {
String value = prefs.get(name);
if (value == null) {
continue;
}
if (name.equals("loglevel")) {
LOG.setLogLevel(value);
} else if (name.equals("splashscreen")) {
// Note: We should probably pass in the classname for the variable splash on splashscreen!
int resource = action.getResources().getIdentifier(value, "drawable", action.getClass().getPackage().getName());
if(resource == 0) {
resource = action.getResources().getIdentifier(value, "drawable", action.getPackageName());
}
action.getIntent().putExtra(name, resource);
}
else if(name.equals("backgroundcolor")) {
int asInt = (int)(long)Long.decode(value);
action.getIntent().putExtra(name, asInt);
}
else if(name.equals("loadurltimeoutvalue")) {
int asInt = Integer.decode(value);
action.getIntent().putExtra(name, asInt);
}
else if(name.equals("splashscreendelay")) {
int asInt = Integer.decode(value);
action.getIntent().putExtra(name, asInt);
}
else if(name.equals("keeprunning"))
{
boolean asBool = Boolean.parseBoolean(value);
action.getIntent().putExtra(name, asBool);
}
else if(name.equals("inappbrowserstorageenabled"))
{
boolean asBool = Boolean.parseBoolean(value);
action.getIntent().putExtra(name, asBool);
}
else if(name.equals("disallowoverscroll"))
{
boolean asBool = Boolean.parseBoolean(value);
action.getIntent().putExtra(name, asBool);
}
else
{
action.getIntent().putExtra(name, value);
}
}
// In the normal case, the intent extras are null until the first call to putExtra().
if (preferencesBundleExtras == null) {
preferencesBundleExtras = action.getIntent().getExtras();
}
}
}

View File

@@ -62,7 +62,7 @@ import android.widget.FrameLayout;
public class CordovaWebView extends WebView {
public static final String TAG = "CordovaWebView";
public static final String CORDOVA_VERSION = "3.7.1";
public static final String CORDOVA_VERSION = "3.7.2";
private HashSet<Integer> boundKeyCodes = new HashSet<Integer>();
@@ -405,7 +405,7 @@ public class CordovaWebView extends WebView {
// Create a timeout timer for loadUrl
final CordovaWebView me = this;
final int currentLoadUrlTimeout = me.loadUrlTimeout;
final int loadUrlTimeoutValue = Integer.parseInt(this.getProperty("LoadUrlTimeoutValue", "20000"));
final int loadUrlTimeoutValue = preferences.getInteger("LoadUrlTimeoutValue", 20000);
// Timeout error method
final Runnable loadError = new Runnable() {
@@ -609,26 +609,6 @@ public class CordovaWebView extends WebView {
}
}
/**
* Get string property for activity.
*
* @param name
* @param defaultValue
* @return the String value for the named property
*/
public String getProperty(String name, String defaultValue) {
Bundle bundle = this.cordova.getActivity().getIntent().getExtras();
if (bundle == null) {
return defaultValue;
}
name = name.toLowerCase(Locale.getDefault());
Object p = bundle.get(name);
if (p == null) {
return defaultValue;
}
return p.toString();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{

View File

@@ -1,6 +1,6 @@
{
"name": "cordova-android",
"version": "3.7.1",
"version": "3.7.2",
"description": "cordova-android release",
"main": "bin/create",
"repository": {
@@ -26,4 +26,4 @@
"jasmine-node": "~1",
"promise-matchers": "~0"
}
}
}