From 15d190e65268cfe2fe8884f3469c0e4df42b78bb Mon Sep 17 00:00:00 2001 From: david-spaeth Date: Wed, 7 Mar 2018 17:30:00 +0100 Subject: [PATCH 1/3] Fix the productName value when attributes are used Fix the bad value of `productName` variable if `short` attribute has use in `name` tag Cordova allow `short` attribute in `name` tag. See: https://cordova.apache.org/docs/en/latest/config_ref/#short-name --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index b83ef55..5e7be91 100644 --- a/index.js +++ b/index.js @@ -197,6 +197,9 @@ var getProjectName = function () { deferred.reject(err); } var projectName = result.widget.name[0]; + if (typeof projectName == "object") { + projectName = projectName._.trim() + } deferred.resolve(projectName); }); }); From 22ba340be8f7ed4e07ecca1b7102c410dcfd065e Mon Sep 17 00:00:00 2001 From: david-spaeth Date: Fri, 9 Mar 2018 13:43:27 +0100 Subject: [PATCH 2/3] add compatibility Cordova-android < 7 --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 5e7be91..122eef6 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,7 @@ var settings = {}; settings.CONFIG_FILE = argv.config || 'config.xml'; settings.ICON_FILE = argv.icon || 'icon.png'; settings.OLD_XCODE_PATH = argv['xcode-old'] || false; +settings.OLD_ANDROID_PATH = argv['android-old'] || false; /** * Check which platforms are added to the project and return their icon names and sizes @@ -69,7 +70,7 @@ var getPlatforms = function (projectName) { platforms.push({ name : 'android', isAdded : fs.existsSync('platforms/android'), - iconsPath : 'platforms/android/app/src/main/res/', + iconsPath : settings.OLD_ANDROID_PATH ? 'platforms/android/res/' : 'platforms/android/app/src/main/res/',, icons : [ { name : 'drawable/icon.png', size : 96 }, { name : 'drawable-hdpi/icon.png', size : 72 }, From 8cf4dd4ae1230c597db13ac5fb33cbedaa3dcc78 Mon Sep 17 00:00:00 2001 From: david-spaeth Date: Fri, 9 Mar 2018 13:54:26 +0100 Subject: [PATCH 3/3] fix syntaxe --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 122eef6..e1e3912 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,7 @@ var getPlatforms = function (projectName) { platforms.push({ name : 'android', isAdded : fs.existsSync('platforms/android'), - iconsPath : settings.OLD_ANDROID_PATH ? 'platforms/android/res/' : 'platforms/android/app/src/main/res/',, + iconsPath : settings.OLD_ANDROID_PATH ? 'platforms/android/res/' : 'platforms/android/app/src/main/res/', icons : [ { name : 'drawable/icon.png', size : 96 }, { name : 'drawable-hdpi/icon.png', size : 72 },