Log error message if libzkgroup or libsignal-client is missing

Fixes #660
This commit is contained in:
AsamK 2021-09-08 20:10:07 +02:00
parent 537b704951
commit e3c37a0239

View file

@ -1,6 +1,8 @@
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;
import org.whispersystems.signalservice.api.push.TrustStore;
@ -15,6 +17,8 @@ import okhttp3.Interceptor;
public class ServiceConfig {
private final static Logger logger = LoggerFactory.getLogger(ServiceConfig.class);
public final static int PREKEY_MINIMUM_COUNT = 20;
public final static int PREKEY_BATCH_SIZE = 100;
public final static int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
@ -31,7 +35,8 @@ public class ServiceConfig {
try {
Native.serverPublicParamsCheckValidContentsJNI(new byte[]{});
zkGroupAvailable = true;
} catch (Throwable ignored) {
} catch (Throwable e) {
logger.warn("Failed to call libzkgroup: {}", e.getMessage());
zkGroupAvailable = false;
}
capabilities = new AccountAttributes.Capabilities(false, zkGroupAvailable, false, zkGroupAvailable, true, true);
@ -53,7 +58,8 @@ public class ServiceConfig {
try {
org.signal.client.internal.Native.DeviceTransfer_GeneratePrivateKey();
return true;
} catch (UnsatisfiedLinkError ignored) {
} catch (UnsatisfiedLinkError e) {
logger.warn("Failed to call libsignal-client: {}", e.getMessage());
return false;
}
}