}
}
try {
+ updateAccountAttributes();
context.getPreKeyHelper().refreshPreKeysIfNecessary();
if (account.getAci() == null || account.getPni() == null) {
checkWhoAmiI();
if (!account.isPrimaryDevice() && account.getPniIdentityKeyPair() == null) {
context.getSyncHelper().requestSyncPniIdentity();
}
- updateAccountAttributes();
+ if (account.getPreviousStorageVersion() < 4
+ && account.isPrimaryDevice()
+ && account.getRegistrationLockPin() != null) {
+ migrateRegistrationPin();
+ }
} catch (AuthorizationFailedException e) {
account.setRegistered(false);
throw e;
account.setMultiDevice(devices.size() > 1);
}
+ public void migrateRegistrationPin() throws IOException {
+ var masterKey = account.getOrCreatePinMasterKey();
+
+ context.getPinHelper().migrateRegistrationLockPin(account.getRegistrationLockPin(), masterKey);
+ }
+
public void setRegistrationPin(String pin) throws IOException {
var masterKey = account.getOrCreatePinMasterKey();