mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Support accounts without pins in AEP restore flows.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user