]> nmode's Git Repositories - signal-cli/commitdiff
Add more information for libsignal-client native dependency
authorAsamK <asamk@gmx.de>
Sun, 14 Feb 2021 09:40:35 +0000 (10:40 +0100)
committerAsamK <asamk@gmx.de>
Sun, 14 Feb 2021 09:40:35 +0000 (10:40 +0100)
README.md
lib/src/main/java/org/asamk/signal/manager/config/ServiceConfig.java
src/main/java/org/asamk/signal/App.java

index 1b797b7ccdda520961a43c75d8b14b7da8d29ccb..a3900649a6b41da09e979eba0897b2dec08479de 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,7 +7,12 @@ signal-cli is primarily intended to be used on servers to notify admins of impor
 
 ## Installation
 
-You can [build signal-cli](#building) yourself, or use the [provided binary files](https://github.com/AsamK/signal-cli/releases/latest), which should work on Linux, macOS and Windows. For Arch Linux there is also a [package in AUR](https://aur.archlinux.org/packages/signal-cli/) and there is a [FreeBSD port](https://www.freshports.org/net-im/signal-cli) available as well. You need to have at least JRE 11 installed, to run signal-cli.
+You can [build signal-cli](#building) yourself, or use the [provided binary files](https://github.com/AsamK/signal-cli/releases/latest), which should work on Linux, macOS and Windows. For Arch Linux there is also a [package in AUR](https://aur.archlinux.org/packages/signal-cli/) and there is a [FreeBSD port](https://www.freshports.org/net-im/signal-cli) available as well.
+
+System requirements:
+- at least Java Runtime Environment (JRE) 11
+- native libraries: libzkgroup, libsignal-client
+  Those are bundled for x86_64 Linux, for other systems/architectures see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
 
 ### Install system-wide on Linux
 See [latest version](https://github.com/AsamK/signal-cli/releases).
index 7a54edd1fee83187986e933348251cc956142c0f..0b83f53e753edd8493153f83959983b22cb15473 100644 (file)
@@ -49,6 +49,15 @@ public class ServiceConfig {
         }
     }
 
+    public static boolean isSignalClientAvailable() {
+        try {
+            org.signal.client.internal.Native.DisplayableFingerprint_Format(new byte[30], new byte[30]);
+            return true;
+        } catch (UnsatisfiedLinkError ignored) {
+            return false;
+        }
+    }
+
     public static AccountAttributes.Capabilities getCapabilities() {
         return capabilities;
     }
index e35285c3da624a4a9e4f8169b0ca370540848141..90efc20f62fad2bc6548ff222652d52ccef49697 100644 (file)
@@ -121,6 +121,11 @@ public class App {
                     + " because the required native library dependency is missing: libzkgroup");
         }
 
+        if (!ServiceConfig.isSignalClientAvailable()) {
+            logger.error("Missing required native library dependency: libsignal-client");
+            return 1;
+        }
+
         if (command instanceof ProvisioningCommand) {
             if (username != null) {
                 System.err.println("You cannot specify a username (phone number) when linking");