import java.io.Closeable;
import java.io.File;
import java.io.IOException;
+import java.util.Date;
import java.util.Locale;
public class RegistrationManager implements Closeable {
account.setRegistered(true);
account.setUuid(UuidUtil.parseOrNull(response.getUuid()));
account.setRegistrationLockPin(pin);
- account.getSignalProtocolStore().archiveAllSessions();
- account.getSignalProtocolStore()
- .saveIdentity(account.getSelfAddress(),
- account.getSignalProtocolStore().getIdentityKeyPair().getPublicKey(),
- TrustLevel.TRUSTED_VERIFIED);
+ account.getSessionStore().archiveAllSessions();
+ final var recipientId = account.getRecipientStore().resolveRecipient(account.getSelfAddress());
+ final var publicKey = account.getIdentityKeyPair().getPublicKey();
+ account.getIdentityKeyStore().saveIdentity(recipientId, publicKey, new Date());
+ account.getIdentityKeyStore().setIdentityTrustLevel(recipientId, publicKey, TrustLevel.TRUSTED_VERIFIED);
Manager m = null;
try {
) throws IOException {
return accountManager.verifyAccountWithCode(verificationCode,
null,
- account.getSignalProtocolStore().getLocalRegistrationId(),
+ account.getLocalRegistrationId(),
true,
legacyPin,
registrationLock,