Fixed the SecureRandom so it only returns positive values

This commit is contained in:
Joe Bowser 2014-10-17 15:30:28 -07:00
parent 16343ffe70
commit 53dae45430

View File

@ -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;
}