Skip to content

Commit

Permalink
Release 3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement authored and Clement committed Mar 29, 2017
1 parent 78c7282 commit 3c325c5
Show file tree
Hide file tree
Showing 78 changed files with 864 additions and 274 deletions.
2 changes: 1 addition & 1 deletion MOLPayXDKExample/platforms/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DELETE_CACHE_FILES" />
</manifest>
3 changes: 2 additions & 1 deletion MOLPayXDKExample/platforms/android/CordovaLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
buildscript {
repositories {
mavenCentral()
jcenter();
}

dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.1'
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-24
target=android-25
apk-configurations=
renderscript.opt.level=O0
android.library=true
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one
* are not expected to implement it.
*/
public interface CordovaWebView {
public static final String CORDOVA_VERSION = "6.0.0";
public static final String CORDOVA_VERSION = "6.1.2";

void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

Expand Down
8 changes: 4 additions & 4 deletions MOLPayXDKExample/platforms/android/android.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@
],
"plugin_metadata": {
"cordova-plugin-android-permissions": "0.10.0",
"cordova-plugin-inappbrowser": "1.6.1",
"cordova-plugin-inappbrowser": "1.7.0",
"cordova-plugin-privacyscreen": "0.3.1",
"cordova-plugin-whitelist": "1.3.1",
"cordova-plugin-x-toast": "2.5.2",
"cordova-plugin-whitelist": "1.3.2",
"cordova-plugin-x-toast": "2.6.0",
"cordova-save-image-gallery": "0.0.26",
"molpay-mobile-xdk-cordova": "3.9.0"
"molpay-mobile-xdk-cordova": "3.10.0"
}
}
14 changes: 7 additions & 7 deletions MOLPayXDKExample/platforms/android/assets/www/cordova.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Platform: android
// 53ea1913735222d326e65326e03391405df3cd4e
// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand All @@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '6.0.0';
var PLATFORM_VERSION_BUILD_LABEL = '6.1.2';
// file: src/scripts/require.js

/*jshint -W079 */
Expand Down Expand Up @@ -330,7 +330,7 @@ module.exports = cordova;

});

// file: /Users/jbowser/cordova/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) {

