use of org.bitcoinj.crypto.LinuxSecureRandom in project bitcoin-wallet by bitcoin-wallet.
the class WalletApplication method onCreate.
@Override
public void onCreate() {
// init proper random number generator
new LinuxSecureRandom();
Logging.init(getFilesDir());
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads().permitDiskWrites().penaltyLog().build());
Threading.throwOnLockCycles();
org.bitcoinj.core.Context.enableStrictMode();
org.bitcoinj.core.Context.propagate(Constants.CONTEXT);
log.info("=== starting app using configuration: {}, {}", Constants.TEST ? "test" : "prod", Constants.NETWORK_PARAMETERS.getId());
super.onCreate();
CrashReporter.init(getCacheDir());
final PackageInfo packageInfo = packageInfo();
Threading.uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(final Thread thread, final Throwable throwable) {
log.info("bitcoinj uncaught exception", throwable);
CrashReporter.saveBackgroundTrace(throwable, packageInfo);
}
};
initMnemonicCode();
activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF);
loadWalletFromProtobuf();
final Configuration config = getConfiguration();
if (config.versionCodeCrossed(packageInfo.versionCode, VERSION_CODE_SHOW_BACKUP_REMINDER) && !wallet.getImportedKeys().isEmpty()) {
log.info("showing backup reminder once, because of imported keys being present");
config.armBackupReminder();
}
config.updateLastVersionCode(packageInfo.versionCode);
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter != null)
config.updateLastBluetoothAddress(Bluetooth.getAddress(bluetoothAdapter));
afterLoadWallet();
cleanupFiles();
initNotificationManager();
}
Aggregations