Whilst there are instructions on the GitHub site of how to install signal-cli we have to use an older version of the software because the current verion of Raspian doesn’t use Java Runtime Environment 21, only 17. It's probably possibly to install JRE 21 but I've opted for this route.
Make install directory
cd ~ mkdir signal-cli cd signal-cli
Install Java
sudo apt-get install openjdk-17-jre
We are going to be using v0.12.8 if signal-cli which is the last version to use JRE17, see here.
Download and install signal-cli v0.12.8
export VERSION=0.12.8 wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/
Update libsignal
Now check which version of libsignal-client signal-cli is using:
sudo ls /opt/signal-cli-"${VERSION}"/lib/libsignal-client-*
Which gives us
/opt/signal-cli-0.12.8/lib/libsignal-client-0.36.1.jar
We can now go and get the jni file, I’m using a raspberry pi 3 which is AARM64 architecture, if you have an earlier version it will be armv7
Download and unzip
wget https://github.com/exquo/signal-libs-build/releases/download/libsignal_v0.36.1/libsignal_jni.so-v0.36.1-aarch64-unknown-linux-gnu.tar.gz tar xf libsignal_jni.so-v0.36.1-aarch64-unknown-linux-gnu.tar.gz
Or for armv7
wget https://github.com/exquo/signal-libs-build/releases/download/libsignal_v0.36.1/libsignal_jni.so-v0.36.1-armv7-unknown-linux-gnueabihf.tar.gz tar xf libsignal_jni.so-v0.36.1-armv7-unknown-linux-gnu.tar.gz
Now we can go ahead and replace the file
export VERSION_LIB_SIGNAL="0.36.1" sudo zip -d /opt/signal-cli-"${VERSION}"/lib/libsignal-client-"${VERSION_LIB_SIGNAL}".jar libsignal_jni.so sudo zip -uj /opt/signal-cli-"${VERSION}"/lib/libsignal-client-"${VERSION_LIB_SIGNAL}".jar libsignal_jni.so
We should now have a working signal-cli
You can go ahead and setup an account with your phone number (I’m using a fake number to demo it)
resignal-cli -a +441234567890 register
You make get a prompt to perform a CAPTCHA, if this is the case follow the link and complete it in a browser then right-click the “Open Signal” link and copy it to use in the command line to register
signal-cli - +441234567890 register --captcha signalcaptcha://signal-hcaptcha.XXXXXXXXXXX
Then you should then receive a verification text, use that to then verify your account:
Signal-cli -a +441234567890 verify 123456
We're ready to go
Note I can’t seem to send messages using the phone number of the user i’m trying to get to (i think it may be the privacy settings of that recipient), but I can using their username:
signal-cli -a +441234567890 send -m “Test Message” u:signaluser.999
You should probably should add a name to stop the nagging:
signal-cli -a +447965236128 receive
And finally to unregister you can use:
signal-cli -a +441234567890 unregister --delete-account