mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Prevent safety number changes during quick restore flow.
This commit is contained in:
@@ -337,6 +337,22 @@ class AccountValues internal constructor(store: KeyValueStore, context: Context)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only to be used as part of Quick Restore, DO NOT USE OTHERWISE.
|
||||
*/
|
||||
fun resetAciAndPniIdentityKeysAfterFailedRestore() {
|
||||
synchronized(this) {
|
||||
Log.i(TAG, "Resetting ACI and PNI identity keys after failed quick registration and restore")
|
||||
|
||||
store.beginWrite()
|
||||
.remove(KEY_ACI_IDENTITY_PUBLIC_KEY)
|
||||
.remove(KEY_ACI_IDENTITY_PRIVATE_KEY)
|
||||
.remove(KEY_PNI_IDENTITY_PUBLIC_KEY)
|
||||
.remove(KEY_PNI_IDENTITY_PRIVATE_KEY)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
|
||||
/** Only to be used when restoring an identity public key from an old backup */
|
||||
fun restoreLegacyIdentityPublicKeyFromBackup(base64: String) {
|
||||
Log.w(TAG, "Restoring legacy identity public key from backup.")
|
||||
|
||||
Reference in New Issue
Block a user