/**
Expand All @@ -353,7 +353,7 @@ module.exports = {

});

// file: /Users/jbowser/cordova/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) {

/**
Expand Down Expand Up @@ -886,7 +886,7 @@ module.exports = channel;

});

// file: /Users/jbowser/cordova/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) {

/**
Expand Down Expand Up @@ -1649,7 +1649,7 @@ exports.reset();

});

// file: /Users/jbowser/cordova/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) {

// The last resume event that was received that had the result of a plugin call.
Expand Down Expand Up @@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {

});

// file: /Users/jbowser/cordova/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) {

var exec = require('cordova/exec');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ module.exports.metadata =
// TOP OF METADATA
{
"cordova-plugin-android-permissions": "0.10.0",
"cordova-plugin-inappbrowser": "1.6.1",
"cordova-plugin-inappbrowser": "1.7.0",
"cordova-plugin-privacyscreen": "0.3.1",
"cordova-plugin-whitelist": "1.3.1",
"cordova-plugin-x-toast": "2.5.2",
"cordova-plugin-whitelist": "1.3.2",
"cordova-plugin-x-toast": "2.6.0",
"cordova-save-image-gallery": "0.0.26",
"molpay-mobile-xdk-cordova": "3.9.0"
"molpay-mobile-xdk-cordova": "3.10.0"
};
// BOTTOM OF METADATA
});
8 changes: 6 additions & 2 deletions MOLPayXDKExample/platforms/android/assets/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var app = {
'mp_bill_description' : 'Bill description',
'mp_bill_name' : 'Bill name',
'mp_bill_email' : '[email protected]',
'mp_bill_mobile' : '123456',
'mp_bill_mobile' : '123456'
// 'mp_channel_editing' : false,
// 'mp_editing_enabled' : false,
// 'mp_transaction_id' : '', // Optional, required when mp_request_type is 'Status'
Expand All @@ -42,7 +42,11 @@ var app = {
// 'mp_sandbox_mode': true, // Optional for sandboxed development environment, set boolean value to enable.
// 'mp_express_mode': true, // Optional, required a valid mp_channel value, this will skip the payment info page and go direct to the payment screen.
// 'mp_advanced_email_validation_enabled': true, // Optional, enable this for extended email format validation based on W3C standards.
// 'mp_advanced_phone_validation_enabled': true // Optional, enable this for extended phone format validation based on Google i18n standards.
// 'mp_advanced_phone_validation_enabled': true, // Optional, enable this for extended phone format validation based on Google i18n standards.
// 'mp_bill_name_edit_disabled': true, // Optional, explicitly force disable billing name edit.
// 'mp_bill_email_edit_disabled': true, // Optional, explicitly force disable billing email edit.
// 'mp_bill_mobile_edit_disabled': true, // Optional, explicitly force disable billing mobile edit.
// 'mp_bill_description_edit_disabled': true // Optional, explicitly force disable billing description edit.
};

var molpayCallback = function (transactionResult) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <!-- <meta name="viewport" content="width=device-width"> --> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> <meta name="format-detection" content="telephone=no"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="styles/vendor.34eb91d2.css"> <link rel="stylesheet" href="styles/main.d7e0b867.css"> </head> <body ng-app="molpayXsdkApp"> <div class="header"> </div> <div id="app-body" class="app-body container-fluid"> <div class="row"> <div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div> <div class="col-xs-12 col-sm-8 col-md-6 col-lg-4" ng-view=""></div> <div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div> </div> </div> <div ng-show="isStarting || isLoading" class="text-center"> <br> <p>{{label_preparing}}</p> <p>{{label_pleasewait}}</p> </div> <div class="footer"> </div> <div ng-show="isLoading || D7ARequeryActiveNow" class="loading text-center vertical-center"> <div class="loadingbackground"></div> <i class="fa fa-spinner fa-spin fa-3x"></i> <div class="loading-text">{{label_loading}}</div> </div> <script src="scripts/vendor.1780c687.js"></script> <script src="scripts/scripts.7554129b.js"></script> </body> </html>
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <!-- <meta name="viewport" content="width=device-width"> --> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> <meta name="format-detection" content="telephone=no"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="styles/vendor.34eb91d2.css"> <link rel="stylesheet" href="styles/main.d7e0b867.css"> </head> <body ng-app="molpayXsdkApp"> <div class="header"> </div> <div id="app-body" class="app-body container-fluid"> <div class="row"> <div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div> <div class="col-xs-12 col-sm-8 col-md-6 col-lg-4" ng-view=""></div> <div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div> </div> </div> <div ng-show="isStarting || isLoading" class="text-center"> <br> <p>{{label_preparing}}</p> <p>{{label_pleasewait}}</p> </div> <div class="footer"> </div> <div ng-show="isLoading || D7ARequeryActiveNow" class="loading text-center vertical-center"> <div class="loadingbackground"></div> <i class="fa fa-spinner fa-spin fa-3x"></i> <div class="loading-text">{{label_loading}}</div> </div> <script src="scripts/vendor.f57621ed.js"></script> <script src="scripts/scripts.d549f114.js"></script> </body> </html>

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions MOLPayXDKExample/platforms/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.1'
}
}

Expand Down Expand Up @@ -266,7 +266,7 @@ def promptForReleaseKeyPassword() {

gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().each() { task ->
if (task.name == 'validateReleaseSigning') {
if (task.name == 'validateReleaseSigning' || task.name == 'validateSigningRelease') {
promptForReleaseKeyPassword()
}
}
Expand Down
13 changes: 9 additions & 4 deletions MOLPayXDKExample/platforms/android/cordova/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ function Api(platform, platformRootDir, events) {
this.locations = {
root: self.root,
www: path.join(self.root, 'assets/www'),
res: path.relative(self.root, path.join(self.root, 'res')),
res: path.join(self.root, 'res'),
platformWww: path.join(self.root, 'platform_www'),
configXml: path.join(self.root, 'res/xml/config.xml'),
defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
strings: path.join(self.root, 'res/values/strings.xml'),
manifest: path.join(self.root, 'AndroidManifest.xml'),
build: path.join(self.root, 'build'),
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
Expand All @@ -85,7 +86,7 @@ function Api(platform, platformRootDir, events) {
this.locations.strings = path.join(self.root, 'app/src/main/res/xml/strings.xml');
this.locations.manifest = path.join(self.root, 'app/src/main/AndroidManifest.xml');
this.locations.www = path.join(self.root, 'app/src/main/assets/www');
this.locations.res = path.relative(self.root, path.join(self.root, 'app/src/main/res'));
this.locations.res = path.join(self.root, 'app/src/main/res');
}
}

Expand Down Expand Up @@ -241,10 +242,12 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
// Do some basic argument parsing
var opts = {};

// Skip cleaning prepared files when not invoking via cordova CLI.
// Skip cleaning prepared files when not invoking via cordova CLI.
opts.noPrepare = true;

return self.clean(opts);
if(!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
return self.clean(opts);
}
})
.then(function () {
return PluginManager.get(self.platform, self.locations, project)
Expand Down Expand Up @@ -395,6 +398,8 @@ Api.prototype.clean = function(cleanOptions) {
});
};



/**
* Performs a requirements check for current platform. Each platform defines its
* own set of requirements, which should be resolved before platform can be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,14 @@ AndroidProject.prototype.getUninstaller = function (type) {
return pluginHandlers.getUninstaller(type);
};

/*
* This checks if an Android project is clean or has old build artifacts
*/

