Update libsignal-service-java

This commit is contained in:
AsamK 2021-11-18 19:23:11 +01:00
parent 05ccfef93c
commit c9dffe47f6
8 changed files with 20 additions and 58 deletions

View file

@ -14,7 +14,7 @@ repositories {
}
dependencies {
implementation("com.github.turasa:signal-service-java:2.15.3_unofficial_33")
implementation("com.github.turasa:signal-service-java:2.15.3_unofficial_34")
api("com.fasterxml.jackson.core", "jackson-databind", "2.13.0")
implementation("com.google.protobuf:protobuf-javalite:3.11.4")
implementation("org.bouncycastle:bcprov-jdk15on:1.69")

View file

@ -1,6 +1,5 @@
package org.asamk.signal.manager.config;
import org.signal.zkgroup.internal.Native;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.account.AccountAttributes;
@ -31,21 +30,7 @@ public class ServiceConfig {
public static final AccountAttributes.Capabilities capabilities;
static {
boolean zkGroupAvailable;
try {
Native.serverPublicParamsCheckValidContentsJNI(new byte[]{});
zkGroupAvailable = true;
} catch (Throwable e) {
logger.warn("Failed to call libzkgroup: {}", e.getMessage());
zkGroupAvailable = false;
}
capabilities = new AccountAttributes.Capabilities(false,
zkGroupAvailable,
false,
zkGroupAvailable,
true,
true,
false);
capabilities = new AccountAttributes.Capabilities(false, true, false, true, true, true, false);
try {
TrustStore contactTrustStore = new IasTrustStore();
@ -60,10 +45,6 @@ public class ServiceConfig {
}
}
public static boolean isZkgroupAvailable() {
return ServiceConfig.getCapabilities().isGv2();
}
public static boolean isSignalClientAvailable() {
try {
org.signal.client.internal.Native.DeviceTransfer_GeneratePrivateKey();

View file

@ -1,11 +0,0 @@
package org.asamk.signal.manager.helper;
import org.signal.zkgroup.groups.GroupSecretParams;
import org.whispersystems.signalservice.api.groupsv2.GroupsV2AuthorizationString;
import java.io.IOException;
public interface GroupAuthorizationProvider {
GroupsV2AuthorizationString getAuthorizationForToday(GroupSecretParams groupSecretParams) throws IOException;
}

View file

@ -23,7 +23,6 @@ import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.push.exceptions.NotFoundException;
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
import org.whispersystems.signalservice.api.services.ProfileService;
import org.whispersystems.signalservice.internal.ServiceResponse;
import java.io.File;
import java.io.IOException;
@ -306,22 +305,10 @@ public final class ProfileHelper {
Optional<UnidentifiedAccess> unidentifiedAccess,
SignalServiceProfile.RequestType requestType
) {
var profileService = dependencies.getProfileService();
Single<ServiceResponse<ProfileAndCredential>> responseSingle;
final var profileService = dependencies.getProfileService();
final var locale = Utils.getDefaultLocale();
try {
responseSingle = profileService.getProfile(address, profileKey, unidentifiedAccess, requestType, locale);
} catch (NoClassDefFoundError e) {
// Native zkgroup lib not available for ProfileKey
responseSingle = profileService.getProfile(address,
Optional.absent(),
unidentifiedAccess,
requestType,
locale);
}
return responseSingle.map(pair -> {
return profileService.getProfile(address, profileKey, unidentifiedAccess, requestType, locale).map(pair -> {
var processor = new ProfileService.ProfileResponseProcessor(pair);
if (processor.hasResult()) {
return processor.getResult();