mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cda55b35f | |||
| da3f026974 | |||
| 7427b15f5f | |||
| 28580a2f4c | |||
| 31295566f3 | |||
| 20d2964be7 | |||
| d40f43c144 | |||
| 5fb913d000 | |||
| 5fa4728ebe | |||
| 4a7cbb5eb4 | |||
| bc91c554e6 |
@@ -21,7 +21,16 @@
|
|||||||
## Release Notes for Cordova (Android) ##
|
## Release Notes for Cordova (Android) ##
|
||||||
Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges *remote*/4.1.x...HEAD
|
Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges *remote*/4.1.x...HEAD
|
||||||
|
|
||||||
|
### Release 4.1.1 (Aug 2015) ###
|
||||||
|
|
||||||
|
* CB-9428 update script now bumps up minSdkVersion to 14 if it is less than that
|
||||||
|
* CB-9430 Fixes check_reqs failure when javac returns an extra line
|
||||||
|
|
||||||
### Release 4.1.0 (Jul 2015) ###
|
### Release 4.1.0 (Jul 2015) ###
|
||||||
|
|
||||||
|
* CB-9185 Fixed an issue when unsigned apks couldn't be found. This closes #202
|
||||||
|
* CB-9397 Fixes minor issues with `cordova requirements android`
|
||||||
|
* CB-9389 Fixes build/check_reqs hang
|
||||||
* CB-9392 Fixed printing flavored versions. This closes #184.
|
* CB-9392 Fixed printing flavored versions. This closes #184.
|
||||||
* CB-9382 [Android] Fix KeepRunning setting when Plugin activity is showed. This closes #200
|
* CB-9382 [Android] Fix KeepRunning setting when Plugin activity is showed. This closes #200
|
||||||
* CB-9391 Fixes cdvBuildMultipleApks option casting
|
* CB-9391 Fixes cdvBuildMultipleApks option casting
|
||||||
|
|||||||
+13
-11
@@ -82,15 +82,16 @@ module.exports.check_ant = function() {
|
|||||||
// Returns a promise. Called only by build and clean commands.
|
// Returns a promise. Called only by build and clean commands.
|
||||||
module.exports.check_gradle = function() {
|
module.exports.check_gradle = function() {
|
||||||
var sdkDir = process.env['ANDROID_HOME'];
|
var sdkDir = process.env['ANDROID_HOME'];
|
||||||
var message = 'Could not find gradle wrapper within Android SDK. ';
|
if (!sdkDir)
|
||||||
if (!sdkDir) return Q.reject(message + 'Might need to install Android SDK or set up \'ADROID_HOME\' env variable.');
|
return Q.reject('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' +
|
||||||
var wrapper = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper', 'gradlew');
|
'Might need to install Android SDK or set up \'ANDROID_HOME\' env variable.');
|
||||||
return tryCommand('"' + wrapper + '" -v', message + 'Might need to update your Android SDK.\n' +
|
|
||||||
'Looked here: ' + path.dirname(wrapper))
|
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
|
||||||
.then(function (output) {
|
if (!fs.existsSync(wrapperDir)) {
|
||||||
// Parse Gradle version from command output
|
return Q.reject(new Error('Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.\n' +
|
||||||
return/^gradle ((?:\d+\.)+(?:\d+))/gim.exec(output)[1];
|
'Looked here: ' + wrapperDir));
|
||||||
});
|
}
|
||||||
|
return Q.when();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Returns a promise.
|
// Returns a promise.
|
||||||
@@ -154,7 +155,8 @@ module.exports.check_java = function() {
|
|||||||
// javac writes version info to stderr instead of stdout
|
// javac writes version info to stderr instead of stdout
|
||||||
return tryCommand('javac -version', msg, true);
|
return tryCommand('javac -version', msg, true);
|
||||||
}).then(function (output) {
|
}).then(function (output) {
|
||||||
return /^javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
|
var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
|
||||||
|
return match && match[1];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -315,7 +317,7 @@ module.exports.check_all = function() {
|
|||||||
requirement.installed = true;
|
requirement.installed = true;
|
||||||
requirement.metadata.version = version;
|
requirement.metadata.version = version;
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
requirement.metadata.reason = err;
|
requirement.metadata.reason = err instanceof Error ? err.message : err;
|
||||||
});
|
});
|
||||||
}, Q())
|
}, Q())
|
||||||
.then(function () {
|
.then(function () {
|
||||||
|
|||||||
@@ -290,12 +290,31 @@ function extractProjectNameFromManifest(projectPath) {
|
|||||||
return m[1];
|
return m[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cordova-android updates sometimes drop support for older versions. Need to update minSDK in existing projects.
|
||||||
|
function updateMinSDKInManifest(projectPath) {
|
||||||
|
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
|
||||||
|
var manifestData = fs.readFileSync(manifestPath, 'utf8');
|
||||||
|
var minSDKVersion = 14;
|
||||||
|
|
||||||
|
//grab minSdkVersion from Android.
|
||||||
|
var m = /android:minSdkVersion\s*=\s*"(.*?)"/i.exec(manifestData);
|
||||||
|
if (!m) {
|
||||||
|
throw new Error('Could not find minSDKVersion in ' + manifestPath);
|
||||||
|
}
|
||||||
|
//if minSDKVersion in Android.manifest is less than our current min, replace it
|
||||||
|
if(Number(m[1]) < minSDKVersion) {
|
||||||
|
console.log('Updating minSdkVersion from ' + m[1] + ' to ' + minSDKVersion + ' in AndroidManifest.xml');
|
||||||
|
shell.sed('-i', /android:minSdkVersion\s*=\s*"(.*?)"/, 'android:minSdkVersion="'+minSDKVersion+'"', manifestPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a promise.
|
// Returns a promise.
|
||||||
exports.updateProject = function(projectPath, shared) {
|
exports.updateProject = function(projectPath, shared) {
|
||||||
return Q()
|
return Q()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
var projectName = extractProjectNameFromManifest(projectPath);
|
var projectName = extractProjectNameFromManifest(projectPath);
|
||||||
var target_api = check_reqs.get_target();
|
var target_api = check_reqs.get_target();
|
||||||
|
updateMinSDKInManifest(projectPath);
|
||||||
copyJsAndLibrary(projectPath, shared, projectName);
|
copyJsAndLibrary(projectPath, shared, projectName);
|
||||||
copyScripts(projectPath);
|
copyScripts(projectPath);
|
||||||
copyBuildRules(projectPath);
|
copyBuildRules(projectPath);
|
||||||
|
|||||||
Vendored
+4
-3
@@ -74,7 +74,7 @@ function findOutputApksHelper(dir, build_type, arch) {
|
|||||||
return /-debug/.exec(candidate) && !/-unaligned|-unsigned/.exec(candidate);
|
return /-debug/.exec(candidate) && !/-unaligned|-unsigned/.exec(candidate);
|
||||||
}
|
}
|
||||||
if (build_type === 'release') {
|
if (build_type === 'release') {
|
||||||
return /-release/.exec(candidate) && !/-unaligned|-unsigned/.exec(candidate);
|
return /-release/.exec(candidate) && !/-unaligned/.exec(candidate);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@@ -82,7 +82,7 @@ function findOutputApksHelper(dir, build_type, arch) {
|
|||||||
if (ret.length === 0) {
|
if (ret.length === 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// Assume arch-specific build if newest api has -x86 or -arm.
|
// Assume arch-specific build if newest apk has -x86 or -arm.
|
||||||
var archSpecific = !!/-x86|-arm/.exec(ret[0]);
|
var archSpecific = !!/-x86|-arm/.exec(ret[0]);
|
||||||
// And show only arch-specific ones (or non-arch-specific)
|
// And show only arch-specific ones (or non-arch-specific)
|
||||||
ret = ret.filter(function(p) {
|
ret = ret.filter(function(p) {
|
||||||
@@ -90,11 +90,12 @@ function findOutputApksHelper(dir, build_type, arch) {
|
|||||||
return !!/-x86|-arm/.exec(p) == archSpecific;
|
return !!/-x86|-arm/.exec(p) == archSpecific;
|
||||||
/*jshint +W018 */
|
/*jshint +W018 */
|
||||||
});
|
});
|
||||||
if (arch && ret.length > 1) {
|
if (archSpecific && ret.length > 1) {
|
||||||
ret = ret.filter(function(p) {
|
ret = ret.filter(function(p) {
|
||||||
return p.indexOf('-' + arch) != -1;
|
return p.indexOf('-' + arch) != -1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Coho updates this line:
|
// Coho updates this line:
|
||||||
var VERSION = "4.1.0-dev";
|
var VERSION = "4.1.1";
|
||||||
|
|
||||||
console.log(VERSION);
|
console.log(VERSION);
|
||||||
|
|||||||
+37
-38
@@ -1,5 +1,5 @@
|
|||||||
// Platform: android
|
// Platform: android
|
||||||
// 23738581906992092a43ad2e643b1e0c43bba38a
|
// 2c29e187e4206a6a77fba940ef6f77aef5c7eb8c
|
||||||
/*
|
/*
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
under the License.
|
under the License.
|
||||||
*/
|
*/
|
||||||
;(function() {
|
;(function() {
|
||||||
var PLATFORM_VERSION_BUILD_LABEL = '4.1.0-dev';
|
var PLATFORM_VERSION_BUILD_LABEL = '4.1.1';
|
||||||
// file: src/scripts/require.js
|
// file: src/scripts/require.js
|
||||||
|
|
||||||
/*jshint -W079 */
|
/*jshint -W079 */
|
||||||
@@ -328,7 +328,7 @@ module.exports = cordova;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: node_modules/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -351,7 +351,7 @@ module.exports = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: node_modules/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -376,7 +376,6 @@ module.exports = {
|
|||||||
// file: src/common/argscheck.js
|
// file: src/common/argscheck.js
|
||||||
define("cordova/argscheck", function(require, exports, module) {
|
define("cordova/argscheck", function(require, exports, module) {
|
||||||
|
|
||||||
var exec = require('cordova/exec');
|
|
||||||
var utils = require('cordova/utils');
|
var utils = require('cordova/utils');
|
||||||
|
|
||||||
var moduleExports = module.exports;
|
var moduleExports = module.exports;
|
||||||
@@ -861,7 +860,7 @@ module.exports = channel;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: node_modules/cordova-android/cordova-js-src/exec.js
|
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||||
define("cordova/exec", function(require, exports, module) {
|
define("cordova/exec", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -896,11 +895,7 @@ var cordova = require('cordova'),
|
|||||||
// For the ONLINE_EVENT to be viable, it would need to intercept all event
|
// For the ONLINE_EVENT to be viable, it would need to intercept all event
|
||||||
// listeners (both through addEventListener and window.ononline) as well
|
// listeners (both through addEventListener and window.ononline) as well
|
||||||
// as set the navigator property itself.
|
// as set the navigator property itself.
|
||||||
ONLINE_EVENT: 2,
|
ONLINE_EVENT: 2
|
||||||
// Uses reflection to access private APIs of the WebView that can send JS
|
|
||||||
// to be executed.
|
|
||||||
// Requires Android 3.2.4 or above.
|
|
||||||
PRIVATE_API: 3
|
|
||||||
},
|
},
|
||||||
jsToNativeBridgeMode, // Set lazily.
|
jsToNativeBridgeMode, // Set lazily.
|
||||||
nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
|
nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
|
||||||
@@ -1234,6 +1229,7 @@ if (!window.console.warn) {
|
|||||||
// Register pause, resume and deviceready channels as events on document.
|
// Register pause, resume and deviceready channels as events on document.
|
||||||
channel.onPause = cordova.addDocumentEventHandler('pause');
|
channel.onPause = cordova.addDocumentEventHandler('pause');
|
||||||
channel.onResume = cordova.addDocumentEventHandler('resume');
|
channel.onResume = cordova.addDocumentEventHandler('resume');
|
||||||
|
channel.onActivated = cordova.addDocumentEventHandler('activated');
|
||||||
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
|
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
|
||||||
|
|
||||||
// Listen for DOMContentLoaded and notify our channel subscribers.
|
// Listen for DOMContentLoaded and notify our channel subscribers.
|
||||||
@@ -1361,6 +1357,7 @@ if (!window.console.warn) {
|
|||||||
// Register pause, resume and deviceready channels as events on document.
|
// Register pause, resume and deviceready channels as events on document.
|
||||||
channel.onPause = cordova.addDocumentEventHandler('pause');
|
channel.onPause = cordova.addDocumentEventHandler('pause');
|
||||||
channel.onResume = cordova.addDocumentEventHandler('resume');
|
channel.onResume = cordova.addDocumentEventHandler('resume');
|
||||||
|
channel.onActivated = cordova.addDocumentEventHandler('activated');
|
||||||
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
|
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
|
||||||
|
|
||||||
// Listen for DOMContentLoaded and notify our channel subscribers.
|
// Listen for DOMContentLoaded and notify our channel subscribers.
|
||||||
@@ -1504,7 +1501,7 @@ exports.reset();
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: node_modules/cordova-android/cordova-js-src/platform.js
|
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||||
define("cordova/platform", function(require, exports, module) {
|
define("cordova/platform", function(require, exports, module) {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -1580,7 +1577,7 @@ function onMessageFromNative(msg) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: node_modules/cordova-android/cordova-js-src/plugin/android/app.js
|
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||||
|
|
||||||
var exec = require('cordova/exec');
|
var exec = require('cordova/exec');
|
||||||
@@ -1676,6 +1673,10 @@ module.exports = {
|
|||||||
// file: src/common/pluginloader.js
|
// file: src/common/pluginloader.js
|
||||||
define("cordova/pluginloader", function(require, exports, module) {
|
define("cordova/pluginloader", function(require, exports, module) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
NOTE: this file is NOT used when we use the browserify workflow
|
||||||
|
*/
|
||||||
|
|
||||||
var modulemapper = require('cordova/modulemapper');
|
var modulemapper = require('cordova/modulemapper');
|
||||||
var urlutil = require('cordova/urlutil');
|
var urlutil = require('cordova/urlutil');
|
||||||
|
|
||||||
@@ -1864,15 +1865,14 @@ utils.typeName = function(val) {
|
|||||||
/**
|
/**
|
||||||
* Returns an indication of whether the argument is an array or not
|
* Returns an indication of whether the argument is an array or not
|
||||||
*/
|
*/
|
||||||
utils.isArray = function(a) {
|
utils.isArray = Array.isArray ||
|
||||||
return utils.typeName(a) == 'Array';
|
function(a) {return utils.typeName(a) == 'Array';};
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an indication of whether the argument is a Date or not
|
* Returns an indication of whether the argument is a Date or not
|
||||||
*/
|
*/
|
||||||
utils.isDate = function(d) {
|
utils.isDate = function(d) {
|
||||||
return utils.typeName(d) == 'Date';
|
return (d instanceof Date);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1906,17 +1906,25 @@ utils.clone = function(obj) {
|
|||||||
* Returns a wrapped version of the function
|
* Returns a wrapped version of the function
|
||||||
*/
|
*/
|
||||||
utils.close = function(context, func, params) {
|
utils.close = function(context, func, params) {
|
||||||
if (typeof params == 'undefined') {
|
return function() {
|
||||||
return function() {
|
var args = params || arguments;
|
||||||
return func.apply(context, arguments);
|
return func.apply(context, args);
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
return function() {
|
|
||||||
return func.apply(context, params);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
function UUIDcreatePart(length) {
|
||||||
|
var uuidpart = "";
|
||||||
|
for (var i=0; i<length; i++) {
|
||||||
|
var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
|
||||||
|
if (uuidchar.length == 1) {
|
||||||
|
uuidchar = "0" + uuidchar;
|
||||||
|
}
|
||||||
|
uuidpart += uuidchar;
|
||||||
|
}
|
||||||
|
return uuidpart;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a UUID
|
* Create a UUID
|
||||||
*/
|
*/
|
||||||
@@ -1928,6 +1936,7 @@ utils.createUUID = function() {
|
|||||||
UUIDcreatePart(6);
|
UUIDcreatePart(6);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends a child object from a parent object using classical inheritance
|
* Extends a child object from a parent object using classical inheritance
|
||||||
* pattern.
|
* pattern.
|
||||||
@@ -1937,6 +1946,7 @@ utils.extend = (function() {
|
|||||||
var F = function() {};
|
var F = function() {};
|
||||||
// extend Child from Parent
|
// extend Child from Parent
|
||||||
return function(Child, Parent) {
|
return function(Child, Parent) {
|
||||||
|
|
||||||
F.prototype = Parent.prototype;
|
F.prototype = Parent.prototype;
|
||||||
Child.prototype = new F();
|
Child.prototype = new F();
|
||||||
Child.__super__ = Parent.prototype;
|
Child.__super__ = Parent.prototype;
|
||||||
@@ -1956,18 +1966,7 @@ utils.alert = function(msg) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
function UUIDcreatePart(length) {
|
|
||||||
var uuidpart = "";
|
|
||||||
for (var i=0; i<length; i++) {
|
|
||||||
var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
|
|
||||||
if (uuidchar.length == 1) {
|
|
||||||
uuidchar = "0" + uuidchar;
|
|
||||||
}
|
|
||||||
uuidpart += uuidchar;
|
|
||||||
}
|
|
||||||
return uuidpart;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
|
|||||||
* are not expected to implement it.
|
* are not expected to implement it.
|
||||||
*/
|
*/
|
||||||
public interface CordovaWebView {
|
public interface CordovaWebView {
|
||||||
public static final String CORDOVA_VERSION = "4.1.0-dev";
|
public static final String CORDOVA_VERSION = "4.1.1";
|
||||||
|
|
||||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cordova-android",
|
"name": "cordova-android",
|
||||||
"version": "4.1.0-dev",
|
"version": "4.1.1",
|
||||||
"description": "cordova-android release",
|
"description": "cordova-android release",
|
||||||
"main": "bin/create",
|
"main": "bin/create",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user