Reorganised Guice modules. Contribute entropy to pool on Linux/Android.

This commit is contained in:
akwizgran
2014-01-14 19:33:17 +00:00
parent 46863b8c1b
commit 8886d954d7
45 changed files with 327 additions and 178 deletions

View File

@@ -0,0 +1,23 @@
package org.briarproject.system;
import java.io.DataOutputStream;
import java.io.IOException;
import android.os.Build;
class AndroidSeedProvider extends LinuxSeedProvider {
@Override
void writeToEntropyPool(DataOutputStream out) throws IOException {
out.writeInt(android.os.Process.myPid());
out.writeInt(android.os.Process.myTid());
out.writeInt(android.os.Process.myUid());
String fingerprint = Build.FINGERPRINT;
if(fingerprint != null) out.writeUTF(fingerprint);
if(Build.VERSION.SDK_INT >= 9) {
String serial = Build.SERIAL;
if(serial != null) out.writeUTF(serial);
}
super.writeToEntropyPool(out);
}
}