mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-28 18:10:38 +00:00
Rename to signal-cli
Changes experimental dbus interface from org.asamk.TextSecure to org.asamk.Signal
This commit is contained in:
parent
10719a443a
commit
eabd361405
27 changed files with 108 additions and 108 deletions
46
README.md
46
README.md
|
@ -1,72 +1,72 @@
|
||||||
# textsecure-cli
|
# signal-cli
|
||||||
|
|
||||||
textsecure-cli is a commandline interface for [libtextsecure-java](https://github.com/WhisperSystems/libtextsecure-java). It supports registering, verifying, sending and receiving messages. To be able to receiving messages textsecure-cli uses a [patched libtextsecure-java](https://github.com/AsamK/libtextsecure-java), because libtextsecure-java [does not yet support registering for the websocket support](https://github.com/WhisperSystems/libtextsecure-java/pull/5). For registering you need a phone number where you can receive SMS or incoming calls.
|
signal-cli is a commandline interface for [libtextsecure-java](https://github.com/WhisperSystems/libtextsecure-java). It supports registering, verifying, sending and receiving messages. To be able to receiving messages signal-cli uses a [patched libtextsecure-java](https://github.com/AsamK/libtextsecure-java), because libtextsecure-java [does not yet support registering for the websocket support](https://github.com/WhisperSystems/libtextsecure-java/pull/5). For registering you need a phone number where you can receive SMS or incoming calls.
|
||||||
It is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a dbus interface, that can be used to send messages from any programming language that has dbus bindings.
|
It is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a dbus interface, that can be used to send messages from any programming language that has dbus bindings.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
usage: textsecure-cli [-h] [-u USERNAME] [-v] {register,verify,send,quitGroup,updateGroup,receive} ...
|
usage: signal-cli [-h] [-u USERNAME] [-v] {register,verify,send,quitGroup,updateGroup,receive} ...
|
||||||
|
|
||||||
* Register a number (with SMS verification)
|
* Register a number (with SMS verification)
|
||||||
|
|
||||||
textsecure-cli -u USERNAME register
|
signal-cli -u USERNAME register
|
||||||
|
|
||||||
* Register a number (with voice verification)
|
* Register a number (with voice verification)
|
||||||
|
|
||||||
textsecure-cli -u USERNAME register -v
|
signal-cli -u USERNAME register -v
|
||||||
|
|
||||||
* Verify the number using the code received via SMS or voice
|
* Verify the number using the code received via SMS or voice
|
||||||
|
|
||||||
textsecure-cli -u USERNAME verify CODE
|
signal-cli -u USERNAME verify CODE
|
||||||
|
|
||||||
* Send a message to one or more recipients
|
* Send a message to one or more recipients
|
||||||
|
|
||||||
textsecure-cli -u USERNAME send -m "This is a message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
|
signal-cli -u USERNAME send -m "This is a message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
|
||||||
|
|
||||||
* Pipe the message content from another process.
|
* Pipe the message content from another process.
|
||||||
|
|
||||||
uname -a | textsecure-cli -u USERNAME send [RECIPIENT [RECIPIENT ...]]
|
uname -a | signal-cli -u USERNAME send [RECIPIENT [RECIPIENT ...]]
|
||||||
|
|
||||||
* Groups
|
* Groups
|
||||||
|
|
||||||
* Create a group
|
* Create a group
|
||||||
|
|
||||||
textsecure-cli -u USERNAME updateGroup -n "Group name" -m [MEMBER [MEMBER ...]]
|
signal-cli -u USERNAME updateGroup -n "Group name" -m [MEMBER [MEMBER ...]]
|
||||||
|
|
||||||
* Update a group
|
* Update a group
|
||||||
|
|
||||||
textsecure-cli -u USERNAME updateGroup -g GROUP_ID -n "New group name"
|
signal-cli -u USERNAME updateGroup -g GROUP_ID -n "New group name"
|
||||||
|
|
||||||
* Send a message to a group
|
* Send a message to a group
|
||||||
|
|
||||||
textsecure-cli -u USERNAME send -m "This is a message" -g GROUP_ID
|
signal-cli -u USERNAME send -m "This is a message" -g GROUP_ID
|
||||||
|
|
||||||
## DBus service
|
## DBus service
|
||||||
|
|
||||||
textsecure-cli can run in daemon mode and provides an experimental dbus interface.
|
signal-cli can run in daemon mode and provides an experimental dbus interface.
|
||||||
For dbus support you need jni/unix-java.so installed on your system (Debian: libunixsocket-java ArchLinux: libmatthew-unix-java (AUR)).
|
For dbus support you need jni/unix-java.so installed on your system (Debian: libunixsocket-java ArchLinux: libmatthew-unix-java (AUR)).
|
||||||
|
|
||||||
* Run in daemon mode (dbus session bus)
|
* Run in daemon mode (dbus session bus)
|
||||||
|
|
||||||
textsecure-cli -u USERNAME daemon
|
signal-cli -u USERNAME daemon
|
||||||
|
|
||||||
* Send a message via dbus
|
* Send a message via dbus
|
||||||
|
|
||||||
textsecure-cli --dbus send -m "Message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
|
signal-cli --dbus send -m "Message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
|
||||||
|
|
||||||
### System bus
|
### System bus
|
||||||
|
|
||||||
To run on the system bus you need to take some additional steps.
|
To run on the system bus you need to take some additional steps.
|
||||||
It’s advisable to run textsecure-cli as a separate unix user, the following steps assume you created a user named *textsecure-cli*.
|
It’s advisable to run signal-cli as a separate unix user, the following steps assume you created a user named *signal-cli*.
|
||||||
These steps, executed as root, should work on all distributions using systemd.
|
These steps, executed as root, should work on all distributions using systemd.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp data/org.asamk.TextSecure.conf /etc/dbus-1/system.d/
|
cp data/org.asamk.Signal.conf /etc/dbus-1/system.d/
|
||||||
cp data/org.asamk.TextSecure.service /usr/share/dbus-1/system-services/
|
cp data/org.asamk.Signal.service /usr/share/dbus-1/system-services/
|
||||||
cp data/textsecure.service /etc/systemd/system/
|
cp data/signal.service /etc/systemd/system/
|
||||||
sed -i -e "s|%dir%|<INSERT_INSTALL_PATH>|" -e "s|%number%|<INSERT_YOUR_NUMBER>|" /etc/systemd/system/textsecure.service
|
sed -i -e "s|%dir%|<INSERT_INSTALL_PATH>|" -e "s|%number%|<INSERT_YOUR_NUMBER>|" /etc/systemd/system/signal.service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable textsecure.service
|
systemctl enable signal.service
|
||||||
systemctl reload dbus.service
|
systemctl reload dbus.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ Then just execute the send command from above, the service will be autostarted b
|
||||||
|
|
||||||
The password and cryptographic keys are created when registering and stored in the current users home directory:
|
The password and cryptographic keys are created when registering and stored in the current users home directory:
|
||||||
|
|
||||||
$HOME/.config/textsecure/data/
|
$HOME/.config/signal/data/
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
@ -85,13 +85,13 @@ dependencies.
|
||||||
|
|
||||||
1. Checkout the source somewhere on your filesystem with
|
1. Checkout the source somewhere on your filesystem with
|
||||||
|
|
||||||
git clone https://github.com/AsamK/textsecure-cli.git
|
git clone https://github.com/AsamK/signal-cli.git
|
||||||
|
|
||||||
2. Execute Gradle:
|
2. Execute Gradle:
|
||||||
|
|
||||||
./gradlew build
|
./gradlew build
|
||||||
|
|
||||||
3. Create shell wrapper in *build/install/textsecure-cli/bin*:
|
3. Create shell wrapper in *build/install/signal-cli/bin*:
|
||||||
|
|
||||||
./gradlew installDist
|
./gradlew installDist
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ apply plugin: 'application'
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||||
targetCompatibility = JavaVersion.VERSION_1_7
|
targetCompatibility = JavaVersion.VERSION_1_7
|
||||||
|
|
||||||
mainClassName = 'org.asamk.textsecure.Main'
|
mainClassName = 'org.asamk.signal.Main'
|
||||||
|
|
||||||
version = '0.2.1'
|
version = '0.2.1'
|
||||||
|
|
||||||
|
|
16
data/org.asamk.Signal.conf
Normal file
16
data/org.asamk.Signal.conf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0"?> <!--*-nxml-*-->
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
|
||||||
|
<busconfig>
|
||||||
|
<policy user="signal-cli">
|
||||||
|
<allow own="org.asamk.Signal"/>
|
||||||
|
<allow send_destination="org.asamk.Signal"/>
|
||||||
|
<allow receive_sender="org.asamk.Signal"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
<policy context="default">
|
||||||
|
<allow send_destination="org.asamk.Signal"/>
|
||||||
|
<allow receive_sender="org.asamk.Signal"/>
|
||||||
|
</policy>
|
||||||
|
</busconfig>
|
4
data/org.asamk.Signal.service
Normal file
4
data/org.asamk.Signal.service
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[D-BUS Service]
|
||||||
|
Name=org.asamk.Signal
|
||||||
|
Exec=/bin/false
|
||||||
|
SystemdService=dbus-org.asamk.Signal.service
|
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0"?> <!--*-nxml-*-->
|
|
||||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
|
||||||
|
|
||||||
<busconfig>
|
|
||||||
<policy user="textsecure-cli">
|
|
||||||
<allow own="org.asamk.TextSecure"/>
|
|
||||||
<allow send_destination="org.asamk.TextSecure"/>
|
|
||||||
<allow receive_sender="org.asamk.TextSecure"/>
|
|
||||||
</policy>
|
|
||||||
|
|
||||||
<policy context="default">
|
|
||||||
<allow send_destination="org.asamk.TextSecure"/>
|
|
||||||
<allow receive_sender="org.asamk.TextSecure"/>
|
|
||||||
</policy>
|
|
||||||
</busconfig>
|
|
|
@ -1,4 +0,0 @@
|
||||||
[D-BUS Service]
|
|
||||||
Name=org.asamk.TextSecure
|
|
||||||
Exec=/bin/false
|
|
||||||
SystemdService=dbus-org.asamk.TextSecure.service
|
|
16
data/signal-cli@.service
Normal file
16
data/signal-cli@.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Send secure messages to Signal clients
|
||||||
|
Requires=dbus.socket
|
||||||
|
After=dbus.socket
|
||||||
|
Wants=network.target
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=dbus
|
||||||
|
Environment=SIGNAL_CLI_OPTS="-Xms2m"
|
||||||
|
ExecStart=%dir%/bin/signal-cli -u %I --config /var/lib/signal-cli daemon --system
|
||||||
|
User=signal-cli
|
||||||
|
BusName=org.asamk.Signal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
12
data/signal.service
Normal file
12
data/signal.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Send secure messages to Signal clients
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=dbus
|
||||||
|
Environment=SIGNAL_CLI_OPTS="-Xms2m"
|
||||||
|
ExecStart=%dir%/bin/signal-cli -u %number% --config /var/lib/signal-cli daemon --system
|
||||||
|
User=signal-cli
|
||||||
|
BusName=org.asamk.Signal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
Alias=dbus-org.asamk.Signal.service
|
|
@ -1,16 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Send secure messages to TextSecure/Signal clients
|
|
||||||
Requires=dbus.socket
|
|
||||||
After=dbus.socket
|
|
||||||
Wants=network.target
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=dbus
|
|
||||||
Environment=TEXTSECURE_CLI_OPTS="-Xms2m"
|
|
||||||
ExecStart=%dir%/bin/textsecure-cli -u %I --config /var/lib/textsecure-cli daemon --system
|
|
||||||
User=textsecure-cli
|
|
||||||
BusName=org.asamk.TextSecure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -1,12 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Send secure messages to TextSecure/Signal clients
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=dbus
|
|
||||||
Environment=TEXTSECURE_CLI_OPTS="-Xms2m"
|
|
||||||
ExecStart=%dir%/bin/textsecure-cli -u %number% --config /var/lib/textsecure-cli daemon --system
|
|
||||||
User=textsecure-cli
|
|
||||||
BusName=org.asamk.TextSecure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
Alias=dbus-org.asamk.TextSecure.service
|
|
|
@ -15,4 +15,4 @@ include 'api'
|
||||||
include 'services:webservice'
|
include 'services:webservice'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rootProject.name = 'textsecure-cli'
|
rootProject.name = 'signal-cli'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.asamk;
|
package org.asamk;
|
||||||
|
|
||||||
import org.asamk.textsecure.AttachmentInvalidException;
|
import org.asamk.signal.AttachmentInvalidException;
|
||||||
import org.asamk.textsecure.GroupNotFoundException;
|
import org.asamk.signal.GroupNotFoundException;
|
||||||
import org.freedesktop.dbus.DBusInterface;
|
import org.freedesktop.dbus.DBusInterface;
|
||||||
import org.freedesktop.dbus.DBusSignal;
|
import org.freedesktop.dbus.DBusSignal;
|
||||||
import org.freedesktop.dbus.exceptions.DBusException;
|
import org.freedesktop.dbus.exceptions.DBusException;
|
||||||
|
@ -10,7 +10,7 @@ import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptio
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TextSecure extends DBusInterface {
|
public interface Signal extends DBusInterface {
|
||||||
void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
|
void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
|
||||||
|
|
||||||
void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
|
void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Encodes and decodes to and from Base64 notation.</p>
|
* <p>Encodes and decodes to and from Base64 notation.</p>
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
|
@ -14,14 +14,14 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import net.sourceforge.argparse4j.ArgumentParsers;
|
import net.sourceforge.argparse4j.ArgumentParsers;
|
||||||
import net.sourceforge.argparse4j.impl.Arguments;
|
import net.sourceforge.argparse4j.impl.Arguments;
|
||||||
import net.sourceforge.argparse4j.inf.*;
|
import net.sourceforge.argparse4j.inf.*;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.http.util.TextUtils;
|
import org.apache.http.util.TextUtils;
|
||||||
import org.asamk.TextSecure;
|
import org.asamk.Signal;
|
||||||
import org.freedesktop.dbus.DBusConnection;
|
import org.freedesktop.dbus.DBusConnection;
|
||||||
import org.freedesktop.dbus.exceptions.DBusException;
|
import org.freedesktop.dbus.exceptions.DBusException;
|
||||||
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||||
|
@ -41,8 +41,8 @@ import java.util.List;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static final String TEXTSECURE_BUSNAME = "org.asamk.TextSecure";
|
public static final String SIGNAL_BUSNAME = "org.asamk.Signal";
|
||||||
public static final String TEXTSECURE_OBJECTPATH = "/org/asamk/TextSecure";
|
public static final String SIGNAL_OBJECTPATH = "/org/asamk/Signal";
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// Workaround for BKS truststore
|
// Workaround for BKS truststore
|
||||||
|
@ -55,7 +55,7 @@ public class Main {
|
||||||
|
|
||||||
final String username = ns.getString("username");
|
final String username = ns.getString("username");
|
||||||
Manager m;
|
Manager m;
|
||||||
TextSecure ts;
|
Signal ts;
|
||||||
DBusConnection dBusConn = null;
|
DBusConnection dBusConn = null;
|
||||||
try {
|
try {
|
||||||
if (ns.getBoolean("dbus") || ns.getBoolean("dbus_system")) {
|
if (ns.getBoolean("dbus") || ns.getBoolean("dbus_system")) {
|
||||||
|
@ -68,9 +68,9 @@ public class Main {
|
||||||
busType = DBusConnection.SESSION;
|
busType = DBusConnection.SESSION;
|
||||||
}
|
}
|
||||||
dBusConn = DBusConnection.getConnection(busType);
|
dBusConn = DBusConnection.getConnection(busType);
|
||||||
ts = (TextSecure) dBusConn.getRemoteObject(
|
ts = (Signal) dBusConn.getRemoteObject(
|
||||||
TEXTSECURE_BUSNAME, TEXTSECURE_OBJECTPATH,
|
SIGNAL_BUSNAME, SIGNAL_OBJECTPATH,
|
||||||
TextSecure.class);
|
Signal.class);
|
||||||
} catch (DBusException e) {
|
} catch (DBusException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (dBusConn != null) {
|
if (dBusConn != null) {
|
||||||
|
@ -82,7 +82,7 @@ public class Main {
|
||||||
} else {
|
} else {
|
||||||
String settingsPath = ns.getString("config");
|
String settingsPath = ns.getString("config");
|
||||||
if (TextUtils.isEmpty(settingsPath)) {
|
if (TextUtils.isEmpty(settingsPath)) {
|
||||||
settingsPath = System.getProperty("user.home") + "/.config/textsecure";
|
settingsPath = System.getProperty("user.home") + "/.config/signal";
|
||||||
}
|
}
|
||||||
|
|
||||||
m = new Manager(username, settingsPath);
|
m = new Manager(username, settingsPath);
|
||||||
|
@ -299,8 +299,8 @@ public class Main {
|
||||||
busType = DBusConnection.SESSION;
|
busType = DBusConnection.SESSION;
|
||||||
}
|
}
|
||||||
conn = DBusConnection.getConnection(busType);
|
conn = DBusConnection.getConnection(busType);
|
||||||
conn.exportObject(TEXTSECURE_OBJECTPATH, m);
|
conn.exportObject(SIGNAL_OBJECTPATH, m);
|
||||||
conn.requestBusName(TEXTSECURE_BUSNAME);
|
conn.requestBusName(SIGNAL_BUSNAME);
|
||||||
} catch (DBusException e) {
|
} catch (DBusException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(3);
|
System.exit(3);
|
||||||
|
@ -353,16 +353,16 @@ public class Main {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Namespace parseArgs(String[] args) {
|
private static Namespace parseArgs(String[] args) {
|
||||||
ArgumentParser parser = ArgumentParsers.newArgumentParser("textsecure-cli")
|
ArgumentParser parser = ArgumentParsers.newArgumentParser("signal-cli")
|
||||||
.defaultHelp(true)
|
.defaultHelp(true)
|
||||||
.description("Commandline interface for TextSecure.")
|
.description("Commandline interface for Signal.")
|
||||||
.version(Manager.PROJECT_NAME + " " + Manager.PROJECT_VERSION);
|
.version(Manager.PROJECT_NAME + " " + Manager.PROJECT_VERSION);
|
||||||
|
|
||||||
parser.addArgument("-v", "--version")
|
parser.addArgument("-v", "--version")
|
||||||
.help("Show package version.")
|
.help("Show package version.")
|
||||||
.action(Arguments.version());
|
.action(Arguments.version());
|
||||||
parser.addArgument("--config")
|
parser.addArgument("--config")
|
||||||
.help("Set the path, where to store the config (Default: $HOME/.config/textsecure-cli).");
|
.help("Set the path, where to store the config (Default: $HOME/.config/signal-cli).");
|
||||||
|
|
||||||
MutuallyExclusiveGroup mut = parser.addMutuallyExclusiveGroup();
|
MutuallyExclusiveGroup mut = parser.addMutuallyExclusiveGroup();
|
||||||
mut.addArgument("-u", "--username")
|
mut.addArgument("-u", "--username")
|
||||||
|
@ -630,8 +630,8 @@ public class Main {
|
||||||
if (!message.isEndSession() &&
|
if (!message.isEndSession() &&
|
||||||
!(message.getGroupInfo().isPresent() && message.getGroupInfo().get().getType() != SignalServiceGroup.Type.DELIVER)) {
|
!(message.getGroupInfo().isPresent() && message.getGroupInfo().get().getType() != SignalServiceGroup.Type.DELIVER)) {
|
||||||
try {
|
try {
|
||||||
conn.sendSignal(new TextSecure.MessageReceived(
|
conn.sendSignal(new Signal.MessageReceived(
|
||||||
TEXTSECURE_OBJECTPATH,
|
SIGNAL_OBJECTPATH,
|
||||||
envelope.getSource(),
|
envelope.getSource(),
|
||||||
message.getGroupInfo().isPresent() ? message.getGroupInfo().get().getGroupId() : new byte[0],
|
message.getGroupInfo().isPresent() ? message.getGroupInfo().get().getGroupId() : new byte[0],
|
||||||
message.getBody().isPresent() ? message.getBody().get() : "",
|
message.getBody().isPresent() ? message.getBody().get() : "",
|
|
@ -14,7 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||||
|
@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import org.asamk.TextSecure;
|
import org.asamk.Signal;
|
||||||
import org.whispersystems.libsignal.*;
|
import org.whispersystems.libsignal.*;
|
||||||
import org.whispersystems.libsignal.ecc.Curve;
|
import org.whispersystems.libsignal.ecc.Curve;
|
||||||
import org.whispersystems.libsignal.ecc.ECKeyPair;
|
import org.whispersystems.libsignal.ecc.ECKeyPair;
|
||||||
|
@ -52,8 +52,8 @@ import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
class Manager implements TextSecure {
|
class Manager implements Signal {
|
||||||
private final static String URL = "https://SignalService-service.whispersystems.org";
|
private final static String URL = "https://textsecure-service.whispersystems.org";
|
||||||
private final static TrustStore TRUST_STORE = new WhisperTrustStore();
|
private final static TrustStore TRUST_STORE = new WhisperTrustStore();
|
||||||
|
|
||||||
public final static String PROJECT_NAME = Manager.class.getPackage().getImplementationTitle();
|
public final static String PROJECT_NAME = Manager.class.getPackage().getImplementationTitle();
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.asamk.textsecure;
|
package org.asamk.signal;
|
||||||
|
|
||||||
import org.whispersystems.signalservice.api.push.TrustStore;
|
import org.whispersystems.signalservice.api.push.TrustStore;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue