X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/a20bbe12461910d0b04e216f15181f911e4b2032..292ef0f2dad4188bc6f42725af9360c3d030b92a:/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java b/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java index 0f28647f..90bbbdc4 100644 --- a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java +++ b/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java @@ -18,9 +18,9 @@ import org.whispersystems.signalservice.api.groupsv2.GroupsV2Api; import org.whispersystems.signalservice.api.groupsv2.GroupsV2Operations; import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.services.ProfileService; +import org.whispersystems.signalservice.api.util.CredentialsProvider; import org.whispersystems.signalservice.api.util.UptimeSleepTimer; import org.whispersystems.signalservice.api.websocket.WebSocketFactory; -import org.whispersystems.signalservice.internal.util.DynamicCredentialsProvider; import org.whispersystems.signalservice.internal.websocket.WebSocketConnection; import java.util.concurrent.ExecutorService; @@ -34,7 +34,7 @@ public class SignalDependencies { private final ServiceEnvironmentConfig serviceEnvironmentConfig; private final String userAgent; - private final DynamicCredentialsProvider credentialsProvider; + private final CredentialsProvider credentialsProvider; private final SignalServiceDataStore dataStore; private final ExecutorService executor; private final SignalSessionLock sessionLock; @@ -52,10 +52,10 @@ public class SignalDependencies { private ProfileService profileService; private SignalServiceCipher cipher; - public SignalDependencies( + SignalDependencies( final ServiceEnvironmentConfig serviceEnvironmentConfig, final String userAgent, - final DynamicCredentialsProvider credentialsProvider, + final CredentialsProvider credentialsProvider, final SignalServiceDataStore dataStore, final ExecutorService executor, final SignalSessionLock sessionLock @@ -68,6 +68,10 @@ public class SignalDependencies { this.sessionLock = sessionLock; } + public ServiceEnvironmentConfig getServiceEnvironmentConfig() { + return serviceEnvironmentConfig; + } + public SignalServiceAccountManager getAccountManager() { return getOrCreate(() -> accountManager, () -> accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.getSignalServiceConfiguration(), @@ -171,7 +175,8 @@ public class SignalDependencies { return getOrCreate(() -> cipher, () -> { final var certificateValidator = new CertificateValidator(serviceEnvironmentConfig.getUnidentifiedSenderTrustRoot()); final var address = new SignalServiceAddress(credentialsProvider.getAci(), credentialsProvider.getE164()); - cipher = new SignalServiceCipher(address, dataStore, sessionLock, certificateValidator); + final var deviceId = credentialsProvider.getDeviceId(); + cipher = new SignalServiceCipher(address, deviceId, dataStore, sessionLock, certificateValidator); }); }