AndroidProject.prototype.isClean = function() {
var build_path = path.join(this.projectDir, 'build');
//If the build directory doesn't exist, it's clean
return !(fs.existsSync(build_path));
};

module.exports = AndroidProject;
45 changes: 29 additions & 16 deletions MOLPayXDKExample/platforms/android/cordova/lib/AndroidStudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@
* @param {String} root Root folder of the project
*/

/*jshint esversion: 6 */
/*jshint esnext: false */

var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;

function isAndroidStudioProject(root) {
module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
var androidStudioFiles = ['app', 'gradle', 'build', 'app/src/main/assets'];
var file;
for(file of eclipseFiles) {
if(fs.existsSync(path.join(root, file))) {
return false;
}
}
for(file of androidStudioFiles) {
if(!fs.existsSync(path.join(root, file))) {
return false;
}
var androidStudioFiles = ['app', 'gradle', 'app/src/main/res'];

// assume it is an AS project and not an Eclipse project
var isEclipse = false;
var isAS = true;

if(!fs.existsSync(root)) {
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
}
return true;
}

module.exports.isAndroidStudioProject = isAndroidStudioProject;
// if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function(file) {
if(fs.existsSync(path.join(root, file))) {
isEclipse = true;
}
});

// if it is NOT an eclipse project, check that all required files exist
if(!isEclipse) {
androidStudioFiles.forEach(function(file){
if(!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false;
}
});
}
return (!isEclipse && isAS);
};
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ GradleBuilder.prototype.prepEnv = function(opts) {
// For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/;
/*jshint -W069 */
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
/*jshint +W069 */
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
Expand Down
8 changes: 4 additions & 4 deletions MOLPayXDKExample/platforms/android/cordova/lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module.exports.prepare = function (cordovaProject, options) {
return updateProjectAccordingTo(self._config, self.locations);
})
.then(function () {
updateIcons(cordovaProject, self.locations.res);
updateSplashes(cordovaProject, self.locations.res);
updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
})
.then(function () {
events.emit('verbose', 'Prepared android project successfully');
Expand All @@ -70,8 +70,8 @@ module.exports.clean = function (options) {
var self = this;
return Q().then(function () {
cleanWww(projectRoot, self.locations);
cleanIcons(projectRoot, projectConfig, self.locations.res);
cleanSplashes(projectRoot, projectConfig, self.locations.res);
cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
});
};

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MOLPayXDKExample/platforms/android/cordova/version
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

// Coho updates this line:
var VERSION = "6.0.0";
var VERSION = "6.1.2";

module.exports.version = VERSION;

Expand Down
Loading

0 comments on commit 3c325c5

Please sign in to comment.