return new RegistrationManager(account, pathConfig, serviceConfiguration, userAgent);
}
- var account = SignalAccount.load(pathConfig.getDataPath(), username);
+ var account = SignalAccount.load(pathConfig.getDataPath(), username, true);
return new RegistrationManager(account, pathConfig, serviceConfiguration, userAgent);
}
VerifyAccountResponse response;
MasterKey masterKey;
try {
- response = verifyAccountWithCode(verificationCode, pin, null);
+ response = verifyAccountWithCode(verificationCode, null, null);
masterKey = null;
+ pin = null;
} catch (LockedException e) {
if (pin == null) {
throw e;
var registrationLockData = pinHelper.getRegistrationLockData(pin, e);
if (registrationLockData == null) {
- throw e;
- }
-
- var registrationLock = registrationLockData.getMasterKey().deriveRegistrationLock();
- try {
- response = verifyAccountWithCode(verificationCode, null, registrationLock);
- } catch (LockedException _e) {
- throw new AssertionError("KBS Pin appeared to matched but reg lock still failed!");
+ response = verifyAccountWithCode(verificationCode, pin, null);
+ masterKey = null;
+ } else {
+ var registrationLock = registrationLockData.getMasterKey().deriveRegistrationLock();
+ try {
+ response = verifyAccountWithCode(verificationCode, null, registrationLock);
+ } catch (LockedException _e) {
+ throw new AssertionError("KBS Pin appeared to matched but reg lock still failed!");
+ }
+ masterKey = registrationLockData.getMasterKey();
}
- masterKey = registrationLockData.getMasterKey();
}
// TODO response.isStorageCapable()