mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Fixed the SecureRandom so it only returns positive values
This commit is contained in:
parent
16343ffe70
commit
53dae45430
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user