diff --git a/VERSION b/VERSION index 19b860c1..25af95dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.4.0 +6.4.1-dev diff --git a/bin/templates/cordova/lib/builders/GenericBuilder.js b/bin/templates/cordova/lib/builders/GenericBuilder.js index 770911b7..6515533a 100644 --- a/bin/templates/cordova/lib/builders/GenericBuilder.js +++ b/bin/templates/cordova/lib/builders/GenericBuilder.js @@ -93,6 +93,14 @@ GenericBuilder.prototype.extractRealProjectNameFromManifest = function () { module.exports = GenericBuilder; function apkSorter (fileA, fileB) { + // De-prioritize arch specific builds + var archSpecificRE = /-x86|-arm/; + if (archSpecificRE.exec(fileA)) { + return 1; + } else if (archSpecificRE.exec(fileB)) { + return -1; + } + // De-prioritize unsigned builds var unsignedRE = /-unsigned/; if (unsignedRE.exec(fileA)) { @@ -101,7 +109,7 @@ function apkSorter (fileA, fileB) { return -1; } - var timeDiff = fs.statSync(fileA).mtime - fs.statSync(fileB).mtime; + var timeDiff = fs.statSync(fileB).mtime - fs.statSync(fileA).mtime; return timeDiff === 0 ? fileA.length - fileB.length : timeDiff; } @@ -109,7 +117,14 @@ function findOutputApksHelper (dir, build_type, arch) { var shellSilent = shell.config.silent; shell.config.silent = true; - var ret = shell.ls(path.join(dir, build_type, '*.apk')).filter(function (candidate) { + // list directory recursively + var ret = shell.ls('-R', dir).map(function (file) { + // ls does not include base directory + return path.join(dir, file); + }).filter(function (file) { + // find all APKs + return file.match(/\.apk?$/i); + }).filter(function (candidate) { var apkName = path.basename(candidate); // Need to choose between release and debug .apk. if (build_type === 'debug') { diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version index 775a4cd2..2ae022d7 100755 --- a/bin/templates/cordova/version +++ b/bin/templates/cordova/version @@ -20,7 +20,7 @@ */ // Coho updates this line: -var VERSION = "6.4.0"; +var VERSION = "6.4.1-dev"; module.exports.version = VERSION; diff --git a/bin/templates/project/assets/www/cordova.js b/bin/templates/project/assets/www/cordova.js index 487939c6..141ca31b 100644 --- a/bin/templates/project/assets/www/cordova.js +++ b/bin/templates/project/assets/www/cordova.js @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '6.4.0'; +var PLATFORM_VERSION_BUILD_LABEL = '6.4.1-dev'; // file: src/scripts/require.js /* jshint -W079 */ @@ -2185,4 +2185,4 @@ window.cordova = require('cordova'); require('cordova/init'); -})(); \ No newline at end of file +})(); diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle index 76496b7f..07d4dfa6 100644 --- a/bin/templates/project/build.gradle +++ b/bin/templates/project/build.gradle @@ -74,6 +74,10 @@ ext { if (!project.hasProperty('cdvBuildMultipleApks')) { cdvBuildMultipleApks = null } + // Whether to append a 0 "abi digit" to versionCode when only a single APK is build + if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) { + cdvVersionCodeForceAbiDigit = null + } // .properties files to use for release signing. if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) { cdvReleaseSigningPropertiesFile = null @@ -115,6 +119,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('release-signing.propert // Cast to appropriate types. ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); +ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean(); ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : Integer.parseInt('' + cdvMinSdkVersion) ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) @@ -142,6 +147,7 @@ task cdvPrintProps << { println('cdvCompileSdkVersion=' + cdvCompileSdkVersion) println('cdvBuildToolsVersion=' + cdvBuildToolsVersion) println('cdvVersionCode=' + cdvVersionCode) + println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit) println('cdvMinSdkVersion=' + cdvMinSdkVersion) println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) @@ -184,25 +190,45 @@ android { buildToolsVersion cdvBuildToolsVersion if (Boolean.valueOf(cdvBuildMultipleApks)) { + flavorDimensions "default" + productFlavors { + armeabi { + versionCode defaultConfig.versionCode*10 + 1 + ndk { + abiFilters = ["armeabi"] + } + } armv7 { versionCode defaultConfig.versionCode*10 + 2 ndk { - abiFilters "armeabi-v7a", "" + abiFilters = ["armeabi-v7a"] + } + } + arm64 { + versionCode defaultConfig.versionCode*10 + 3 + ndk { + abiFilters = ["arm64-v8a"] } } x86 { versionCode defaultConfig.versionCode*10 + 4 ndk { - abiFilters "x86", "" + abiFilters = ["x86"] } } - all { + x86_64 { + versionCode defaultConfig.versionCode*10 + 5 ndk { - abiFilters "all", "" + abiFilters = ["x86_64"] } } } + } else if (Boolean.valueOf(cdvVersionCodeForceAbiDigit)) { + // This provides compatibility to the default logic for versionCode before cordova-android 5.2.0 + defaultConfig { + versionCode defaultConfig.versionCode*10 + } } /* diff --git a/bin/templates/project/res/drawable-land-hdpi/screen.png b/bin/templates/project/res/drawable-land-hdpi/screen.png index a61e2b1a..2d564f49 100644 Binary files a/bin/templates/project/res/drawable-land-hdpi/screen.png and b/bin/templates/project/res/drawable-land-hdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-land-ldpi/screen.png b/bin/templates/project/res/drawable-land-ldpi/screen.png index f3934cdc..c7eae7ed 100644 Binary files a/bin/templates/project/res/drawable-land-ldpi/screen.png and b/bin/templates/project/res/drawable-land-ldpi/screen.png differ diff --git a/bin/templates/project/res/drawable-land-mdpi/screen.png b/bin/templates/project/res/drawable-land-mdpi/screen.png index a1b697c5..3bf1ec2e 100644 Binary files a/bin/templates/project/res/drawable-land-mdpi/screen.png and b/bin/templates/project/res/drawable-land-mdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-land-xhdpi/screen.png b/bin/templates/project/res/drawable-land-xhdpi/screen.png index 79f2f094..987a9246 100644 Binary files a/bin/templates/project/res/drawable-land-xhdpi/screen.png and b/bin/templates/project/res/drawable-land-xhdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-land-xxhdpi/screen.png b/bin/templates/project/res/drawable-land-xxhdpi/screen.png index 2f568380..ef9fc740 100644 Binary files a/bin/templates/project/res/drawable-land-xxhdpi/screen.png and b/bin/templates/project/res/drawable-land-xxhdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-land-xxxhdpi/screen.png b/bin/templates/project/res/drawable-land-xxxhdpi/screen.png index ff6c13c2..8f9a458e 100644 Binary files a/bin/templates/project/res/drawable-land-xxxhdpi/screen.png and b/bin/templates/project/res/drawable-land-xxxhdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-hdpi/screen.png b/bin/templates/project/res/drawable-port-hdpi/screen.png index 5d6a28a8..5875561d 100644 Binary files a/bin/templates/project/res/drawable-port-hdpi/screen.png and b/bin/templates/project/res/drawable-port-hdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-ldpi/screen.png b/bin/templates/project/res/drawable-port-ldpi/screen.png index 65ad163a..72542062 100644 Binary files a/bin/templates/project/res/drawable-port-ldpi/screen.png and b/bin/templates/project/res/drawable-port-ldpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-mdpi/screen.png b/bin/templates/project/res/drawable-port-mdpi/screen.png index ea156935..9034b68f 100644 Binary files a/bin/templates/project/res/drawable-port-mdpi/screen.png and b/bin/templates/project/res/drawable-port-mdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-xhdpi/screen.png b/bin/templates/project/res/drawable-port-xhdpi/screen.png index c2e80421..95dc8d84 100644 Binary files a/bin/templates/project/res/drawable-port-xhdpi/screen.png and b/bin/templates/project/res/drawable-port-xhdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-xxhdpi/screen.png b/bin/templates/project/res/drawable-port-xxhdpi/screen.png index 9c7df083..9b6bfe4a 100644 Binary files a/bin/templates/project/res/drawable-port-xxhdpi/screen.png and b/bin/templates/project/res/drawable-port-xxhdpi/screen.png differ diff --git a/bin/templates/project/res/drawable-port-xxxhdpi/screen.png b/bin/templates/project/res/drawable-port-xxxhdpi/screen.png index 68c79989..ec655cde 100644 Binary files a/bin/templates/project/res/drawable-port-xxxhdpi/screen.png and b/bin/templates/project/res/drawable-port-xxxhdpi/screen.png differ diff --git a/bin/templates/project/res/mipmap-hdpi/icon.png b/bin/templates/project/res/mipmap-hdpi/icon.png index 4d276344..53842612 100644 Binary files a/bin/templates/project/res/mipmap-hdpi/icon.png and b/bin/templates/project/res/mipmap-hdpi/icon.png differ diff --git a/bin/templates/project/res/mipmap-ldpi/icon.png b/bin/templates/project/res/mipmap-ldpi/icon.png index cd5032a4..c5fcaeb6 100644 Binary files a/bin/templates/project/res/mipmap-ldpi/icon.png and b/bin/templates/project/res/mipmap-ldpi/icon.png differ diff --git a/bin/templates/project/res/mipmap-mdpi/icon.png b/bin/templates/project/res/mipmap-mdpi/icon.png index e79c6062..a18167be 100644 Binary files a/bin/templates/project/res/mipmap-mdpi/icon.png and b/bin/templates/project/res/mipmap-mdpi/icon.png differ diff --git a/bin/templates/project/res/mipmap-xhdpi/icon.png b/bin/templates/project/res/mipmap-xhdpi/icon.png index ec7ffbfb..9e3eec36 100644 Binary files a/bin/templates/project/res/mipmap-xhdpi/icon.png and b/bin/templates/project/res/mipmap-xhdpi/icon.png differ diff --git a/bin/templates/project/res/mipmap-xxhdpi/icon.png b/bin/templates/project/res/mipmap-xxhdpi/icon.png index 38c2bf5e..a5692896 100644 Binary files a/bin/templates/project/res/mipmap-xxhdpi/icon.png and b/bin/templates/project/res/mipmap-xxhdpi/icon.png differ diff --git a/bin/templates/project/res/mipmap-xxxhdpi/icon.png b/bin/templates/project/res/mipmap-xxxhdpi/icon.png index 53e57538..3c322f2e 100644 Binary files a/bin/templates/project/res/mipmap-xxxhdpi/icon.png and b/bin/templates/project/res/mipmap-xxxhdpi/icon.png differ diff --git a/framework/build.gradle b/framework/build.gradle index f8e3a952..cd9e6d4c 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -31,7 +31,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' } @@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' group = 'org.apache.cordova' -version = '6.4.0' +version = '6.4.1-dev' android { compileSdkVersion cdvCompileSdkVersion @@ -129,9 +129,15 @@ bintray { licenses = ['Apache-2.0'] labels = ['android', 'cordova', 'phonegap'] version { +<<<<<<< HEAD name = '6.4.0' released = new Date() vcsTag = '6.4.0' +======= + name = '6.5.0-dev' + released = new Date() + vcsTag = '6.5.0-dev' +>>>>>>> master } } } diff --git a/framework/gradle/wrapper/gradle-wrapper.properties b/framework/gradle/wrapper/gradle-wrapper.properties index 04e285f3..c3a5fdab 100644 --- a/framework/gradle/wrapper/gradle-wrapper.properties +++ b/framework/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Dec 28 10:00:20 PST 2015 +#Thu Nov 09 10:50:25 PST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/framework/src/org/apache/cordova/CordovaInterface.java b/framework/src/org/apache/cordova/CordovaInterface.java index 3b8468f3..ff906834 100755 --- a/framework/src/org/apache/cordova/CordovaInterface.java +++ b/framework/src/org/apache/cordova/CordovaInterface.java @@ -19,6 +19,7 @@ package org.apache.cordova; import android.app.Activity; +import android.content.Context; import android.content.Intent; import org.apache.cordova.CordovaPlugin; @@ -51,10 +52,18 @@ public interface CordovaInterface { /** * Get the Android activity. * + * If a custom engine lives outside of the Activity's lifecycle the return value may be null. + * * @return the Activity */ public abstract Activity getActivity(); - + + /** + * Get the Android context. + * + * @return the Context + */ + public Context getContext(); /** * Called when a message is sent to plugin. diff --git a/framework/src/org/apache/cordova/CordovaInterfaceImpl.java b/framework/src/org/apache/cordova/CordovaInterfaceImpl.java index 71dcb782..3c459025 100644 --- a/framework/src/org/apache/cordova/CordovaInterfaceImpl.java +++ b/framework/src/org/apache/cordova/CordovaInterfaceImpl.java @@ -20,6 +20,7 @@ package org.apache.cordova; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; @@ -84,6 +85,11 @@ public class CordovaInterfaceImpl implements CordovaInterface { return activity; } + @Override + public Context getContext() { + return activity; + } + @Override public Object onMessage(String id, Object data) { if ("exit".equals(id)) { diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 7ab2f917..4f8c440d 100644 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback; * are not expected to implement it. */ public interface CordovaWebView { - public static final String CORDOVA_VERSION = "6.4.0"; + public static final String CORDOVA_VERSION = "6.4.1-dev"; void init(CordovaInterface cordova, List pluginEntries, CordovaPreferences preferences); diff --git a/package.json b/package.json index 39c62219..23c68e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-android", - "version": "6.4.0", + "version": "6.5.0-dev", "description": "cordova-android release", "bin": { "create": "bin/create"