Update dependencies

This commit is contained in:
AsamK 2017-01-07 17:07:56 +01:00
parent d83e0526fb
commit 6411b09aab
2 changed files with 11 additions and 9 deletions

View file

@ -18,7 +18,7 @@ repositories {
}
dependencies {
compile 'com.github.turasa:signal-service-java:2.4.2_unofficial_1'
compile 'com.github.turasa:signal-service-java:2.4.4_unofficial_1'
compile 'org.bouncycastle:bcprov-jdk15on:1.55'
compile 'net.sourceforge.argparse4j:argparse4j:0.7.0'
compile 'org.freedesktop.dbus:dbus-java:2.7.0'

View file

@ -53,6 +53,7 @@ import org.whispersystems.signalservice.api.push.exceptions.*;
import org.whispersystems.signalservice.api.util.InvalidNumberException;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
import org.whispersystems.signalservice.internal.push.SignalServiceUrl;
import java.io.*;
import java.net.URI;
@ -77,6 +78,7 @@ import static java.nio.file.attribute.PosixFilePermission.*;
class Manager implements Signal {
private final static String URL = "https://textsecure-service.whispersystems.org";
private final static TrustStore TRUST_STORE = new WhisperTrustStore();
private final static SignalServiceUrl[] serviceUrls = new SignalServiceUrl[]{new SignalServiceUrl(URL, TRUST_STORE)};
public final static String PROJECT_NAME = Manager.class.getPackage().getImplementationTitle();
public final static String PROJECT_VERSION = Manager.class.getPackage().getImplementationVersion();
@ -217,7 +219,7 @@ class Manager implements Signal {
migrateLegacyConfigs();
accountManager = new SignalServiceAccountManager(URL, TRUST_STORE, username, password, deviceId, USER_AGENT);
accountManager = new SignalServiceAccountManager(serviceUrls, username, password, deviceId, USER_AGENT);
try {
if (registered && accountManager.getPreKeysCount() < PREKEY_MINIMUM_COUNT) {
refreshPreKeys();
@ -342,7 +344,7 @@ class Manager implements Signal {
public void register(boolean voiceVerification) throws IOException {
password = Util.getSecret(18);
accountManager = new SignalServiceAccountManager(URL, TRUST_STORE, username, password, USER_AGENT);
accountManager = new SignalServiceAccountManager(serviceUrls, username, password, USER_AGENT);
if (voiceVerification)
accountManager.requestVoiceVerificationCode();
@ -356,7 +358,7 @@ class Manager implements Signal {
public URI getDeviceLinkUri() throws TimeoutException, IOException {
password = Util.getSecret(18);
accountManager = new SignalServiceAccountManager(URL, TRUST_STORE, username, password, USER_AGENT);
accountManager = new SignalServiceAccountManager(serviceUrls, username, password, USER_AGENT);
String uuid = accountManager.getNewDeviceUuid();
registered = false;
@ -783,7 +785,7 @@ class Manager implements Signal {
private void sendSyncMessage(SignalServiceSyncMessage message)
throws IOException, UntrustedIdentityException {
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(URL, TRUST_STORE, username, password,
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password,
deviceId, signalProtocolStore, USER_AGENT, Optional.<SignalServiceMessageSender.EventListener>absent());
try {
messageSender.sendMessage(message);
@ -800,7 +802,7 @@ class Manager implements Signal {
SignalServiceDataMessage message = null;
try {
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(URL, TRUST_STORE, username, password,
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password,
deviceId, signalProtocolStore, USER_AGENT, Optional.<SignalServiceMessageSender.EventListener>absent());
message = messageBuilder.build();
@ -1029,7 +1031,7 @@ class Manager implements Signal {
public void receiveMessages(long timeout, TimeUnit unit, boolean returnOnTimeout, boolean ignoreAttachments, ReceiveMessageHandler handler) throws IOException {
retryFailedReceivedMessages(handler, ignoreAttachments);
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(URL, TRUST_STORE, username, password, deviceId, signalingKey, USER_AGENT);
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, username, password, deviceId, signalingKey, USER_AGENT);
SignalServiceMessagePipe messagePipe = null;
try {
@ -1314,7 +1316,7 @@ class Manager implements Signal {
}
}
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(URL, TRUST_STORE, username, password, deviceId, signalingKey, USER_AGENT);
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, username, password, deviceId, signalingKey, USER_AGENT);
File tmpFile = Util.createTempFile();
try (InputStream input = messageReceiver.retrieveAttachment(pointer, tmpFile)) {
@ -1340,7 +1342,7 @@ class Manager implements Signal {
}
private InputStream retrieveAttachmentAsStream(SignalServiceAttachmentPointer pointer, File tmpFile) throws IOException, InvalidMessageException {
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(URL, TRUST_STORE, username, password, deviceId, signalingKey, USER_AGENT);
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, username, password, deviceId, signalingKey, USER_AGENT);
return messageReceiver.retrieveAttachment(pointer, tmpFile);
}