Support accounts without pins in AEP restore flows.

This commit is contained in:
Cody Henthorne
2025-04-25 11:26:29 -04:00
parent b298cb6f89
commit 87cbe305f0
23 changed files with 65 additions and 85 deletions

View File

@@ -161,6 +161,7 @@ class AccountValues internal constructor(store: KeyValueStore, context: Context)
}
}
@get:JvmName("restoredAccountEntropyPool")
@get:Synchronized
val restoredAccountEntropyPool by booleanValue(KEY_RESTORED_ACCOUNT_ENTROPY_KEY, false)

View File

@@ -128,13 +128,7 @@ class SvrValues internal constructor(store: KeyValueStore) : SignalStoreValues(s
@get:Synchronized
val recoveryPassword: String?
get() {
return if (hasOptedInWithAccess()) {
masterKeyForInitialDataRestore?.deriveRegistrationRecoveryPassword() ?: masterKey.deriveRegistrationRecoveryPassword()
} else {
null
}
}
get() = masterKeyForInitialDataRestore?.deriveRegistrationRecoveryPassword() ?: masterKey.deriveRegistrationRecoveryPassword()
@get:Synchronized
val pin: String? by stringValue(PIN, null)
@@ -142,11 +136,6 @@ class SvrValues internal constructor(store: KeyValueStore) : SignalStoreValues(s
@get:Synchronized
val localPinHash: String? by stringValue(LOCK_LOCAL_PIN_HASH, null)
@Synchronized
fun hasOptedInWithAccess(): Boolean {
return hasPin() || SignalStore.account.restoredAccountEntropyPool
}
@Synchronized
fun hasPin(): Boolean {
return localPinHash != null