Fix reglock setting incorrect during backup restore.

This commit is contained in:
Cody Henthorne
2025-09-10 12:57:25 -04:00
parent dd67398a70
commit ea772cbf55
4 changed files with 10 additions and 4 deletions

View File

@@ -299,7 +299,8 @@ object SvrRepository {
masterKey: MasterKey?,
userPin: String?,
hasPinToRestore: Boolean,
setRegistrationLockEnabled: Boolean
setRegistrationLockEnabled: Boolean,
restoredAEP: Boolean
) {
Log.i(TAG, "[onRegistrationComplete] Starting", true)
operationLock.withLock {
@@ -321,8 +322,12 @@ object SvrRepository {
AppDependencies.jobManager.add(ResetSvrGuessCountJob())
} else if (masterKey != null) {
Log.i(TAG, "[onRegistrationComplete] ReRegistered with key without pin")
Log.i(TAG, "[onRegistrationComplete] ReRegistered with key without pin", true)
SignalStore.svr.masterKeyForInitialDataRestore = masterKey
if (restoredAEP && setRegistrationLockEnabled) {
Log.i(TAG, "[onRegistrationComplete] Registration Lock", true)
SignalStore.svr.isRegistrationLockEnabled = true
}
} else if (hasPinToRestore) {
Log.i(TAG, "[onRegistrationComplete] Has a PIN to restore.", true)
SignalStore.svr.clearRegistrationLockAndPin()