Update dependencies

This commit is contained in:
AsamK 2020-11-21 11:47:06 +01:00
parent 94a2da5bc1
commit b0502f9f82
4 changed files with 31 additions and 11 deletions

View file

@ -17,8 +17,8 @@ repositories {
} }
dependencies { dependencies {
implementation 'com.github.turasa:signal-service-java:2.15.3_unofficial_14' implementation 'com.github.turasa:signal-service-java:2.15.3_unofficial_15'
implementation 'org.bouncycastle:bcprov-jdk15on:1.66' implementation 'org.bouncycastle:bcprov-jdk15on:1.67'
implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1' implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1'
implementation 'com.github.hypfvieh:dbus-java:3.2.3' implementation 'com.github.hypfvieh:dbus-java:3.2.3'
implementation 'org.slf4j:slf4j-nop:1.7.30' implementation 'org.slf4j:slf4j-nop:1.7.30'

View file

@ -431,10 +431,9 @@ public class Manager implements Closeable {
private SignalServiceMessageSender getMessageSender() { private SignalServiceMessageSender getMessageSender() {
// TODO implement ZkGroup support // TODO implement ZkGroup support
final ClientZkProfileOperations clientZkProfileOperations = null; final ClientZkProfileOperations clientZkProfileOperations = null;
final boolean attachmentsV3 = false;
final ExecutorService executor = null; final ExecutorService executor = null;
return new SignalServiceMessageSender(serviceConfiguration, account.getUuid(), account.getUsername(), account.getPassword(), return new SignalServiceMessageSender(serviceConfiguration, account.getUuid(), account.getUsername(), account.getPassword(),
account.getDeviceId(), account.getSignalProtocolStore(), userAgent, account.isMultiDevice(), attachmentsV3, Optional.fromNullable(messagePipe), Optional.fromNullable(unidentifiedMessagePipe), Optional.absent(), clientZkProfileOperations, executor); account.getDeviceId(), account.getSignalProtocolStore(), userAgent, account.isMultiDevice(), Optional.fromNullable(messagePipe), Optional.fromNullable(unidentifiedMessagePipe), Optional.absent(), clientZkProfileOperations, executor, ServiceConfig.MAX_ENVELOPE_SIZE);
} }
private SignalServiceProfile getEncryptedRecipientProfile(SignalServiceAddress address, Optional<UnidentifiedAccess> unidentifiedAccess) throws IOException { private SignalServiceProfile getEncryptedRecipientProfile(SignalServiceAddress address, Optional<UnidentifiedAccess> unidentifiedAccess) throws IOException {
@ -1198,8 +1197,9 @@ public class Manager implements Closeable {
SignalServiceSyncMessage syncMessage = SignalServiceSyncMessage.forSentTranscript(transcript); SignalServiceSyncMessage syncMessage = SignalServiceSyncMessage.forSentTranscript(transcript);
try { try {
long startTime = System.currentTimeMillis();
messageSender.sendMessage(syncMessage, unidentifiedAccess); messageSender.sendMessage(syncMessage, unidentifiedAccess);
return SendMessageResult.success(recipient, unidentifiedAccess.isPresent(), false); return SendMessageResult.success(recipient, unidentifiedAccess.isPresent(), false, System.currentTimeMillis() - startTime);
} catch (UntrustedIdentityException e) { } catch (UntrustedIdentityException e) {
account.getSignalProtocolStore().saveIdentity(resolveSignalServiceAddress(e.getIdentifier()), e.getIdentityKey(), TrustLevel.UNTRUSTED); account.getSignalProtocolStore().saveIdentity(resolveSignalServiceAddress(e.getIdentifier()), e.getIdentityKey(), TrustLevel.UNTRUSTED);
return SendMessageResult.identityFailure(recipient, e.getIdentityKey()); return SendMessageResult.identityFailure(recipient, e.getIdentityKey());

View file

@ -1,7 +1,7 @@
package org.asamk.signal.manager; package org.asamk.signal.manager;
import org.whispersystems.libsignal.util.guava.Optional; import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile; import org.whispersystems.signalservice.api.account.AccountAttributes;
import org.whispersystems.signalservice.api.push.TrustStore; import org.whispersystems.signalservice.api.push.TrustStore;
import org.whispersystems.signalservice.internal.configuration.SignalCdnUrl; import org.whispersystems.signalservice.internal.configuration.SignalCdnUrl;
import org.whispersystems.signalservice.internal.configuration.SignalContactDiscoveryUrl; import org.whispersystems.signalservice.internal.configuration.SignalContactDiscoveryUrl;
@ -26,6 +26,7 @@ public class ServiceConfig {
final static int PREKEY_MINIMUM_COUNT = 20; final static int PREKEY_MINIMUM_COUNT = 20;
final static int PREKEY_BATCH_SIZE = 100; final static int PREKEY_BATCH_SIZE = 100;
final static int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024; final static int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
final static int MAX_ENVELOPE_SIZE = 0;
final static long AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE = 10 * 1024 * 1024; final static long AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE = 10 * 1024 * 1024;
private final static String URL = "https://textsecure-service.whispersystems.org"; private final static String URL = "https://textsecure-service.whispersystems.org";
@ -39,7 +40,7 @@ public class ServiceConfig {
private final static String zkGroupServerPublicParamsHex = "AMhf5ywVwITZMsff/eCyudZx9JDmkkkbV6PInzG4p8x3VqVJSFiMvnvlEKWuRob/1eaIetR31IYeAbm0NdOuHH8Qi+Rexi1wLlpzIo1gstHWBfZzy1+qHRV5A4TqPp15YzBPm0WSggW6PbSn+F4lf57VCnHF7p8SvzAA2ZZJPYJURt8X7bbg+H3i+PEjH9DXItNEqs2sNcug37xZQDLm7X0="; private final static String zkGroupServerPublicParamsHex = "AMhf5ywVwITZMsff/eCyudZx9JDmkkkbV6PInzG4p8x3VqVJSFiMvnvlEKWuRob/1eaIetR31IYeAbm0NdOuHH8Qi+Rexi1wLlpzIo1gstHWBfZzy1+qHRV5A4TqPp15YzBPm0WSggW6PbSn+F4lf57VCnHF7p8SvzAA2ZZJPYJURt8X7bbg+H3i+PEjH9DXItNEqs2sNcug37xZQDLm7X0=";
static final SignalServiceProfile.Capabilities capabilities = new SignalServiceProfile.Capabilities(false, false, false); static final AccountAttributes.Capabilities capabilities = new AccountAttributes.Capabilities(false, false, false, false);
public static SignalServiceConfiguration createDefaultServiceConfiguration(String userAgent) { public static SignalServiceConfiguration createDefaultServiceConfiguration(String userAgent) {
final Interceptor userAgentInterceptor = chain -> final Interceptor userAgentInterceptor = chain ->

View file

@ -1,5 +1,6 @@
package org.asamk.signal.storage.profiles; package org.asamk.signal.storage.profiles;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile; import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
@ -23,7 +24,7 @@ public class SignalProfile {
private final boolean unrestrictedUnidentifiedAccess; private final boolean unrestrictedUnidentifiedAccess;
@JsonProperty @JsonProperty
private final SignalServiceProfile.Capabilities capabilities; private final Capabilities capabilities;
public SignalProfile(final String identityKey, final String name, final File avatarFile, final String unidentifiedAccess, final boolean unrestrictedUnidentifiedAccess, final SignalServiceProfile.Capabilities capabilities) { public SignalProfile(final String identityKey, final String name, final File avatarFile, final String unidentifiedAccess, final boolean unrestrictedUnidentifiedAccess, final SignalServiceProfile.Capabilities capabilities) {
this.identityKey = identityKey; this.identityKey = identityKey;
@ -31,10 +32,13 @@ public class SignalProfile {
this.avatarFile = avatarFile; this.avatarFile = avatarFile;
this.unidentifiedAccess = unidentifiedAccess; this.unidentifiedAccess = unidentifiedAccess;
this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess; this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
this.capabilities = capabilities; this.capabilities = new Capabilities();
this.capabilities.storage = capabilities.isStorage();
this.capabilities.gv1Migration = capabilities.isGv1Migration();
this.capabilities.gv2 = capabilities.isGv2();
} }
public SignalProfile(@JsonProperty("identityKey") final String identityKey, @JsonProperty("name") final String name, @JsonProperty("unidentifiedAccess") final String unidentifiedAccess, @JsonProperty("unrestrictedUnidentifiedAccess") final boolean unrestrictedUnidentifiedAccess, @JsonProperty("capabilities") final SignalServiceProfile.Capabilities capabilities) { public SignalProfile(@JsonProperty("identityKey") final String identityKey, @JsonProperty("name") final String name, @JsonProperty("unidentifiedAccess") final String unidentifiedAccess, @JsonProperty("unrestrictedUnidentifiedAccess") final boolean unrestrictedUnidentifiedAccess, @JsonProperty("capabilities") final Capabilities capabilities) {
this.identityKey = identityKey; this.identityKey = identityKey;
this.name = name; this.name = name;
this.avatarFile = null; this.avatarFile = null;
@ -63,7 +67,7 @@ public class SignalProfile {
return unrestrictedUnidentifiedAccess; return unrestrictedUnidentifiedAccess;
} }
public SignalServiceProfile.Capabilities getCapabilities() { public Capabilities getCapabilities() {
return capabilities; return capabilities;
} }
@ -78,4 +82,19 @@ public class SignalProfile {
", capabilities=" + capabilities + ", capabilities=" + capabilities +
'}'; '}';
} }
public static class Capabilities {
@JsonIgnore
public boolean uuid;
@JsonProperty
public boolean gv2;
@JsonProperty
public boolean storage;
@JsonProperty
public boolean gv1Migration;
}
} }