Use server rereg flag to show post reg restore flows.

This commit is contained in:
Cody Henthorne
2025-08-07 16:11:28 -04:00
committed by Greyson Parrelli
parent f255160c4a
commit 27ddc97ea4
6 changed files with 15 additions and 7 deletions

View File

@@ -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)

View File

@@ -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
)

View File

@@ -444,7 +444,8 @@ object RegistrationRepository {
masterKey = masterKey,
pin = pin,
aciPreKeyCollection = aciPreKeyCollection,
pniPreKeyCollection = pniPreKeyCollection
pniPreKeyCollection = pniPreKeyCollection,
reRegistration = accountRegistrationResponse.reregistration
)
}

View File

@@ -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
)
)
}

View File

@@ -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
}

View File

@@ -16,6 +16,9 @@ public class VerifyAccountResponse {
@JsonProperty
public String number;
@JsonProperty
public boolean reregistration;
@JsonCreator
public VerifyAccountResponse() {}