accountManager = new TextSecureAccountManager(URL, TRUST_STORE, username, password, USER_AGENT);
}
- public void save() {
+ private void save() {
ObjectNode rootNode = jsonProcessot.createObjectNode();
rootNode.put("username", username)
.put("password", password)
axolotlStore = new JsonAxolotlStore(identityKey, registrationId);
groupStore = new JsonGroupStore();
registered = false;
+ save();
}
public boolean isRegistered() {
accountManager.requestSmsVerificationCode();
registered = false;
+ save();
}
private static final int BATCH_SIZE = 100;
}
preKeyIdOffset = (preKeyIdOffset + BATCH_SIZE + 1) % Medium.MAX_VALUE;
+ save();
+
return records;
}
PreKeyRecord record = new PreKeyRecord(Medium.MAX_VALUE, keyPair);
axolotlStore.storePreKey(Medium.MAX_VALUE, record);
+ save();
return record;
}
axolotlStore.storeSignedPreKey(nextSignedPreKeyId, record);
nextSignedPreKeyId = (nextSignedPreKeyId + 1) % Medium.MAX_VALUE;
+ save();
return record;
} catch (InvalidKeyException e) {
SignedPreKeyRecord signedPreKeyRecord = generateSignedPreKey(axolotlStore.getIdentityKeyPair());
accountManager.setPreKeys(axolotlStore.getIdentityKeyPair().getPublicKey(), lastResortKey, signedPreKeyRecord, oneTimePreKeys);
+ save();
}
} catch (InvalidNumberException e) {
System.err.println("Failed to add recipient \"" + recipient + "\": " + e.getMessage());
System.err.println("Aborting sending.");
+ save();
return;
}
}