Update libsignal-service-java
This commit is contained in:
parent
05ccfef93c
commit
c9dffe47f6
@ -22,9 +22,9 @@ a [FreeBSD port](https://www.freshports.org/net-im/signal-cli) available as well
|
|||||||
System requirements:
|
System requirements:
|
||||||
|
|
||||||
- at least Java Runtime Environment (JRE) 17
|
- at least Java Runtime Environment (JRE) 17
|
||||||
- native libraries: libzkgroup, libsignal-client
|
- native library: libsignal-client
|
||||||
|
|
||||||
Those are bundled for x86_64 Linux (with recent enough glibc, see #643), for other systems/architectures
|
The native lib is bundled for x86_64 Linux (with recent enough glibc, see #643), for other systems/architectures
|
||||||
see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
|
see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
|
||||||
|
|
||||||
### Install system-wide on Linux
|
### Install system-wide on Linux
|
||||||
|
@ -32,7 +32,11 @@
|
|||||||
,
|
,
|
||||||
{
|
{
|
||||||
"name":"java.util.UUID",
|
"name":"java.util.UUID",
|
||||||
"methods":[{"name":"<init>","parameterTypes":["long","long"] }]}
|
"methods":[
|
||||||
|
{"name":"<init>","parameterTypes":["long","long"] },
|
||||||
|
{"name":"getLeastSignificantBits","parameterTypes":[] },
|
||||||
|
{"name":"getMostSignificantBits","parameterTypes":[] }
|
||||||
|
]}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"}
|
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"}
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
{
|
{
|
||||||
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BD\\E"
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BD\\E"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BE\\E"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BM\\E"
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BM\\E"
|
||||||
},
|
},
|
||||||
@ -76,6 +79,9 @@
|
|||||||
{
|
{
|
||||||
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IT\\E"
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IT\\E"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JP\\E"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MO\\E"
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MO\\E"
|
||||||
},
|
},
|
||||||
@ -103,15 +109,15 @@
|
|||||||
{
|
{
|
||||||
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US\\E"
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US\\E"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_XK\\E"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pattern":"\\Qjni/x86_64-Linux/libjffi-1.2.so\\E"
|
"pattern":"\\Qjni/x86_64-Linux/libjffi-1.2.so\\E"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern":"\\Qlibsignal_jni.so\\E"
|
"pattern":"\\Qlibsignal_jni.so\\E"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"pattern":"\\Qlibzkgroup.so\\E"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"pattern":"\\Qorg/asamk/signal/manager/config/ias.store\\E"
|
"pattern":"\\Qorg/asamk/signal/manager/config/ias.store\\E"
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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")
|
api("com.fasterxml.jackson.core", "jackson-databind", "2.13.0")
|
||||||
implementation("com.google.protobuf:protobuf-javalite:3.11.4")
|
implementation("com.google.protobuf:protobuf-javalite:3.11.4")
|
||||||
implementation("org.bouncycastle:bcprov-jdk15on:1.69")
|
implementation("org.bouncycastle:bcprov-jdk15on:1.69")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.asamk.signal.manager.config;
|
package org.asamk.signal.manager.config;
|
||||||
|
|
||||||
import org.signal.zkgroup.internal.Native;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
||||||
@ -31,21 +30,7 @@ public class ServiceConfig {
|
|||||||
public static final AccountAttributes.Capabilities capabilities;
|
public static final AccountAttributes.Capabilities capabilities;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
boolean zkGroupAvailable;
|
capabilities = new AccountAttributes.Capabilities(false, true, false, true, true, true, false);
|
||||||
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);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TrustStore contactTrustStore = new IasTrustStore();
|
TrustStore contactTrustStore = new IasTrustStore();
|
||||||
@ -60,10 +45,6 @@ public class ServiceConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isZkgroupAvailable() {
|
|
||||||
return ServiceConfig.getCapabilities().isGv2();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isSignalClientAvailable() {
|
public static boolean isSignalClientAvailable() {
|
||||||
try {
|
try {
|
||||||
org.signal.client.internal.Native.DeviceTransfer_GeneratePrivateKey();
|
org.signal.client.internal.Native.DeviceTransfer_GeneratePrivateKey();
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -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.NotFoundException;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
|
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
|
||||||
import org.whispersystems.signalservice.api.services.ProfileService;
|
import org.whispersystems.signalservice.api.services.ProfileService;
|
||||||
import org.whispersystems.signalservice.internal.ServiceResponse;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -306,22 +305,10 @@ public final class ProfileHelper {
|
|||||||
Optional<UnidentifiedAccess> unidentifiedAccess,
|
Optional<UnidentifiedAccess> unidentifiedAccess,
|
||||||
SignalServiceProfile.RequestType requestType
|
SignalServiceProfile.RequestType requestType
|
||||||
) {
|
) {
|
||||||
var profileService = dependencies.getProfileService();
|
final var profileService = dependencies.getProfileService();
|
||||||
|
|
||||||
Single<ServiceResponse<ProfileAndCredential>> responseSingle;
|
|
||||||
final var locale = Utils.getDefaultLocale();
|
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);
|
var processor = new ProfileService.ProfileResponseProcessor(pair);
|
||||||
if (processor.hasResult()) {
|
if (processor.hasResult()) {
|
||||||
return processor.getResult();
|
return processor.getResult();
|
||||||
|
@ -142,11 +142,6 @@ public class App {
|
|||||||
dataPath = getDefaultDataPath();
|
dataPath = getDefaultDataPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ServiceConfig.isZkgroupAvailable()) {
|
|
||||||
logger.warn("WARNING: Support for new group V2 is disabled,"
|
|
||||||
+ " because the required native library dependency is missing: libzkgroup");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ServiceConfig.isSignalClientAvailable()) {
|
if (!ServiceConfig.isSignalClientAvailable()) {
|
||||||
throw new UserErrorException("Missing required native library dependency: libsignal-client");
|
throw new UserErrorException("Missing required native library dependency: libsignal-client");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user