private static byte[] generateSeed(){
  try {
    ByteArrayOutputStream seedBuffer=new ByteArrayOutputStream();
    DataOutputStream seedBufferOut=new DataOutputStream(seedBuffer);
    seedBufferOut.writeLong(System.currentTimeMillis());
    seedBufferOut.writeLong(System.nanoTime());
    seedBufferOut.write(BUILD_FINGERPRINT_AND_DEVICE_SERIAL);
    seedBufferOut.close();
    return seedBuffer.toByteArray();
  }
 catch (  IOException e) {
    throw new SecurityException("Failed to generate seed",e);
  }
}

private static byte [ ] generateSeed ( ) { try { ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream ( ) ; DataOutputStream seedBufferOut = new DataOutputStream ( seedBuffer ) ; seedBufferOut . writeLong ( System . currentTimeMillis ( ) ) ; seedBufferOut . writeLong ( System . nanoTime ( ) ) ; seedBufferOut . write ( BUILD_FINGERPRINT_AND_DEVICE_SERIAL ) ; seedBufferOut . close ( ) ; return seedBuffer . toByteArray ( ) ; } catch ( IOException e ) { throw new SecurityException ( "Failed to generate seed" , e ) ; } }
generates a device - and invocation - specific seed to be mixed into the linux prng .
