mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Strongly type UUIDs as ACIs.
This commit is contained in:
@@ -36,13 +36,13 @@ import org.whispersystems.libsignal.util.KeyHelper;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.KbsPinData;
|
||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||
import org.whispersystems.signalservice.api.push.ACI;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
import org.whispersystems.signalservice.internal.ServiceResponse;
|
||||
import org.whispersystems.signalservice.internal.push.VerifyAccountResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.rxjava3.core.Single;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
@@ -128,14 +128,14 @@ public final class RegistrationRepository {
|
||||
SessionUtil.archiveAllSessions();
|
||||
SenderKeyUtil.clearAllState(context);
|
||||
|
||||
UUID uuid = UuidUtil.parseOrThrow(response.getUuid());
|
||||
ACI aci = ACI.parseOrThrow(response.getUuid());
|
||||
boolean hasPin = response.isStorageCapable();
|
||||
|
||||
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
|
||||
List<PreKeyRecord> records = PreKeyUtil.generatePreKeys(context);
|
||||
SignedPreKeyRecord signedPreKey = PreKeyUtil.generateSignedPreKey(context, identityKey, true);
|
||||
|
||||
SignalServiceAccountManager accountManager = AccountManagerFactory.createAuthenticated(context, uuid, registrationData.getE164(), registrationData.getPassword());
|
||||
SignalServiceAccountManager accountManager = AccountManagerFactory.createAuthenticated(context, aci, registrationData.getE164(), registrationData.getPassword());
|
||||
accountManager.setPreKeys(identityKey.getPublicKey(), signedPreKey, records);
|
||||
|
||||
if (registrationData.isFcm()) {
|
||||
@@ -143,13 +143,13 @@ public final class RegistrationRepository {
|
||||
}
|
||||
|
||||
RecipientDatabase recipientDatabase = DatabaseFactory.getRecipientDatabase(context);
|
||||
RecipientId selfId = Recipient.externalPush(context, uuid, registrationData.getE164(), true).getId();
|
||||
RecipientId selfId = Recipient.externalPush(context, aci, registrationData.getE164(), true).getId();
|
||||
|
||||
recipientDatabase.setProfileSharing(selfId, true);
|
||||
recipientDatabase.markRegisteredOrThrow(selfId, uuid);
|
||||
recipientDatabase.markRegisteredOrThrow(selfId, aci);
|
||||
|
||||
TextSecurePreferences.setLocalNumber(context, registrationData.getE164());
|
||||
TextSecurePreferences.setLocalUuid(context, uuid);
|
||||
TextSecurePreferences.setLocalAci(context, aci);
|
||||
recipientDatabase.setProfileKey(selfId, registrationData.getProfileKey());
|
||||
ApplicationDependencies.getRecipientCache().clearSelf();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user