Compare commits

...

12 Commits

Author SHA1 Message Date
Joe Bowser
9768e73882 Set VERSION to 3.4.0 (via coho) 2014-02-14 13:46:01 -08:00
Joe Bowser
db2a498d76 Update JS snapshot to version 3.4.0 (via coho) 2014-02-14 13:46:00 -08:00
Joe Bowser
b0e205a781 Updating Release Notes, NOTE: wiki does not count commits between RC1 and HEAD on Release Branch 2014-02-14 13:44:38 -08:00
Joe Bowser
8f54290eec Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vulnerability 2014-02-06 16:11:55 -08:00
Andrew Grieve
6760d0378a CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins. 2014-01-28 10:32:16 -05:00
Andrew Grieve
f4b1d09407 CB-5715 For CLI, hide assets/www and res/xml/config.xml by default
Add a helper file under assets to say how to re-show the hidden files.
Move the config.xml, www, merges entries to the root to be more discoverable.
2014-01-28 00:31:10 -05:00
Andrew Grieve
029d1561dc CB-5793 ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/ as a project when importing 2014-01-25 22:00:26 -05:00
Andrew Grieve
06660383e1 CB-5889 Make update script find project name instead of using "null" for CordovaLib 2014-01-24 10:41:02 -05:00
Andrew Grieve
f28738fe6d CB-5889 Add a message in the update script about needing to import CordovaLib when using an IDE. 2014-01-24 10:30:42 -05:00
Joe Bowser
5981023a4c Set VERSION to 3.4.0-rc1 (via coho) 2014-01-22 16:30:01 -08:00
Joe Bowser
89f9ac1957 Update JS snapshot to version 3.4.0-rc1 (via coho) 2014-01-22 16:30:00 -08:00
Joe Bowser
09e1c00fb8 Manually incrementing version 2014-01-22 16:10:45 -08:00
8 changed files with 118 additions and 65 deletions

View File

@ -20,6 +20,29 @@
-->
## Release Notes for Cordova (Android) ##
### 3.4.0 (Feb 2014) ###
37 commits from 10 authors. Highlights include:
* Security Fix for Android 4.2.1 and lower (disabling addJavascriptInterface as a bridge option)
* CB-5793 Make ant work-around work on windows.
* CB-5793 Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse.
* CB-4910 Fix CLI's eclipse project template not working on windows due to "*" in the virtual folder name.
* CB-5803 Fix cordova/emulate on windows.
* CB-5801 exec->spawn in build to make sure compile errors are shown.
* CB-5799 Update version of OkHTTP to 1.3
* Remove package.json within bin/ since we never intend to ship bin/ as an npm module
* CB-4910 Update CLI project template to point to config.xml at the root now that it's not in www/ by default.
* Silence excessive logging from scroll events
* CB-5504: Adding onDestroy to app plugin to deregister telephonyReceiver
* CB-5715 Add Eclipse .project file to create template.
* CB-5447 Removed android:debuggable=“true” from project template.
* CB-5714 Fix of android build when too big output stops build with error due to buffer overflow.
* Fix incorrect MIME type for .js files loaded through CordovaResourceAPI.
* Remove 2 X console.log from exec.js
* CB-5592 Set MIME type for openExternal when scheme is file:
### 3.3.0 (Dec 2013) ###
41 commits from 11 authors. Highlights include:

View File

@ -1 +1 @@
3.4.0-dev
3.4.0

View File

