From acdfa75d904198efedb3713b7619ca927a36e36b Mon Sep 17 00:00:00 2001 From: John Freed Date: Wed, 22 Sep 2021 21:34:07 +0200 Subject: [PATCH] Updated DBus service (markdown) --- DBus-service.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DBus-service.md b/DBus-service.md index 1f07743..bcfe3b9 100644 --- a/DBus-service.md +++ b/DBus-service.md @@ -131,12 +131,15 @@ Keep in mind that if you use DBus as a system service and want to send a message The groupId is handled as an array of bytes rather than a Base64 string. (See [#272](https://github.com/AsamK/signal-cli/issues/272).) -The byte array can be obtained from a base64-encoded string (which looks like ixZI93QgqmjNpM8V+E25== and can be found in signal-cli's config file, by default in ~/.local/share/signal-cli/data/). To decode it to byte array, can use python: +The byte array can be obtained from a base64-encoded string (which looks like ixZI93QgqmjNpM8V+E25== and can be found in signal-cli's config file, by default in ~/.local/share/signal-cli/data/). To decode it to byte array, you can use python: ``` python3 -c 'import base64; print(",".join(str(i) for i in base64.b64decode(b"ixZI93QgqmjNpM8V+E25==")))' ``` - +or, using Bash shell syntax: +``` +echo "ixZI93QgqmjNpM8V+E25==" | base64 -d |xxd -p -c1|while read i; do printf "%d " $((16#${i})); done|sed 's/ /,/g'|sed 's/,$/\n/g' +``` In the examples above, attachments are identified by the first `array:string:` argument (`dbus-send` arguments must be in the correct order). The last argument can either be a single `string:RECIPIENT` (as in the examples above) or an `array:string:RECIPIENT1,RECIPIENT2,...` (for `dbus-send`, an array argument consists of a comma-separated list). ### Receive messages from signal-cli daemon