mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Use server rereg flag to show post reg restore flows.
This commit is contained in:
committed by
Greyson Parrelli
parent
f255160c4a
commit
27ddc97ea4
@@ -113,7 +113,8 @@ class SignalActivityRule(private val othersCount: Int = 4, private val createGro
|
||||
masterKey = null,
|
||||
pin = null,
|
||||
aciPreKeyCollection = RegistrationRepository.generateSignedAndLastResortPreKeys(SignalStore.account.aciIdentityKey, SignalStore.account.aciPreKeys),
|
||||
pniPreKeyCollection = RegistrationRepository.generateSignedAndLastResortPreKeys(SignalStore.account.aciIdentityKey, SignalStore.account.pniPreKeys)
|
||||
pniPreKeyCollection = RegistrationRepository.generateSignedAndLastResortPreKeys(SignalStore.account.aciIdentityKey, SignalStore.account.pniPreKeys),
|
||||
reRegistration = false
|
||||
)
|
||||
val localRegistrationData = LocalRegistrationMetadataUtil.createLocalRegistrationMetadata(SignalStore.account.aciIdentityKey, SignalStore.account.pniIdentityKey, registrationData, remoteResult, false)
|
||||
RegistrationRepository.registerAccountLocally(application, localRegistrationData)
|
||||
|
||||
@@ -16,5 +16,6 @@ data class AccountRegistrationResult(
|
||||
val masterKey: MasterKey?,
|
||||
val pin: String?,
|
||||
val aciPreKeyCollection: PreKeyCollection,
|
||||
val pniPreKeyCollection: PreKeyCollection
|
||||
val pniPreKeyCollection: PreKeyCollection,
|
||||
val reRegistration: Boolean
|
||||
)
|
||||
|
||||
@@ -444,7 +444,8 @@ object RegistrationRepository {
|
||||
masterKey = masterKey,
|
||||
pin = pin,
|
||||
aciPreKeyCollection = aciPreKeyCollection,
|
||||
pniPreKeyCollection = pniPreKeyCollection
|
||||
pniPreKeyCollection = pniPreKeyCollection,
|
||||
reRegistration = accountRegistrationResponse.reregistration
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -479,7 +479,8 @@ object RegistrationRepository {
|
||||
masterKey = masterKey,
|
||||
pin = pin,
|
||||
aciPreKeyCollection = aciPreKeyCollection,
|
||||
pniPreKeyCollection = pniPreKeyCollection
|
||||
pniPreKeyCollection = pniPreKeyCollection,
|
||||
reRegistration = accountRegistrationResponse.reregistration
|
||||
)
|
||||
}
|
||||
|
||||
@@ -536,7 +537,8 @@ object RegistrationRepository {
|
||||
masterKey = MasterKey(message.masterKey!!.toByteArray()),
|
||||
pin = null,
|
||||
aciPreKeyCollection = aciPreKeys,
|
||||
pniPreKeyCollection = pniPreKeys
|
||||
pniPreKeyCollection = pniPreKeys,
|
||||
reRegistration = true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -909,8 +909,8 @@ class RegistrationViewModel : ViewModel() {
|
||||
Log.w(TAG, "Unable to start auth websocket", e)
|
||||
}
|
||||
|
||||
if (!remoteResult.storageCapable && !SignalStore.account.restoredAccountEntropyPool && SignalStore.registration.restoreDecisionState.isDecisionPending) {
|
||||
Log.v(TAG, "Not storage capable or restored with AEP, and still pending restore decision, likely an account with no data to restore, skipping post register restore")
|
||||
if (!remoteResult.reRegistration && SignalStore.registration.restoreDecisionState.isDecisionPending) {
|
||||
Log.v(TAG, "Not re-registration, and still pending restore decision, likely an account with no data to restore, skipping post register restore")
|
||||
SignalStore.registration.restoreDecisionState = RestoreDecisionState.NewAccount
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ public class VerifyAccountResponse {
|
||||
@JsonProperty
|
||||
public String number;
|
||||
|
||||
@JsonProperty
|
||||
public boolean reregistration;
|
||||
|
||||
@JsonCreator
|
||||
public VerifyAccountResponse() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user