Include local tor properties in backup and check for remote handshake public keys

This commit is contained in:
ameba23
2021-06-25 13:03:45 +02:00
parent ef05ecc342
commit f67d2f0157
9 changed files with 137 additions and 42 deletions

View File

@@ -52,9 +52,11 @@ public class RestoreAccountActivity extends BaseActivity
showInitialFragment(RestoreAccountSetPasswordFragment.newInstance());
} else if (state == State.DOZE) {
showDozeFragment();
} else if (state == State.CREATED || state == State.FAILED) {
// TODO: Show an error if failed
} else if (state == State.CREATED) {
showApp();
} else { // FAILED
// TODO: Show an error if failed
finish();
}
}

View File

@@ -114,16 +114,19 @@ class RestoreAccountViewModel extends AndroidViewModel {
if (socialBackup == null) {
LOG.warning("Cannot retrieve social backup");
state.postEvent(State.FAILED);
return;
}
Identity identity = socialBackup.getIdentity();
ioExecutor.execute(() -> {
if (accountManager.restoreAccount(identity, password)) {
LOG.info("Restored account");
try {
restoreAccount.addContactsToDb();
restoreAccount.restoreAccountWhenDatabaseReady();
} catch (DbException e) {
LOG.warning("Cannot retrieve social backup");
LOG.warning("Failure processing social backup");
e.printStackTrace();
state.postEvent(State.FAILED);
return;
}
// Remove partial recovery from shared preferences