Merge branch 'master' into 4.0.x (gradle signing+SecureRandom)

This commit is contained in:
Andrew Grieve
2014-10-21 13:00:07 -04:00
2 changed files with 26 additions and 6 deletions
@@ -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 = randGen.nextInt(Integer.MAX_VALUE);
return expectedBridgeSecret;
}