@ -165,17 +165,23 @@ exports.createProject = function(project_path, package_name, project_name, proje
// copy project template
shell.cp('-r', path.join(project_template_dir, 'assets'), project_path);
shell.cp('-r', path.join(project_template_dir, 'res'), project_path);
shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
// Manually create directories that would be empty within the template (since git doesn't track directories).
shell.mkdir(path.join(project_path, 'libs'));
// Add in the proper eclipse project file.
if (use_cli_template) {
var note = 'To show `assets/www` or `res/xml/config.xml`, go to:\n' +
' Project -> Properties -> Resource -> Resource Filters\n' +
'And delete the exclusion filter.\n';
shell.cp(path.join(project_template_dir, 'eclipse-project-CLI'), path.join(project_path, '.project'));
fs.writeFileSync(path.join(project_path, 'assets', '_where-is-www.txt'), note);
} else {
shell.cp(path.join(project_template_dir, 'eclipse-project'), path.join(project_path, '.project'));
}
// copy cordova.js, cordova.jar and res/xml
shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
// copy cordova.js, cordova.jar
copyJsAndLibrary(project_path, use_shared_project, safe_activity_name);
// interpolate the activity name and package
@ -202,24 +208,36 @@ exports.createProject = function(project_path, package_name, project_name, proje
// Attribute removed in Cordova 4.4 (CB-5447).
function removeDebuggableFromManifest(projectPath) {
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
shell.sed('-i', /\s*android:debuggable="true"/, '', manifestPath);
}
function extractProjectNameFromManifest(projectPath) {
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
var manifestData = fs.readFileSync(manifestPath, 'utf8');
var m = /<activity[\s\S]*?android:name\s*=\s*"(.*?)"/i.exec(manifestData);
if (!m) {
throw new Error('Could not find activity name in ' + manifestPath);
}
return m[1];
}
// Returns a promise.
exports.updateProject = function(projectPath) {
var version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
// Check that requirements are met and proper targets are installed
return check_reqs.run()
.then(function() {
var projectName = extractProjectNameFromManifest(projectPath);
var target_api = check_reqs.get_target();
copyJsAndLibrary(projectPath, false, null);
copyJsAndLibrary(projectPath, false, projectName);
copyScripts(projectPath);
copyAntRules(projectPath);
removeDebuggableFromManifest(projectPath);
return runAndroidUpdate(projectPath, target_api, false)
.then(function() {
console.log('Android project is now at version ' + version);
console.log('If you updated from a pre-3.2.0 version and use an IDE, we now require that you import the "CordovaLib" library project.');
});
});
};

View File

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

View File

@ -13,5 +13,9 @@
</path>
<echo message="Set jars path to: ${toString:project.all.jars.path}"/>
</target>
<target name="-post-build">
<move file="ant-build/AndroidManifest.xml" tofile="ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
<move file="CordovaLib/ant-build/AndroidManifest.xml" tofile="CordovaLib/ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
</target>
</project>

View File

@ -32,36 +32,40 @@
</natures>
<linkedResources>
<link>
<name>-- Cordova Project --</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>-- Cordova Project --/config.xml</name>
<name>config.xml</name>
<type>1</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/config.xml</locationURI>
</link>
<link>
<name>-- Cordova Project --/www</name>
<name>www</name>
<type>2</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
</link>
<link>
<name>-- Cordova Project --/merges</name>
<name>merges</name>
<type>2</type>
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
</link>
</linkedResources>
<filteredResources>
<filter>
<id>1388696068187</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-CordovaLib|platform_www|cordova</arguments>
</matcher>
</filter>
</filteredResources>
<filteredResources>
<filter>
<id>1390880034107</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-true-^(build.xml|ant-gen|ant-build|custom_rules.xml|CordovaLib|platform_www|cordova)</arguments>
</matcher>
</filter>
<filter>
<id>1390880034108</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-true-^(assets/www|res/xml/config.xml)</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@ -1,5 +1,5 @@
// Platform: android
// 3.3.0-dev-c9de1bc
// 3.4.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@ -19,8 +19,8 @@
under the License.
*/
;(function() {
var CORDOVA_JS_BUILD_LABEL = '3.3.0-dev-c9de1bc';
// file: lib/scripts/require.js
var CORDOVA_JS_BUILD_LABEL = '3.4.0';
// file: src/scripts/require.js
/*jshint -W079 */
/*jshint -W020 */
@ -34,7 +34,7 @@ var require,
requireStack = [],
// Map of module ID -> index into requireStack of modules currently being built.
inProgressModules = {},
SEPERATOR = ".";
SEPARATOR = ".";
@ -44,7 +44,7 @@ var require,
var resultantId = id;
//Its a relative path, so lop off the last portion and add the id (minus "./")
if (id.charAt(0) === ".") {
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPERATOR)) + SEPERATOR + id.slice(2);
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
}
return require(resultantId);
};
@ -98,7 +98,7 @@ if (typeof module === "object" && typeof require === "function") {
module.exports.define = define;
}
// file: lib/cordova.js
// file: src/cordova.js
define("cordova", function(require, exports, module) {
@ -316,7 +316,7 @@ module.exports = cordova;
});
// file: lib/android/android/nativeapiprovider.js
// file: src/android/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
@ -339,7 +339,7 @@ module.exports = {
});
// file: lib/android/android/promptbasednativeapi.js
// file: src/android/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@ -361,7 +361,7 @@ module.exports = {
});
// file: lib/common/argscheck.js
// file: src/common/argscheck.js
define("cordova/argscheck", function(require, exports, module) {
var exec = require('cordova/exec');
@ -427,7 +427,7 @@ moduleExports.enableChecks = true;
});
// file: lib/common/base64.js
// file: src/common/base64.js
define("cordova/base64", function(require, exports, module) {
var base64 = exports;
@ -483,7 +483,7 @@ function uint8ToBase64(rawData) {
});
// file: lib/common/builder.js
// file: src/common/builder.js
define("cordova/builder", function(require, exports, module) {
var utils = require('cordova/utils');
@ -552,7 +552,7 @@ function include(parent, objects, clobber, merge) {
include(result, obj.children, clobber, merge);
}
} catch(e) {
utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"');
utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
}
});
}
@ -596,7 +596,7 @@ exports.replaceHookForTesting = function() {};
});
// file: lib/common/channel.js
// file: src/common/channel.js
define("cordova/channel", function(require, exports, module) {
var utils = require('cordova/utils'),
@ -837,7 +837,7 @@ module.exports = channel;
});
// file: lib/android/exec.js
// file: src/android/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@ -1074,7 +1074,7 @@ module.exports = androidExec;
});
// file: lib/common/exec/proxy.js
// file: src/common/exec/proxy.js
define("cordova/exec/proxy", function(require, exports, module) {
@ -1104,7 +1104,7 @@ module.exports = {
};
});
// file: lib/common/init.js
// file: src/common/init.js
define("cordova/init", function(require, exports, module) {
var channel = require('cordova/channel');
@ -1218,7 +1218,7 @@ channel.join(function() {
});
// file: lib/common/modulemapper.js
// file: src/common/modulemapper.js
define("cordova/modulemapper", function(require, exports, module) {
var builder = require('cordova/builder'),
@ -1319,7 +1319,7 @@ exports.reset();
});
// file: lib/android/platform.js
// file: src/android/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@ -1360,7 +1360,7 @@ module.exports = {
});
// file: lib/android/plugin/android/app.js
// file: src/android/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');
@ -1437,10 +1437,11 @@ module.exports = {
});
// file: lib/common/pluginloader.js
// file: src/common/pluginloader.js
define("cordova/pluginloader", function(require, exports, module) {
var modulemapper = require('cordova/modulemapper');
var urlutil = require('cordova/urlutil');
// Helper function to inject a <script> tag.
function injectScript(url, onload, onerror) {
@ -1509,11 +1510,14 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
}
function injectPluginScript(pathPrefix, finishPluginLoading) {
injectScript(pathPrefix + 'cordova_plugins.js', function(){
var pluginPath = pathPrefix + 'cordova_plugins.js';
injectScript(pluginPath, function() {
try {
var moduleList = require("cordova/plugin_list");
handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
} catch (e) {
}
catch (e) {
// Error loading cordova_plugins.js, file not found or something
// this is an acceptable error, pre-3.0.0, so we just move on.
finishPluginLoading();
@ -1550,24 +1554,24 @@ exports.load = function(callback) {
});
// file: lib/common/urlutil.js
// file: src/common/urlutil.js
define("cordova/urlutil", function(require, exports, module) {
var urlutil = exports;
var anchorEl = document.createElement('a');
/**
* For already absolute URLs, returns what is passed in.
* For relative URLs, converts them to absolute ones.
*/
urlutil.makeAbsolute = function(url) {
exports.makeAbsolute = function makeAbsolute(url) {
var anchorEl = document.createElement('a');
anchorEl.href = url;
return anchorEl.href;
};
});
// file: lib/common/utils.js
// file: src/common/utils.js
define("cordova/utils", function(require, exports, module) {
var utils = exports;
@ -1738,7 +1742,7 @@ function UUIDcreatePart(length) {
});
window.cordova = require('cordova');
// file: lib/scripts/bootstrap.js
// file: src/scripts/bootstrap.js
require('cordova/init');

View File

@ -68,7 +68,7 @@ import android.widget.FrameLayout;
public class CordovaWebView extends WebView {
public static final String TAG = "CordovaWebView";
public static final String CORDOVA_VERSION = "3.4.0-dev";
public static final String CORDOVA_VERSION = "3.4.0";
private ArrayList<Integer> keyDownCodes = new ArrayList<Integer>();
private ArrayList<Integer> keyUpCodes = new ArrayList<Integer>();
@ -361,18 +361,13 @@ public class CordovaWebView extends WebView {
private void exposeJsInterface() {
int SDK_INT = Build.VERSION.SDK_INT;
boolean isHoneycomb = (SDK_INT >= Build.VERSION_CODES.HONEYCOMB && SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR2);
if (isHoneycomb || (SDK_INT < Build.VERSION_CODES.GINGERBREAD)) {
if ((SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)) {
Log.i(TAG, "Disabled addJavascriptInterface() bridge since Android version is old.");
// Bug being that Java Strings do not get converted to JS strings automatically.
// This isn't hard to work-around on the JS side, but it's easier to just
// use the prompt bridge instead.
return;
} else if (SDK_INT < Build.VERSION_CODES.HONEYCOMB && Build.MANUFACTURER.equals("unknown")) {
// addJavascriptInterface crashes on the 2.3 emulator.
Log.i(TAG, "Disabled addJavascriptInterface() bridge callback due to a bug on the 2.3 emulator");
return;
}
}
this.addJavascriptInterface(exposedJsApi, "_cordovaNative");
}
@ -445,17 +440,22 @@ public class CordovaWebView extends WebView {
}
}
public void loadUrlIntoView(final String url) {
loadUrlIntoView(url, true);
}
/**
* Load the url into the webview.
*
* @param url
*/
public void loadUrlIntoView(final String url) {
public void loadUrlIntoView(final String url, boolean recreatePlugins) {
LOG.d(TAG, ">>> loadUrl(" + url + ")");
this.url = url;
this.pluginManager.init();
if (recreatePlugins) {
this.url = url;
this.pluginManager.init();
}
// Create a timeout timer for loadUrl
final CordovaWebView me = this;