mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Reset backup id on zk verification failure during restore attempts.
This commit is contained in:
committed by
Alex Hart
parent
6e8f982e7b
commit
a5cca5b0fd
@@ -165,6 +165,7 @@ class AccountValues internal constructor(store: KeyValueStore, context: Context)
|
||||
|
||||
fun restoreAccountEntropyPool(aep: AccountEntropyPool) {
|
||||
AEP_LOCK.withLock {
|
||||
Log.i(TAG, "Restoring AEP from registration source", Throwable())
|
||||
store
|
||||
.beginWrite()
|
||||
.putString(KEY_ACCOUNT_ENTROPY_POOL, aep.value)
|
||||
|
||||
@@ -92,6 +92,8 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
|
||||
private const val KEY_NEXT_BACKUP_SECRET_DATA = "backup.next_backup_secret_data"
|
||||
|
||||
private const val KEY_RESTORING_VIA_QR = "backup.restore_via_qr"
|
||||
|
||||
private val cachedCdnCredentialsExpiresIn: Duration = 12.hours
|
||||
|
||||
private val lock = ReentrantLock()
|
||||
@@ -387,6 +389,9 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
/** The value from the last successful SVRB operation that must be passed to the next SVRB operation. */
|
||||
var nextBackupSecretData by nullableBlobValue(KEY_NEXT_BACKUP_SECRET_DATA, null)
|
||||
|
||||
/** True if attempting to restore backup from quick restore/QR code */
|
||||
var restoringViaQr by booleanValue(KEY_RESTORING_VIA_QR, false)
|
||||
|
||||
/**
|
||||
* If true, it means we have been told that remote storage is full, but we have not yet run any of our "garbage collection" tasks, like committing deletes
|
||||
* or pruning orphaned media.
|
||||
|
||||
@@ -37,7 +37,7 @@ val RestoreDecisionState.includeDeviceToDeviceTransfer: Boolean
|
||||
RestoreDecisionState.State.INTEND_TO_RESTORE -> {
|
||||
this.intendToRestoreData?.hasOldDevice == true
|
||||
}
|
||||
else -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
/** Has a final decision been made regarding restoring. */
|
||||
|
||||
Reference in New Issue
Block a user