X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/7a06d3959ee425253afa67a3891ea8bf8ee6ab3c..942999b7b4beebf4519eed9b216587519b47e6c6:/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java diff --git a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java index 97c0adf2..bc543d8d 100644 --- a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java +++ b/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java @@ -31,6 +31,7 @@ import org.whispersystems.signalservice.api.SignalServiceAccountManager; import org.whispersystems.signalservice.api.groupsv2.ClientZkOperations; import org.whispersystems.signalservice.api.groupsv2.GroupsV2Operations; import org.whispersystems.signalservice.api.push.ACI; +import org.whispersystems.signalservice.api.push.PNI; import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.internal.ServiceResponse; import org.whispersystems.signalservice.internal.push.VerifyAccountResponse; @@ -79,7 +80,7 @@ class RegistrationManagerImpl implements RegistrationManager { this.accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.getSignalServiceConfiguration(), new DynamicCredentialsProvider( // Using empty UUID, because registering doesn't work otherwise - null, account.getNumber(), account.getPassword(), SignalServiceAddress.DEFAULT_DEVICE_ID), + null, null, account.getNumber(), account.getPassword(), SignalServiceAddress.DEFAULT_DEVICE_ID), userAgent, groupsV2Operations, ServiceConfig.AUTOMATIC_NETWORK_RETRY); @@ -116,7 +117,8 @@ class RegistrationManagerImpl implements RegistrationManager { //accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID))); final var aci = ACI.parseOrNull(response.getUuid()); - account.finishRegistration(aci, masterKey, pin); + final var pni = PNI.parseOrNull(response.getPni()); + account.finishRegistration(aci, pni, masterKey, pin); accountFileUpdater.updateAccountIdentifiers(account.getNumber(), aci); ManagerImpl m = null; @@ -153,8 +155,7 @@ class RegistrationManagerImpl implements RegistrationManager { userAgent, null, ServiceConfig.AUTOMATIC_NETWORK_RETRY); - accountManager.setAccountAttributes(account.getEncryptedDeviceName(), - null, + accountManager.setAccountAttributes(null, account.getLocalRegistrationId(), true, null, @@ -162,7 +163,8 @@ class RegistrationManagerImpl implements RegistrationManager { account.getSelfUnidentifiedAccessKey(), account.isUnrestrictedUnidentifiedAccess(), capabilities, - account.isDiscoverableByPhoneNumber()); + account.isDiscoverableByPhoneNumber(), + account.getEncryptedDeviceName()); account.setRegistered(true); logger.info("Reactivated existing account, verify is not necessary."); if (newManagerListener != null) {