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