You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/10/21 19:00:24 UTC
[1/8] android commit: Replacing Math.random() with something a little
more random.
Repository: cordova-android
Updated Branches:
refs/heads/4.0.x 7ad16e5b0 -> cc7d35220
refs/heads/master 53dae4543 -> ce5d9a2ee
Replacing Math.random() with something a little more random.
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/b37498d5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/b37498d5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/b37498d5
Branch: refs/heads/4.0.x
Commit: b37498d5f61faf37c5cbe7ca58f004ceacdffb0f
Parents: 9f41906
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Oct 14 10:11:09 2014 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue Oct 14 10:11:09 2014 -0700
----------------------------------------------------------------------
framework/src/org/apache/cordova/CordovaBridge.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b37498d5/framework/src/org/apache/cordova/CordovaBridge.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaBridge.java b/framework/src/org/apache/cordova/CordovaBridge.java
index 081127d..a6ebebb 100644
--- a/framework/src/org/apache/cordova/CordovaBridge.java
+++ b/framework/src/org/apache/cordova/CordovaBridge.java
@@ -18,6 +18,8 @@
*/
package org.apache.cordova;
+import java.security.SecureRandom;
+
import org.apache.cordova.PluginManager;
import org.json.JSONArray;
import org.json.JSONException;
@@ -107,7 +109,8 @@ public class CordovaBridge {
/** Called by cordova.js to initialize the bridge. */
int generateBridgeSecret() {
- expectedBridgeSecret = (int)(Math.random() * Integer.MAX_VALUE);
+ SecureRandom randGen = new SecureRandom();
+ expectedBridgeSecret = (int)(randGen.nextInt() * Integer.MAX_VALUE);
return expectedBridgeSecret;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[5/8] android commit: gradle: Allow absolute paths to keystore files
Posted by ag...@apache.org.
gradle: Allow absolute paths to keystore files
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/77c51d3a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/77c51d3a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/77c51d3a
Branch: refs/heads/master
Commit: 77c51d3ae7ddbd79afe30100600fa5e155bcbaa7
Parents: 53dae45
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:43:30 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 12:43:30 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/77c51d3a/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 2e4d5cb..974a19f 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -180,14 +180,21 @@ def ensureValueExists(filePath, props, key) {
def addSigningProps(propsFilePath, signingConfig) {
def propsFile = file(propsFilePath)
+ def props = new Properties()
propsFile.withReader { reader ->
- def props = new Properties()
props.load(reader)
- signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
- signingConfig.keyPassword = props.get('keyPassword')
- signingConfig.storeFile = RelativePath.parse(true, ensureValueExists(propsFilePath, props, 'storeFile')).getFile(propsFile.getParentFile())
- signingConfig.storePassword = props.get('storePassword')
}
+ def storeFile = new File(ensureValueExists(propsFilePath, props, 'storeFile'))
+ if (!storeFile.isAbsolute()) {
+ storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile())
+ }
+ if (!storeFile.exists()) {
+ throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath())
+ }
+ signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
+ signingConfig.keyPassword = props.get('keyPassword')
+ signingConfig.storeFile = storeFile
+ signingConfig.storePassword = props.get('storePassword')
}
if (file('build-extras.gradle').exists()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[4/8] android commit: gradle: Allow absolute paths to keystore files
Posted by ag...@apache.org.
gradle: Allow absolute paths to keystore files
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/77c51d3a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/77c51d3a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/77c51d3a
Branch: refs/heads/4.0.x
Commit: 77c51d3ae7ddbd79afe30100600fa5e155bcbaa7
Parents: 53dae45
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:43:30 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 12:43:30 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/77c51d3a/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 2e4d5cb..974a19f 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -180,14 +180,21 @@ def ensureValueExists(filePath, props, key) {
def addSigningProps(propsFilePath, signingConfig) {
def propsFile = file(propsFilePath)
+ def props = new Properties()
propsFile.withReader { reader ->
- def props = new Properties()
props.load(reader)
- signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
- signingConfig.keyPassword = props.get('keyPassword')
- signingConfig.storeFile = RelativePath.parse(true, ensureValueExists(propsFilePath, props, 'storeFile')).getFile(propsFile.getParentFile())
- signingConfig.storePassword = props.get('storePassword')
}
+ def storeFile = new File(ensureValueExists(propsFilePath, props, 'storeFile'))
+ if (!storeFile.isAbsolute()) {
+ storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile())
+ }
+ if (!storeFile.exists()) {
+ throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath())
+ }
+ signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
+ signingConfig.keyPassword = props.get('keyPassword')
+ signingConfig.storeFile = storeFile
+ signingConfig.storePassword = props.get('storePassword')
}
if (file('build-extras.gradle').exists()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/8] android commit: Undoing change to Math.random() for now,
this creates a weird bug
Posted by ag...@apache.org.
Undoing change to Math.random() for now, this creates a weird bug
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/16343ffe
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/16343ffe
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/16343ffe
Branch: refs/heads/4.0.x
Commit: 16343ffe7009dca68af77a53cebb90e76d6a9fe3
Parents: b37498d
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Oct 17 13:52:33 2014 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri Oct 17 13:52:33 2014 -0700
----------------------------------------------------------------------
framework/src/org/apache/cordova/CordovaBridge.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/16343ffe/framework/src/org/apache/cordova/CordovaBridge.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaBridge.java b/framework/src/org/apache/cordova/CordovaBridge.java
index a6ebebb..c007db3 100644
--- a/framework/src/org/apache/cordova/CordovaBridge.java
+++ b/framework/src/org/apache/cordova/CordovaBridge.java
@@ -109,8 +109,7 @@ public class CordovaBridge {
/** Called by cordova.js to initialize the bridge. */
int generateBridgeSecret() {
- SecureRandom randGen = new SecureRandom();
- expectedBridgeSecret = (int)(randGen.nextInt() * Integer.MAX_VALUE);
+ expectedBridgeSecret = (int)(Math.random() * Integer.MAX_VALUE);
return expectedBridgeSecret;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/8] android commit: Fixed the SecureRandom so it only returns
positive values
Posted by ag...@apache.org.
Fixed the SecureRandom so it only returns positive values
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/53dae454
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/53dae454
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/53dae454
Branch: refs/heads/4.0.x
Commit: 53dae454308d6a0d03c653f85b330d4678290fab
Parents: 16343ff
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Oct 17 15:30:28 2014 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri Oct 17 15:30:28 2014 -0700
----------------------------------------------------------------------
framework/src/org/apache/cordova/CordovaBridge.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/53dae454/framework/src/org/apache/cordova/CordovaBridge.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaBridge.java b/framework/src/org/apache/cordova/CordovaBridge.java
index c007db3..c3f10f3 100644
--- a/framework/src/org/apache/cordova/CordovaBridge.java
+++ b/framework/src/org/apache/cordova/CordovaBridge.java
@@ -109,7 +109,8 @@ public class CordovaBridge {
/** Called by cordova.js to initialize the bridge. */
int generateBridgeSecret() {
- expectedBridgeSecret = (int)(Math.random() * Integer.MAX_VALUE);
+ SecureRandom randGen = new SecureRandom();
+ expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE);
return expectedBridgeSecret;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[6/8] android commit: gradle: Allow storeType to be set (allows using
.p12 files)
Posted by ag...@apache.org.
gradle: Allow storeType to be set (allows using .p12 files)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/ce5d9a2e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/ce5d9a2e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/ce5d9a2e
Branch: refs/heads/master
Commit: ce5d9a2ee816ff6f774a0dbfe034be38dc9a0194
Parents: 77c51d3
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:59:34 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 12:59:34 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ce5d9a2e/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 974a19f..b62a258 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -195,6 +195,16 @@ def addSigningProps(propsFilePath, signingConfig) {
signingConfig.keyPassword = props.get('keyPassword')
signingConfig.storeFile = storeFile
signingConfig.storePassword = props.get('storePassword')
+ def storeType = props.get('storeType')
+ if (!storeType) {
+ def filename = storeFile.getName().toLowerCase();
+ if (filename.endsWith('.p12') || filename.endsWith('.pfx')) {
+ storeType = 'pkcs12'
+ }
+ }
+ if (storeType) {
+ signingConfig.storeType = storeType
+ }
}
if (file('build-extras.gradle').exists()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[7/8] android commit: gradle: Allow storeType to be set (allows using
.p12 files)
Posted by ag...@apache.org.
gradle: Allow storeType to be set (allows using .p12 files)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/ce5d9a2e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/ce5d9a2e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/ce5d9a2e
Branch: refs/heads/4.0.x
Commit: ce5d9a2ee816ff6f774a0dbfe034be38dc9a0194
Parents: 77c51d3
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:59:34 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 12:59:34 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ce5d9a2e/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 974a19f..b62a258 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -195,6 +195,16 @@ def addSigningProps(propsFilePath, signingConfig) {
signingConfig.keyPassword = props.get('keyPassword')
signingConfig.storeFile = storeFile
signingConfig.storePassword = props.get('storePassword')
+ def storeType = props.get('storeType')
+ if (!storeType) {
+ def filename = storeFile.getName().toLowerCase();
+ if (filename.endsWith('.p12') || filename.endsWith('.pfx')) {
+ storeType = 'pkcs12'
+ }
+ }
+ if (storeType) {
+ signingConfig.storeType = storeType
+ }
}
if (file('build-extras.gradle').exists()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[8/8] android commit: Merge branch 'master' into 4.0.x (gradle
signing+SecureRandom)
Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x (gradle signing+SecureRandom)
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/cc7d3522
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/cc7d3522
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/cc7d3522
Branch: refs/heads/4.0.x
Commit: cc7d352209e3f6d841fe631a510e6288cbe308b1
Parents: 7ad16e5 ce5d9a2
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 13:00:07 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 13:00:07 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 27 ++++++++++++++++----
.../src/org/apache/cordova/CordovaBridge.java | 5 +++-
2 files changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org