mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Finished unit tests for SetupActivity and its Controller
This commit is contained in:
@@ -36,7 +36,7 @@ public class SetupActivity extends BaseActivity implements OnClickListener,
|
||||
OnEditorActionListener {
|
||||
|
||||
@Inject
|
||||
SetupController setupController;
|
||||
protected SetupController setupController;
|
||||
|
||||
TextInputLayout nicknameEntryWrapper;
|
||||
TextInputLayout passwordEntryWrapper;
|
||||
|
||||
@@ -84,15 +84,23 @@ public class SetupControllerImp implements SetupController {
|
||||
@Override
|
||||
public void createIdentity(final String nickname, final String password,
|
||||
final ResultHandler<Long> resultHandler) {
|
||||
LOG.info("createIdentity called");
|
||||
cryptoExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
LOG.info("createIdentity running");
|
||||
SecretKey key = crypto.generateSecretKey();
|
||||
LOG.info("createIdentity 1");
|
||||
databaseConfig.setEncryptionKey(key);
|
||||
LOG.info("createIdentity 2");
|
||||
String hex = encryptDatabaseKey(key, password);
|
||||
LOG.info("createIdentity 3");
|
||||
storeEncryptedDatabaseKey(hex);
|
||||
LOG.info("createIdentity 4");
|
||||
final LocalAuthor localAuthor = createLocalAuthor(nickname);
|
||||
LOG.info("createIdentity 5");
|
||||
long handle = referenceManager.putReference(localAuthor,
|
||||
LocalAuthor.class);
|
||||
LOG.info("createIdentity 6");
|
||||
resultHandler.onResult(handle);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,7 +34,10 @@ class AndroidSeedProvider extends LinuxSeedProvider {
|
||||
if (Build.FINGERPRINT != null) out.writeUTF(Build.FINGERPRINT);
|
||||
if (Build.SERIAL != null) out.writeUTF(Build.SERIAL);
|
||||
ContentResolver contentResolver = appContext.getContentResolver();
|
||||
out.writeUTF(Settings.Secure.getString(contentResolver, ANDROID_ID));
|
||||
super.writeToEntropyPool(out);
|
||||
String str = Settings.Secure.getString(contentResolver, ANDROID_ID);
|
||||
if (str != null) {
|
||||
out.writeUTF(str);
|
||||
super.writeToEntropyPool(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user