Compare commits

...

2005 commits

Author SHA1 Message Date
AsamK
f6d81e3c05 Update gradle
Some checks failed
signal-cli CI / build (21) (push) Has been cancelled
signal-cli CI / build (24) (push) Has been cancelled
signal-cli CI / build-graalvm (push) Has been cancelled
signal-cli CI / build-client (macos) (push) Has been cancelled
signal-cli CI / build-client (ubuntu) (push) Has been cancelled
signal-cli CI / build-client (windows) (push) Has been cancelled
CodeQL / Analyse (push) Has been cancelled
2025-08-17 17:35:59 +02:00
AsamK
42f10670b6 Replace deprecated groovy utils 2025-08-17 17:35:14 +02:00
AsamK
b453d7a0b9 Add new svr2 mrenclave 2025-08-02 12:05:01 +02:00
AsamK
f9a36c6e04 Fix send parameters to be all camel case
Fixes #1814
2025-07-16 20:59:26 +02:00
AsamK
be48afb2b5 Fix container build 2025-07-16 20:56:02 +02:00
AsamK
a0960fcabd Prepare next release 2025-07-16 20:55:50 +02:00
AsamK
dbc454ba9e Bump version to 0.13.18 2025-07-16 19:40:10 +02:00
AsamK
2225e69277 Update sqlite-jdbc 2025-07-16 19:37:03 +02:00
AsamK
783201d12e Fix incorrect error message 2025-07-16 19:17:21 +02:00
AsamK
3e981d66e9 Fix null pointer regression 2025-07-14 18:52:41 +02:00
AsamK
7c7fc76a64 Add support for sending view once messages
Closes #1812
2025-07-14 16:42:06 +02:00
AsamK
c924d5c03a Update libsignal-service-java 2025-07-14 16:21:47 +02:00
AsamK
dc787be17b Build rust json-rpc client in CI 2025-07-12 11:57:23 +02:00
AsamK
3d4070a139 Compile UnixStream support only on unix systems 2025-07-12 11:42:12 +02:00
AsamK
dbdff83132 Update README
Fixes #1803
2025-07-12 11:09:24 +02:00
AsamK
4ce194afe2 Add missing username parameter to getUserStatus command in json-rpc client 2025-07-12 11:03:54 +02:00
AsamK
ca33249170 Handle rate limit exception correctly when querying usernames
Fixes #1797
2025-07-12 11:03:28 +02:00
AsamK
a96626c468 Update to rust 2024 edition 2025-07-12 10:16:57 +02:00
AsamK
d54be747da Remove unused dependency 2025-07-12 10:15:27 +02:00
AsamK
ff846bc678 Fix clippy warnings 2025-07-12 10:05:57 +02:00
AsamK
1b7f755590 Update dependencies 2025-07-12 10:05:14 +02:00
AsamK
887ed3bb44 Show better error message when sending fails due to missing pre keys 2025-07-08 17:35:17 +02:00
AsamK
3180eba836 Exit if account check fails at startup
Fixes #1804
2025-07-08 17:34:04 +02:00
AsamK
cb06cbdcca Shut down when dbus daemon connection goes away unexpectedly
Fixes #1800
2025-06-29 11:22:30 +02:00
AsamK
069325af47 Extend shutdown request with optional error 2025-06-29 11:22:30 +02:00
AsamK
e7ca02f1fb Prepare next release 2025-06-29 11:22:30 +02:00
AsamK
fa9bb3c210 Bump version to 0.13.17 2025-06-28 14:57:20 +02:00
AsamK
e6113d4d96 Update libsignal-service-java 2025-06-28 14:35:56 +02:00
AsamK
6cc3a6f561 Update dependencies 2025-06-25 00:20:42 +02:00
AsamK
70c79eac01 Keep all unhandled fields of remote storage record
Fixes #1792
2025-06-24 23:13:00 +02:00
AsamK
5dc66f839d Close attachment input streams after upload
Fixes #1790
2025-06-10 19:36:52 +02:00
AsamK
a0d5744c49 Improve behavior when pin data doesn't exist on the server 2025-06-08 16:22:03 +02:00
AsamK
6b60a6d5a5 Fix NPR when loading an inactive group
Fixes #1786
2025-06-08 14:48:25 +02:00
AsamK
0257344940 Prepare next release 2025-06-08 14:47:20 +02:00
AsamK
17cd99be59 Bump version to 0.13.16 2025-06-07 16:58:00 +02:00
AsamK
2f8328847c Update dependencies 2025-06-07 16:14:55 +02:00
AsamK
7e9727aa38 Update tests 2025-06-07 16:14:55 +02:00
AsamK
bf87fcc652 Ensure messages are created with a unique timestamp
Fixes #1783
2025-06-03 22:22:51 +02:00
AsamK
6b46314eab Update dependencies 2025-06-03 21:59:38 +02:00
AsamK
e89803464b Update libsignal-service 2025-06-01 21:51:03 +02:00
AsamK
a9bb8d9aae Update gradle 2025-06-01 16:11:21 +02:00
AsamK
74909408c4 Add missing reflect config
Fixes #1768
2025-05-10 10:18:03 +02:00
AsamK
bb124a922d Prepare next release 2025-05-08 22:56:55 +02:00
AsamK
56e11d0857 Update codeql v3 2025-05-08 22:55:26 +02:00
AsamK
d0d0021f57 Bump version to 0.13.15 2025-05-08 21:49:51 +02:00
AsamK
7aafb05995 Update dependencies 2025-05-08 21:31:17 +02:00
AsamK
e594f3b237 Update libsignal-service 2025-05-08 21:31:17 +02:00
AsamK
bb86830a61 Add compatibility flag for graalvm native build 2025-05-08 20:42:13 +02:00
AsamK
bcc1eadc7d Remove unused e164 field from account record 2025-05-08 20:36:27 +02:00
AsamK
4fd9e55c3c Enable native access required by Java 24
Fixes #1765
2025-05-08 20:04:49 +02:00
AsamK
a2900085c9 Use java 24 in CI 2025-05-08 19:37:57 +02:00
AsamK
5e11cf1c50 Update gradle 2025-05-08 19:37:41 +02:00
AsamK
4e455d85d6 Add more logging to register 2025-04-26 09:04:05 +02:00
AsamK
1e685c7cab Extend merge/split logging 2025-04-09 20:44:10 +02:00
AsamK
ce813e4529 Update client dependencies 2025-04-08 16:24:57 +02:00
AsamK
bd7948e246 Prepare next release 2025-04-08 16:24:30 +02:00
AsamK
b998f322f5 Bump version to 0.13.14 2025-04-06 20:10:46 +02:00
AsamK
db2182aa7d Update libsignal-service 2025-04-06 20:02:02 +02:00
AsamK
69a9b30732 Update libsignal-service 2025-03-31 14:56:56 +02:00
AsamK
3dc8844cb4 Update libraries 2025-03-31 09:19:20 +02:00
AsamK
adb6787d5b Refresh prekeys when receiving message with invalid key id 2025-03-31 09:11:28 +02:00
AsamK
14b07be0dc Always renew session when failing to decrypt message 2025-03-31 09:11:05 +02:00
AsamK
6befda7ef1 Update graalvm build tools 2025-03-22 10:55:16 +01:00
AsamK
67302eb9c3 Replace cached envelopes when moving
Fixes #1730
2025-03-18 18:20:44 +01:00
AsamK
f18015ff2e f 2025-03-18 18:13:38 +01:00
AsamK
1295ef69ca Use record patterns 2025-03-16 22:07:29 +01:00
AsamK
f26a0d2891 Update libsignal-service 2025-03-16 22:06:58 +01:00
AsamK
2b150112ff Remove previous prekeys when importing legacy prekeys 2025-03-16 12:22:21 +01:00
AsamK
7aede7c17f Remove previous prekeys when importing legacy prekeys 2025-03-16 12:18:59 +01:00
AsamK
b92cbc6a7c Exclude libsignal-client testing libraries 2025-03-04 10:04:34 +01:00
AsamK
68b7416e57 Update gradle wrapper 2025-03-04 08:32:56 +01:00
AsamK
4feba68afd Replace deprecated gradle api 2025-03-04 08:29:05 +01:00
AsamK
4eb34c7a93 Update apt repository before installing packages 2025-02-28 09:46:45 +01:00
AsamK
26fd3e379a Prepare next release 2025-02-28 09:46:28 +01:00
AsamK
93d281e712 Bump version to 0.13.13 2025-02-28 09:36:27 +01:00
AsamK
985af6e445 Update libsignal-service 2025-02-28 09:32:17 +01:00
AsamK
5693d871f7 Update dependencies 2025-02-28 09:32:17 +01:00
AsamK
dba8cf7a6f Update reflect-config 2025-02-27 18:01:21 +01:00
AsamK
141d3326ab Add in-memory cache to KeyValueStore 2025-02-27 17:21:31 +01:00
AsamK
d3d2caac5a Tweak hikari config 2025-02-27 17:21:31 +01:00
AsamK
e1f4dae5c2 Show better error message when receiving an empty JSON RPC line
Fixes #1715
2025-02-27 11:39:31 +01:00
AsamK
cf5c943127 Remove legacy SVR2 enclave 2025-02-27 11:34:23 +01:00
AsamK
ed79e0b377 Check if required quote-author parameter is missing
Fixes #1716
2025-02-27 11:14:54 +01:00
Enguerran P.
a089a5ef04 Update README > landline procedure
Update landline (`--voice`) registration procedure.

This closes #1666 (🤘)
2025-02-07 23:16:46 +01:00
AsamK
90145655f4 Update CHANGELOG.md 2025-02-07 19:15:55 +01:00
AsamK
3cd07ae9cd Set libsignal network proxy to match java proxy
Fixes #1523
2025-02-07 18:30:10 +01:00
AsamK
8aa71c132f Fix log message 2025-02-07 18:30:10 +01:00
AsamK
b579935846 Update README 2025-02-07 18:30:10 +01:00
AsamK
dfa886fae9 Update dependencies 2025-02-07 18:30:10 +01:00
AsamK
f04f789231 Update gradle action 2025-01-31 16:45:47 +01:00
AsamK
a6ec71dc31 Add --mobilecoin-address as alias to updateProfile
Closes #1638
2025-01-30 20:18:07 +01:00
AsamK
47d65586cd Improve handling of unknown storage records
Fixes #1696
2025-01-30 19:57:44 +01:00
AsamK
b8d8413a22 Fix creating builder from contact
Fixes #1678
2025-01-23 17:12:40 +01:00
AsamK
5e16123632 Extend updateContact command with nick given/family name and note 2025-01-23 17:11:33 +01:00
AsamK
d57442bd2a Prepare next release 2025-01-19 13:26:12 +01:00
AsamK
70313c45a9 Update reflect-config.json
Fixes #1686
2025-01-19 13:25:08 +01:00
AsamK
f14c204764 Bump version to 0.13.12 2025-01-18 20:53:46 +01:00
AsamK
71d3b83a1c Update user agent 2025-01-18 20:24:01 +01:00
AsamK
148bf7dee2 Add man page to build tar file
Fixes #1660
2025-01-18 20:07:41 +01:00
AsamK
2d1ba6b4ca Extend man Makefile 2025-01-18 19:56:23 +01:00
AsamK
055a8ee8b9 Add general description for global/subcommand arguments
Fixes #1649
2025-01-18 16:59:25 +01:00
AsamK
407a20d4bb Update client dependencies 2025-01-18 16:53:09 +01:00
AsamK
05cd6aee6a Add version and group to all modules 2025-01-18 16:30:28 +01:00
AsamK
a1378507b2 Rename lib to libsignal-cli 2025-01-18 16:30:07 +01:00
AsamK
78cd0b13de Update dependencies 2025-01-18 16:08:43 +01:00
AsamK
c25468a71e Update reflect-config.json 2025-01-17 16:09:39 +01:00
AsamK
a5d2e1ea23 Use getRawQuery to prevent double decoding the query
Fixes #1682
2025-01-17 16:03:00 +01:00
AsamK
6acf16ef4e Improve tests 2025-01-14 23:12:45 +01:00
AsamK
e11e093020 Enable sqlite WAL journal_mode
Related #1670
2025-01-14 22:35:45 +01:00
AsamK
74c2604dc8 Set sqlite PRAGMA via Url 2025-01-14 22:31:36 +01:00
AsamK
e4af0be0ad Use existing connection to read configuration during storage sync 2025-01-14 21:33:12 +01:00
AsamK
5ac5938c8b Reduce log level of invalid sync contact address
Fixes #1663
2025-01-14 20:41:04 +01:00
AsamK
94269744ad Improve final address when merging recipients 2025-01-14 20:30:06 +01:00
AsamK
7a25ae5b9c Fix reading nickname from storage record
Fixes #1664
2025-01-14 20:30:06 +01:00
AsamK
cbd92654cf Store pni correctly in storage record 2025-01-14 20:30:06 +01:00
AsamK
bd95373a70 Parse unregisteredAtTimestamp correctly
Fixes #1651
Fixes #1646
2025-01-14 20:30:06 +01:00
AsamK
d982633215 Update dependencies 2025-01-14 20:30:06 +01:00
AsamK
f91ca82902 Prepare next release 2025-01-14 20:30:06 +01:00
Slayer
c55ee85c5c Fixing RW connections deadlock on SQLite
Without this change we're getting a connection in the same thread we hold one already.
2025-01-14 12:21:12 +01:00
AsamK
a3776c88bd Bump version to 0.13.11 2024-12-26 20:31:28 +01:00
AsamK
4a781656b4 Update dependencies 2024-12-26 20:23:08 +01:00
AsamK
11d38f29ef Improve splitting of long message bodies 2024-12-26 20:15:19 +01:00
AsamK
22a0ff976a Update libsignal-service 2024-12-26 20:14:53 +01:00
AsamK
c05b47e4d0 Delete storage id of unregistered recipients after remote update 2024-12-25 17:19:33 +01:00
AsamK
ac145e6a27 Ignore destination if it's an empty uuid
Fixes #1643
2024-12-25 16:23:36 +01:00
AsamK
f00b8523d9 Update dependencies 2024-12-15 21:18:02 +01:00
AsamK
c3f8d68ceb Create account entropy pool instead of master key 2024-12-15 21:14:40 +01:00
AsamK
9d92a3e06b Update libsignal-service 2024-12-15 21:13:59 +01:00
AsamK
f2df600d38 Update CHANGELOG.md
Fixes #1641
2024-12-01 10:12:46 +01:00
AsamK
24d344fda4 Prepare next release 2024-11-30 16:32:31 +01:00
AsamK
0a296e77a0 Bump version to 0.13.10 2024-11-30 16:14:53 +01:00
AsamK
ba147a48f8 Update reflect config 2024-11-30 15:45:26 +01:00
AsamK
77a5c454b7 Improve documentation for recipient arguments
Fixes #1639
2024-11-29 21:10:46 +01:00
AsamK
2c68b5a9e1 Add support for using PNI as recipient 2024-11-29 21:10:46 +01:00
AsamK
68c9d84d19 Update libsignal-service
Fixes #1633
2024-11-24 13:04:04 +01:00
AsamK
fe752e0c79 Add simplification for single recipient reactions 2024-11-24 11:51:54 +01:00
AsamK
26b5a4c582 Small code improvement 2024-11-23 23:57:23 +01:00
AsamK
10ee295ea3 Fix receiving shared contacts in graalvm mode
Fixes #1629
2024-11-23 23:57:23 +01:00
AsamK
6a5ea5fc01 Workaround issue with invalid address in recipient store 2024-11-23 23:57:23 +01:00
AsamK
ff6cb5262a Update libsignal-service
Support for storage encryption v2 and account entropy pool

Fixes #1632
2024-11-23 23:57:23 +01:00
AsamK
f2005593ec Reformat files 2024-11-23 22:35:06 +01:00
AsamK
3533500b73 Update dependencies 2024-11-23 22:35:06 +01:00
AsamK
e5251ae158 Switch to using toml version catalogs 2024-11-21 21:17:33 +01:00
AsamK
a5e272be3f Prepare next release 2024-10-28 23:45:03 +01:00
AsamK
277652e3f2 Bump version to 0.13.9 2024-10-28 23:37:26 +01:00
AsamK
181086aefe Update graalvm config
Fixes #1612
2024-10-28 10:58:14 +01:00
AsamK
a1d552698a Fix verifyAccount
Fixes #1614
2024-10-28 10:42:26 +01:00
AsamK
1b959608c3 Simplify verification code request 2024-10-28 10:35:18 +01:00
AsamK
acddef6e35 Prepare next release 2024-10-26 15:02:28 +02:00
AsamK
0e77870b59 Bump version to 0.13.7 2024-10-26 15:01:05 +02:00
AsamK
0a287b0b3e Reformat files 2024-10-26 13:10:33 +02:00
AsamK
5a4f4ba6db Implement message expiration timer version
Fixes #1605
2024-10-26 13:08:21 +02:00
AsamK
5171107a29 Run CI with Java 23 2024-10-25 17:22:47 +02:00
AsamK
47e6fc1769 Update dependencies 2024-10-25 17:20:07 +02:00
AsamK
9afd4e4328 Update libsignal-service 2024-10-25 17:20:07 +02:00
Jailson Dias
eac2a47163 add group info on json message 2024-10-25 17:19:17 +02:00
Jailson Dias
5646f65195 add received and delivered timestamps on json message 2024-10-25 17:19:17 +02:00
AsamK
fab1b96c21 Upload text attachment also if there no other attachments
Fixes #1598
2024-09-29 09:43:51 +02:00
AsamK
91eacc18c2 Refactor attachment upload 2024-09-29 09:43:26 +02:00
AsamK
7f1fc932ad Add constant for MAX_MESSAGE_BODY_SIZE 2024-09-29 09:43:05 +02:00
AsamK
304c44064d Prepare next release 2024-09-28 22:14:26 +02:00
AsamK
946c483f35 Bump version to 0.13.7 2024-09-28 22:13:24 +02:00
AsamK
69d691f416 Update graalvm reflect-config
Fixes #1590
2024-09-28 20:41:58 +02:00
AsamK
a6ab8f7e80 Remove v2 suffix from secure value recovery 2024-09-28 20:41:58 +02:00
AsamK
19dc2d446b Update libsignal-service 2024-09-28 20:41:58 +02:00
AsamK
8524037900 Update gradle 2024-09-28 12:13:49 +02:00
AsamK
dbbc3fbd71 Remove unnecessary proto conversion 2024-09-24 17:28:24 +02:00
AsamK
c6e93126fa Fix truncating cdsi table
Fixes #1587
2024-09-12 23:09:20 +02:00
AsamK
352699c4b6 Update artifact CI actions 2024-09-11 17:50:01 +02:00
AsamK
bea2772491 Update graalvm buildtools 2024-09-10 19:16:42 +02:00
AsamK
bab8ddf35a Update slf4j 2024-09-09 18:31:47 +02:00
AsamK
1d5d16f57e Adapt signal_jni file names in graalvm config 2024-09-09 18:31:34 +02:00
AsamK
6f9e9e9302 Prepare next release 2024-09-08 19:24:18 +02:00
AsamK
20add0f27b Downgrade dbus-java 2024-09-08 19:24:18 +02:00
AsamK
eca3c6fa30 Replace deprecated DBusMap 2024-09-08 19:24:18 +02:00
AsamK
a0d1b081ff Bump version to 0.13.6 2024-09-08 18:59:22 +02:00
AsamK
d852c60c37 Update dependencies 2024-09-08 18:55:23 +02:00
AsamK
2b5451f74a Update client dependencies 2024-09-08 18:51:56 +02:00
AsamK
b322716215 Update CHANGELOG.md 2024-09-08 10:18:26 +02:00
AsamK
41726d339f Update libsignal-service-java 2024-09-08 10:18:17 +02:00
AsamK
52bb92dce4 Call getter instead of using cached instance variable 2024-09-08 10:15:02 +02:00
AsamK
65adfdd6f5 Add signal CDN 3 2024-09-08 10:15:02 +02:00
AsamK
d8b1a2fffe Fix stripping the correct identifiers when merging recipients 2024-09-08 09:24:51 +02:00
AsamK
ea436ecb64 Fix possible db dead lock
Fixes #1483
2024-09-08 09:22:52 +02:00
AsamK
82fbde4f19 Adapt code style 2024-09-08 09:00:39 +02:00
AsamK
19b15e68e4 Improve addDevice error message
Fixes #1573
2024-09-08 09:00:34 +02:00
AsamK
b51f849fe6 Send sync message for read/viewed receipt messages
Fixes #1570
2024-09-08 08:51:33 +02:00
AsamK
7cc0ef1c70 Improve error message and log output for failed jsonrpc commands 2024-09-08 08:30:31 +02:00
AsamK
485c4fd467 Improve daemon deprecation message 2024-09-08 08:30:08 +02:00
AsamK
bda395191b Don't set previousE164s param if cdsi token is empty
Fixes #1576
2024-09-08 08:29:54 +02:00
AsamK
cb129db95e Update libsignal-service 2024-08-20 17:39:39 +02:00
AsamK
130cee9906 Fix sending to groups with non sender key capable members
Regression in 0.13.5

Fixes #1568
2024-08-20 17:13:57 +02:00
AsamK
6bdc9a4b16 Update gradle 2024-08-20 17:10:03 +02:00
AsamK
a69a9b7b0e Add method to update group endorsements 2024-08-20 17:10:03 +02:00
AsamK
6ea373fbd5 Prepare next release 2024-08-20 17:10:03 +02:00
Ingmar Lippert
62da514850
Add more specificity to addDevice (#1561) 2024-08-20 16:59:52 +02:00
AsamK
fe3934171d Bump version to 0.13.5 2024-07-25 22:47:16 +02:00
AsamK
3d11221732 Update jackson 2024-07-25 22:43:55 +02:00
AsamK
e961488b1a Update man page 2024-07-25 22:40:46 +02:00
AsamK
2db3d3259e Use UploadSpec for attachment uploads 2024-07-25 22:31:35 +02:00
AsamK
e51b1ee23a Update libsignal-service 2024-07-25 16:27:24 +02:00
AsamK
5ff66728e3 Update libsignal-service 2024-06-26 15:38:55 +02:00
AsamK
baf7b74a61 Prepare next release 2024-06-06 11:15:02 +02:00
AsamK
c716f94649 Bump version to 0.13.4 2024-06-06 10:47:42 +02:00
AsamK
8b355918e8 Use jvm running gradle if it's compatible with targetCompatibility 2024-06-06 10:40:21 +02:00
AsamK
67012b40b1 Update user agent 2024-06-06 10:16:53 +02:00
AsamK
fd402b52c8 Update doc 2024-06-06 10:16:40 +02:00
AsamK
5a97b9e134 Update groups when using listGroups command
Fixes #1517
2024-06-06 10:07:20 +02:00
AsamK
17596795c2 Only store profile keys for group history if none is known yet 2024-06-06 10:07:20 +02:00
AsamK
10b9c264fd Update libsignal-service
Fixes #1530
2024-06-06 10:07:20 +02:00
AsamK
a2b002ac5e Add java 22 to CI 2024-06-06 09:12:40 +02:00
AsamK
6d764db114 Update dependencies 2024-06-02 13:26:17 +02:00
AsamK
777cfbb69f Update gradle wrapper 2024-06-02 13:25:09 +02:00
AsamK
9781c56571 Improve username update error message
Fixes #1535
2024-05-24 16:09:07 +02:00
AsamK
04cf54263e Fix getUserStatus command with only username parameter
Related #1535
2024-05-23 12:46:15 +02:00
AsamK
6baf0eac13 Fix type parsing in JSON RPC mode
Fixes #1533
2024-05-21 20:28:16 +02:00
AsamK
fb21a42cce Update graalvm build tools 2024-05-18 22:13:29 +02:00
AsamK
53d7e0f08b Handle all possible identifiers of a RecipientAddress
Fixes #1516
2024-05-17 18:02:05 +02:00
AsamK
8f756cd90c Update libsignal-service 2024-05-09 21:32:34 +02:00
Sebastian Scheibner
fb81bf1d05
Update README.md 2024-05-09 21:20:38 +02:00
AsamK
04726f005c Save account file after setting username link
Fixes #1515
2024-05-01 09:08:00 +02:00
AsamK
09e3e7f335 Rotate storageId after setting username 2024-05-01 09:07:39 +02:00
AsamK
90b1e4bc02 Delete username link when deleting username 2024-05-01 09:04:03 +02:00
AsamK
3f31f1a8a6 Update metainfo 2024-04-21 09:34:06 +02:00
dependabot[bot]
3cd8e323c9
Bump rustls from 0.21.10 to 0.21.11 in /client (#1511)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 13:53:36 +02:00
AsamK
7060faf5d3 Prepare next release 2024-04-19 19:25:27 +02:00
AsamK
c9f2cca024 Bump version to 0.13.3 2024-04-19 19:21:07 +02:00
AsamK
f0054372b8 Add timestamp to account file
Closes #1498
2024-04-19 17:25:43 +02:00
AsamK
0a82c51b79 Update dependencies 2024-04-19 17:17:32 +02:00
AsamK
cef83d962c Fix missing null check 2024-04-19 17:07:29 +02:00
AsamK
c1775913b9 Implement dbus support for listIdentities
Fixes #195
2024-04-19 17:07:18 +02:00
AsamK
e4c5144fbf Add more details to listContacts command
Fixes #1502
2024-04-17 21:26:16 +02:00
AsamK
8aeaf927e6 Add missing parts for new nick name and note columns 2024-04-17 21:21:28 +02:00
AsamK
7e0d4c9b89 Store profile phone number sharing mode and discoverable state 2024-04-17 21:08:09 +02:00
AsamK
71de8e63cc Cache newly created session record
Fixes #1481
2024-04-15 19:23:50 +02:00
AsamK
e456d06cb0 Add aci,pni to API RecipientAddress 2024-04-15 19:23:50 +02:00
AsamK
e0cd5b987e Add handling for new nickname and note fields 2024-04-15 19:23:50 +02:00
Stephen Brennan
e5ebb732cb
Document the unit of "start" and "length" for mentions and text styles (#1505)
The unit of UTF-16 code units is not necessarily obvious for users of
languages that index strings by Unicode code points. Provide a pointer
to an FAQ entry as well:

https://github.com/AsamK/signal-cli/wiki/FAQ#string-indexing-units

Closes #1504

Signed-off-by: Stephen Brennan <stephen@brennan.io>
2024-04-13 20:26:15 +02:00
AsamK
419beee29a Update libsignal-service-java 2024-04-06 14:04:56 +02:00
AsamK
d4e1f9b7f1 Remove unnecessary config field 2024-04-06 14:04:56 +02:00
AsamK
edce33ae15 Disable java 22 until gradle supports it 2024-04-06 14:04:56 +02:00
dependabot[bot]
95f9e18de2
Bump h2 from 0.3.24 to 0.3.26 in /client (#1501)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-06 14:04:48 +02:00
AsamK
95d4b7d012 Update gradle wrapper 2024-04-06 12:34:55 +02:00
AsamK
17c24b3ff2 Update libsignal-service-java 2024-03-27 22:58:13 +01:00
AsamK
be0e8ddd8a Add reregister to tests 2024-03-27 22:58:13 +01:00
AsamK
49cc9cd9f8 Update CHANGELOG.md 2024-03-23 15:00:02 +01:00
AsamK
c85c995fef Prepare next release 2024-03-23 10:34:45 +01:00
AsamK
dda23e76ac Bump version to 0.13.2 2024-03-23 09:57:15 +01:00
AsamK
95e70b9d15 Add Java 22 to CI 2024-03-23 09:50:59 +01:00
AsamK
abddf24752 Update user agent 2024-03-23 09:50:59 +01:00
AsamK
d356d92b5e Extend getUserStatus command for usernames 2024-03-22 10:54:42 +01:00
AsamK
8b4f377cf1 Update dependencies 2024-03-22 10:04:57 +01:00
dependabot[bot]
323a801600
Bump mio from 0.8.10 to 0.8.11 in /client (#1488)
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-09 13:08:46 +01:00
AsamK
3372992dc2 Add appstream metainfo file 2024-03-09 11:35:36 +01:00
AsamK
ee39733978 Update libsignal-service 2024-03-07 17:44:19 +01:00
AsamK
5e17fe8414 Fix typo 2024-02-27 19:35:38 +01:00
AsamK
aebe64571d Prepare next release 2024-02-27 18:20:21 +01:00
AsamK
0cc2da690a Bump version to 0.13.1 2024-02-27 18:18:30 +01:00
AsamK
2424fc1f53 Add register parameter to force reregistration 2024-02-27 18:12:43 +01:00
AsamK
2e4cd0eddc Only retry messages after identity was trusted
Fixes #1477
2024-02-27 17:52:21 +01:00
AsamK
189b21dbde Improve error message if captcha is rejected by server
Fixes #1328
2024-02-26 22:13:57 +01:00
AsamK
e77d9e3d60 Update libsignal-service 2024-02-26 22:07:36 +01:00
AsamK
df76aa9919 Default number sharing to NOBODY
Matches the official apps behavior.

Closes #1472
2024-02-26 18:27:09 +01:00
AsamK
378ac23c6c Update account attributes after setting a pin
Ensures that the recovery password gets set immediately.

Related to #1447
2024-02-26 18:23:37 +01:00
AsamK
fc2ae856d2 Adapt account record processor for linked devices 2024-02-25 19:41:34 +01:00
AsamK
57164ad7fb Prevent crash when receiving already migrated group v1 from storage
Fixes #1471
2024-02-25 19:41:10 +01:00
AsamK
6c44662496 Allow overriding user agent string
Not recommended, as it could lead to issues with newer Signal protocol changes.

Fixes #1476
2024-02-25 18:27:20 +01:00
AsamK
22ac3cb50f Removing linked devices only works on the primary device 2024-02-25 18:12:36 +01:00
AsamK
b76964f219 Improve warning message 2024-02-25 17:54:18 +01:00
AsamK
2f3c064462 Update documentation 2024-02-25 17:46:27 +01:00
AsamK
c9002d9481 Ignore failure when uploading PNI prekeys
Can happen if PNI identity key hasn't been sent to the server yet.
2024-02-25 17:46:09 +01:00
AsamK
83d471818d Allow setting a username with explicit descriminator
Fixes #1469
2024-02-22 20:00:00 +01:00
AsamK
0bb2a64781 Add missing field handling in account record processor 2024-02-22 20:00:00 +01:00
AsamK
08ba774b71 Update graalvm buildtools 2024-02-20 17:37:59 +01:00
AsamK
59c1f4eed2 Show information when requesting voice verification without SMS verification
Fixes #1373
2024-02-20 17:37:31 +01:00
AsamK
f1e3b5c9cc Add uniqueness check to db migration 2024-02-20 17:05:56 +01:00
AsamK
7bc7242f08 Add uniqueness check to db migration 2024-02-20 11:03:32 +01:00
Viktor Szépe
6f407ab509
Fix typos (#1459) 2024-02-19 08:20:24 +01:00
AsamK
db9acaf4ff Set snapshot version 2024-02-18 22:14:09 +01:00
AsamK
7821815429 Bump version to 0.13.0 2024-02-18 22:01:41 +01:00
AsamK
cd88e896fa Fix missing unique constraint on storage_id table 2024-02-18 22:01:41 +01:00
AsamK
67fd10b978 Update dependencies 2024-02-18 21:43:02 +01:00
AsamK
9051f68ba6 Enable profile sharing when accepting message request 2024-02-18 21:26:36 +01:00
AsamK
3b3377e6e9 Update CHANGELOG 2024-02-18 21:06:17 +01:00
AsamK
fb99ff5284 Document creating and sending to usernames 2024-02-18 21:04:50 +01:00
AsamK
ed40d116b7 Fix sending to username 2024-02-18 20:58:55 +01:00
AsamK
d84362eb0f Add sendMessageRequestResponse command 2024-02-18 20:48:16 +01:00
AsamK
2c0ad7feb7 Fix issue with prekey update 2024-02-18 20:48:16 +01:00
AsamK
7206b4da25 Fix use of aci instead of serviceId
Fixes #1455
2024-02-18 20:48:01 +01:00
AsamK
fd671576a4 Fix issues with receiving message to PNI address 2024-02-18 20:46:07 +01:00
AsamK
6cd57312a1 Add parameter to configure phone number privacy 2024-02-18 20:42:41 +01:00
AsamK
25258db55d Restructure pre key refresh to be more robust 2024-02-18 16:32:50 +01:00
AsamK
91ed49e019 Includ pni signatures if necessary 2024-02-18 16:31:34 +01:00
AsamK
bd792f5b7f Update libsignal-service 2024-02-18 15:16:41 +01:00
AsamK
ed4b1e8f02 Improve sql query 2024-02-10 12:24:13 +01:00
AsamK
e78146eb67 Fix saving username link components 2024-02-10 11:54:32 +01:00
AsamK
9f6b6cb657 Implement account reregistration with recovery password 2024-02-10 11:54:06 +01:00
AsamK
fb85e1a068 Update dependencies 2024-02-09 22:51:03 +01:00
AsamK
c78299e7bc Update gradle wrapper 2024-02-09 22:11:50 +01:00
AsamK
9a5e29e015 Update CHANGELOG.md 2024-02-09 22:11:01 +01:00
AsamK
7cf3a989bf Add command to retrieve avatars and stickers
Fixes #1125
2024-02-09 22:10:46 +01:00
AsamK
d486563099 Ignore invalid ACI/PNI in recipient table 2024-02-09 18:34:32 +01:00
AsamK
be699cbd85 Fix potential dead lock in recipient store 2024-02-09 18:07:30 +01:00
AsamK
4e61f2b2e5 Use app id as dbus name for flatpak version 2024-02-09 18:07:30 +01:00
AsamK
1bf703b012 Add --bus-name option to use different D-Bus bus name 2024-02-09 18:07:30 +01:00
AsamK
a48fdaf8b7 Bump version to 0.12.8 2024-02-09 18:07:30 +01:00
AsamK
a0f33ac942 Update reflect config 2024-02-09 18:07:30 +01:00
AsamK
bea659f948 Add icon 2024-02-05 16:58:24 +01:00
AsamK
7fb263fdf0 Update dependencies 2024-02-01 17:54:26 +01:00
AsamK
3be1c24b1b Update client dependencies 2024-01-31 21:17:23 +01:00
AsamK
0b33cb55b8 Adapt listContacts to only show registered users
Fixes #1395
2024-01-31 20:49:12 +01:00
AsamK
00e71ed0fc Improve scrubbing of sensitive identifiers
Fixes #1189
2024-01-31 20:33:01 +01:00
AsamK
a40810e33e Update CHANGELOG.md 2024-01-30 19:00:33 +01:00
AsamK
15c9d04703 Add missing command to json-rpc client 2024-01-30 18:58:27 +01:00
AsamK
e13dcdc85a Prevent empty username 2024-01-30 17:59:59 +01:00
AsamK
2ab5b2817e Deprecate daemon mode without explicit mode flag 2024-01-30 17:44:51 +01:00
AsamK
080c14d111 Clean old prekeys only after server message queue is empty 2024-01-30 17:21:29 +01:00
AsamK
d1e32f2b11 Improve some log output 2024-01-29 18:21:44 +01:00
AsamK
0840e0dedb Add CDSI recipients refresh job 2024-01-28 23:04:34 +01:00
AsamK
888d6bf091 Split unregistered recipients 2024-01-28 23:04:34 +01:00
AsamK
e2f308a57a Store profile sharing for group v2 2024-01-28 22:38:41 +01:00
AsamK
76fe6ad799 Recreate recipient database with aci column 2024-01-28 22:38:41 +01:00
AsamK
90df256e85 Fix storage sync issues 2024-01-28 22:38:41 +01:00
AsamK
f92466f6be Store recipient unregistered state 2024-01-28 22:38:41 +01:00
AsamK
6a5dcd00b2 Implement remote storage sync
Closes #604
2024-01-28 22:38:41 +01:00
AsamK
6c65de8ddf Update libsignal-service 2024-01-26 23:32:29 +01:00
AsamK
f696097301 Improve JobExecutor 2024-01-25 21:47:40 +01:00
AsamK
7d3db03d4a Update dbusjava 2024-01-25 21:03:25 +01:00
AsamK
78c87e501e Improve log level 2024-01-25 21:00:16 +01:00
AsamK
2974b466aa Update sqlite 2024-01-22 18:40:46 +01:00
AsamK
ca1a852b44 Handle mentions when receiving from dbus 2024-01-22 18:40:39 +01:00
dependabot[bot]
ac2343b142
Bump h2 from 0.3.21 to 0.3.24 in /client (#1418)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.21 to 0.3.24.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.24/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.21...v0.3.24)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-20 09:18:20 +01:00
AsamK
be9efb9a25 Update libsignal-service-java 2024-01-14 11:42:48 +01:00
AsamK
30e8e36635 Add --unrestricted-unidentified-sender to updateAccount command 2024-01-13 16:00:55 +01:00
AsamK
3290a5bf4d Add --notify-self parmeter
Fixes #1087
2024-01-12 18:09:42 +01:00
AsamK
c07ba14fc6 Update dependencies 2024-01-04 18:09:36 +01:00
AsamK
c6e9e19858 Update libsignal-service-java 2024-01-04 18:00:19 +01:00
morph027
375bdb7948
add file.encoding=UTF-8 to native builds, refs #1105 (#1404)
Signed-off-by: morph027 <stefan.heitmueller@gmx.com>
2023-12-19 18:48:54 +01:00
AsamK
5e7899675e Update CHANGELOG.md 2023-12-15 19:53:35 +01:00
AsamK
328ba0202f Bump version to 0.12.7 2023-12-15 19:10:56 +01:00
AsamK
59cbbde835 Update CHANGELOG.md 2023-12-15 19:05:13 +01:00
AsamK
caa4fa0180 Fix inspection issues 2023-12-15 17:32:30 +01:00
AsamK
fc6a4b78eb Update libsignal-service-java
Uses new device link endpoint

Fixes #1399
2023-12-14 18:07:13 +01:00
AsamK
2729772adb Fix release pipeline 2023-12-11 19:11:26 +01:00
AsamK
70e0f7027e Bump version to 0.12.6 2023-12-11 18:32:25 +01:00
AsamK
4dcdffda0a Use a new SVR2 enclave. 2023-12-10 19:30:36 +01:00
AsamK
2535cd9c2c Update libsignal-service-java 2023-12-10 18:57:05 +01:00
AsamK
d3eef6c820 Update dependencies 2023-12-06 18:12:17 +01:00
AsamK
35fb1d60af Update gradle wrapper 2023-12-06 18:11:27 +01:00
AsamK
089ec22666 Fix overlapping sqlite sessions in migration
Fixes #1394
2023-12-06 18:09:02 +01:00
AsamK
66077f317b Add missing capabilities for linking account
Fixes #1386
2023-11-28 19:12:53 +01:00
AsamK
5904bfa92b Update CHANGELOG 2023-11-21 21:14:16 +01:00
AsamK
2c1d7a803f Set snapshot version 2023-11-21 21:10:44 +01:00
AsamK
6d5b8b6a7b Bump version to 0.12.5 2023-11-21 21:07:54 +01:00
AsamK
b88f8c205e Update dependencies 2023-11-21 21:02:47 +01:00
AsamK
ce4afbe4c2 Update libsignal-service-java
Fixes #1384
2023-11-21 21:02:47 +01:00
AsamK
fcaecef961 Improve source serviceId handling 2023-11-21 19:59:06 +01:00
AsamK
81d2e315e3 Prevent groupV2Operations from being null 2023-11-21 17:17:26 +01:00
AsamK
fddf982832 Fix receiving contact address
Fixes #1385
2023-11-21 17:09:21 +01:00
AsamK
3602ef9be9 Add -u flag to send to username 2023-11-21 17:09:21 +01:00
AsamK
37c65ca6b4 Implement username links 2023-11-21 17:09:21 +01:00
AsamK
77f284661b Fix storing of username 2023-11-12 19:33:40 +01:00
AsamK
0d60c4d464 Refactor group v2 migration 2023-11-12 19:33:40 +01:00
AsamK
f06eeb01b9 Refactor getGroup method 2023-11-12 15:21:29 +01:00
AsamK
fbcc1cfb50 Refactor KeyValueStore 2023-11-12 14:24:26 +01:00
AsamK
26cef99cdf Don't store self profile key in recipient store 2023-11-12 13:13:58 +01:00
AsamK
5cac7feabe Add who am I job 2023-11-12 12:12:02 +01:00
AsamK
d844e0f396 Add download profile avatar job 2023-11-12 11:59:48 +01:00
AsamK
ed11bf6368 Make JobExecutor execute jobs asynchronously 2023-11-12 11:51:38 +01:00
AsamK
eaa6b7cf57 Check whoAmI after regular CDSI sync 2023-11-11 18:12:22 +01:00
AsamK
f8ea631b03 Refactor trusted recipient resolver 2023-11-11 17:24:45 +01:00
AsamK
7b0744ec75 Add --hide parameter to removeContact command 2023-11-11 11:39:33 +01:00
AsamK
9f4a2b3e26 Convert Contact to record 2023-11-11 11:09:24 +01:00
AsamK
9741c93ce9 Move all dbus interaction to dbus package 2023-11-10 15:44:42 +01:00
AsamK
7e9940be4a Refactor DaemonCommand 2023-11-10 15:32:45 +01:00
AsamK
c0aa338d7c Reorder static final modifier 2023-11-10 14:03:13 +01:00
AsamK
b20978e08e Remove now unnecessary SuccessExitStatus from systemd units 2023-11-09 23:26:38 +01:00
AsamK
5d33f71d4d Use improved shutdown for receive command 2023-11-09 19:23:11 +01:00
AsamK
1058e33f12 Use improved shutdown for daemon command 2023-11-09 19:23:11 +01:00
AsamK
b7fedff511 Use improved shutdown for jsonRpc command 2023-11-09 19:23:11 +01:00
AsamK
f252597002 Add infrastructure for better shutdown handling 2023-11-09 19:23:11 +01:00
AsamK
cbbfc4ea6e Rename exportManager method 2023-11-09 18:54:17 +01:00
AsamK
6b04197eaa Refactor getManagerFromQuery method 2023-11-09 18:54:17 +01:00
AsamK
3027ba2cf1 Refactor log config 2023-11-09 15:55:43 +01:00
AsamK
19e9f31afd Remove now unnecessary try/catch 2023-11-09 09:22:46 +01:00
AsamK
5a1d2580cb Use a single PushServiceSocket 2023-11-09 09:22:46 +01:00
AsamK
cb5cace8da Update libsignal-service 2023-11-09 09:22:46 +01:00
AsamK
e734c125ad Ignore quotes without author
Fixes #1369
2023-11-08 12:40:34 +01:00
AsamK
d351f64fb1 Configure log LevelChangePropagator 2023-11-08 12:05:55 +01:00
AsamK
e61f587bfc Reduce use of printStackTrace 2023-11-07 09:28:29 +01:00
AsamK
4e8f0a41c7 Update dependencies 2023-11-07 09:11:36 +01:00
AsamK
4fbc97c92a Register java exit handlers in graalvm native build 2023-11-07 08:54:05 +01:00
AsamK
1e35ac380e Refactor DaemonCommand 2023-11-07 08:54:05 +01:00
AsamK
85b0647a3e Extract getReceiveConfig to utils 2023-11-07 08:54:05 +01:00
spezialist1
7b899d1853
Add example syntax for a mixed text style (#1367) 2023-11-06 11:58:11 +01:00
AsamK
699b21f066 Handle rate limit error in JSON-RPC mode 2023-11-05 16:20:33 +01:00
AsamK
8d423adb4d Use safety numbers with ACI by default 2023-11-05 11:59:09 +01:00
AsamK
506dcfa6c0 Update README.md 2023-11-04 11:32:42 +01:00
AsamK
91e0d5164b Ensure profile key is stored in profileKeyStore
Fixes #1362
2023-11-03 20:31:35 +01:00
AsamK
67d8ffcde5 Initialize database before registering 2023-11-03 20:19:41 +01:00
AsamK
44c9aded65 Don't check self number in recipients refresh 2023-11-03 20:01:05 +01:00
AsamK
f1ccfc0361 Initialize pre key offsets when creating new account 2023-11-03 20:00:26 +01:00
AsamK
cdef9c435c Check if account is already registered before attempting verification 2023-11-03 19:59:39 +01:00
AsamK
ed8ac5b84c Use new threads API 2023-10-24 17:36:32 +02:00
AsamK
8d55dfb66b Use pattern matching switch cases 2023-10-24 17:36:32 +02:00
AsamK
80c1a6d2af Switch to Java 21 2023-10-24 17:36:32 +02:00
AsamK
895740755d Remove included by default native-image component 2023-10-23 18:01:49 +02:00
AsamK
90601b7b6b Fix man page generation 2023-10-22 21:33:15 +02:00
AsamK
cc2ffbb4da Bump version to 0.12.4 2023-10-22 20:49:22 +02:00
AsamK
0c24064939 Bump version to 0.12.4 2023-10-22 20:42:25 +02:00
AsamK
7859084be8 Fix tests 2023-10-22 20:42:25 +02:00
AsamK
101c217ef8 Update captcha help text 2023-10-22 20:42:25 +02:00
AsamK
7887a5a613 Prevent unnecessary compile warnings 2023-10-22 20:42:25 +02:00
AsamK
800ff09a37 Update dependencies 2023-10-22 20:42:25 +02:00
AsamK
20f8fa2ebd Prevent ConcurrentModificationException
Fixes #1351
2023-10-22 20:42:25 +02:00
AsamK
314159c273 Update libsignal-service-java 2023-10-22 20:42:25 +02:00
Vladimir Glinskikh
bf16885278
Bump upgrade gradle from 8.3 to 8.4 (#1353) 2023-10-21 12:49:28 +02:00
AsamK
3ae6f7ab7c Update graalvm reflect-config 2023-10-19 23:31:41 +02:00
AsamK
e829dd8b5c Update graalvm reflect-config
Fixes #1352
2023-10-19 23:18:07 +02:00
dependabot[bot]
62c71eaafa
Bump rustix from 0.37.23 to 0.37.25 in /client (#1350)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.37.23 to 0.37.25.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.37.23...v0.37.25)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 08:01:22 +02:00
AsamK
24ec25ac62 Fix typo 2023-10-18 22:57:51 +02:00
Pēteris Caune
19b5c76154
Fix typo (#1348) 2023-10-18 07:47:10 +02:00
AsamK
2852b2ea6d Extend log scrubber for dbus serviceIds 2023-10-17 23:05:45 +02:00
AsamK
fc2e9bbfae Fix inspections 2023-10-17 20:34:21 +02:00
AsamK
d51dd7ae57 Use .isEmpty() for checking lists and strings 2023-10-17 20:34:21 +02:00
AsamK
9ba70c1808 Update bouncycastle dependency 2023-10-17 19:48:22 +02:00
AsamK
9ec942ea1d Update workflow permission 2023-10-17 19:34:42 +02:00
AsamK
b9e644269b Use gradle-build-action for caching and dependency submission 2023-10-17 19:22:09 +02:00
AsamK
5b56445741 Update github checkout action 2023-10-17 19:21:41 +02:00
AsamK
1ed5148624 Bump version to 0.12.3 2023-10-17 15:24:56 +02:00
AsamK
fb7c63c507 Reduce sqlite logging 2023-10-17 15:21:18 +02:00
AsamK
2c5edbc981 Add cache for serviceId to recipient id/address mapping 2023-10-17 15:20:14 +02:00
AsamK
1addffe622 Store username aci link in recipient store 2023-10-17 14:58:15 +02:00
AsamK
733c14bbc8 Ignore invalid recipient numbers 2023-10-17 14:19:32 +02:00
AsamK
ca2e6adedb Update dependencies 2023-10-17 14:18:35 +02:00
AsamK
5cc20ace1f Ignore failures from SVR v1 pin 2023-10-17 13:34:09 +02:00
AsamK
400dcf2899 Refactor creating linked account files 2023-10-16 19:01:31 +02:00
AsamK
dd3326f038 Do a full recipients refresh every day 2023-10-16 19:01:31 +02:00
AsamK
505de39d2a Use partial cdsi request only for a maximum of 3 numbers
Fixes #1239
2023-10-16 19:01:08 +02:00
AsamK
24069c8277 Update documentation 2023-10-15 22:37:46 +02:00
AsamK
bb78e9aaeb Update libsignal-service-java 2023-10-15 22:37:01 +02:00
AsamK
5c39344cff Implement full CDSI refresh 2023-10-15 22:36:45 +02:00
AsamK
7cd24a74af Improve handling of CDSI resource exhaustion 2023-10-15 19:02:59 +02:00
AsamK
a675631965 Resolve self address after setting new PNI 2023-10-15 18:53:24 +02:00
AsamK
33c4e17c0d Implement change phone number
Closes #1240
2023-10-14 23:37:23 +02:00
AsamK
56ee173d03 Implement exit code for rate limiting error
Closes #1240
2023-10-13 19:36:58 +02:00
AsamK
af4709255a Fix creation of key_value table for new accounts 2023-10-13 12:54:30 +02:00
AsamK
527e1aefc9 Refactor generateSignedPreKeyRecord 2023-10-12 21:15:19 +02:00
AsamK
a66dd0dc79 Implement EditMessageReceived signal for dbus 2023-10-10 20:21:40 +02:00
AsamK
7b5b5776f0 Add --quote-attachment paramter to send command
Fixes #1318
2023-10-10 19:54:45 +02:00
AsamK
91ab0b12b0 Rename pre key id offset field 2023-10-09 19:13:45 +02:00
AsamK
c2ea7045f5 Prevent deleting self recipient 2023-10-09 19:13:45 +02:00
AsamK
af3cae5f3d Restructure account save file 2023-10-09 19:13:45 +02:00
AsamK
54c3b19052 Support serviceId based safety number for scannable safety numbers 2023-10-06 21:42:28 +02:00
AsamK
04de0010b5 Update libsignal-service-java 2023-10-06 19:58:09 +02:00
AsamK
66161b74a6 Move aci/pni to account data object 2023-10-06 19:53:32 +02:00
AsamK
889ef66784 Update release pipeline
The default libsignal-client jar now contains Linux/macOS/Window native library
2023-10-06 18:55:13 +02:00
AsamK
fae83f8d22 Extend json-rpc man page 2023-10-05 22:18:36 +02:00
AsamK
6f4d538832 Execute JSON-RPC requests in parallel 2023-10-05 22:18:13 +02:00
AsamK
a0c345185b Move metadata to db 2023-10-04 20:19:07 +02:00
AsamK
c0f771684d Move configuration store to db 2023-10-04 20:19:07 +02:00
AsamK
90ec01bfbf Only output username if set 2023-10-04 17:10:16 +02:00
AsamK
7f83bfefd6 Reorganize SignalAccount 2023-10-02 12:09:41 +02:00
AsamK
310aadbdc0 Fix handling edit message 2023-10-01 17:06:07 +02:00
AsamK
6b2de3a24d Reduce hikari logging noise 2023-10-01 16:30:14 +02:00
AsamK
002a87d3ba Add pre key cleanup and improve refresh 2023-10-01 16:29:41 +02:00
AsamK
6f63346905 Fix log statement 2023-09-30 22:32:45 +02:00
AsamK
735766669e Convert classes to records 2023-09-30 22:26:08 +02:00
AsamK
0dda8b405e Bump version to 0.12.2 2023-09-30 21:36:12 +02:00
AsamK
47626b2af4 Update libsignal-service 2023-09-30 21:28:02 +02:00
AsamK
fed2c94431 Update libsignal-service 2023-09-24 18:03:38 +02:00
AsamK
da7428d6bd Switch to zulu java distribution 2023-09-24 17:49:00 +02:00
AsamK
dced7a14c8 Remove jetbrains annotation 2023-09-23 17:48:03 +02:00
AsamK
f1d735f93d Update libsignal-service 2023-09-23 16:21:19 +02:00
AsamK
73b4239744 Add libsignal_client_path property to override libsignal-client jar fiel 2023-09-23 12:37:23 +02:00
AsamK
67747253e8 Improve message cache behavior in case of io error 2023-09-23 12:25:30 +02:00
AsamK
0bdc400a30 Update java version in ci workflow 2023-09-23 11:54:30 +02:00
AsamK
b12a016f3a Update graalvm build tools 2023-09-23 11:52:49 +02:00
AsamK
fd851ba6cb Fix batch response in case of empty responses list
This adapts the implementation to the JSON-RPC specification.
2023-09-23 11:52:37 +02:00
AsamK
b2a32666e9 Store serviceId in protocol stores as TEXT
ServiceIds are no longer just UUIDs, they can now have prefixes like "PNI:"
2023-09-23 11:51:50 +02:00
AsamK
a7744e837c Improve robustness in receiving messages 2023-09-16 12:00:55 +02:00
AsamK
e5aa10a730 Update README 2023-09-16 11:57:43 +02:00
AsamK
e626cc0390 Update dependencies 2023-09-08 19:19:15 +02:00
AsamK
4d93415485 Update graalvm buildtools 2023-09-08 17:54:07 +02:00
AsamK
ed746c389c Update libsignal-service 2023-09-08 17:53:49 +02:00
AsamK
a7a5947a1b Implement multi-account mode for jsonRpc command
Fixes #1319
2023-09-01 12:11:38 +02:00
AsamK
c8daef5113 Add --receive-mode parameter to jsonRpc command 2023-09-01 12:08:56 +02:00
AsamK
ee195c966e Update libsignal-service 2023-09-01 11:31:41 +02:00
AsamK
6ecda07577 Bump version to 0.12.1 2023-08-26 18:05:51 +02:00
AsamK
26fea2d6a0 Update dependencies 2023-08-26 18:05:26 +02:00
AsamK
87e79bceaa Fix output format of jsonrpc receive notification
Fixes #1313
2023-08-26 17:17:25 +02:00
AsamK
bc3bdbbf21 Improve identites listing 2023-08-26 16:33:39 +02:00
AsamK
884fa2748e Ensure uniqueness of dbus identity names 2023-08-22 11:56:27 +02:00
AsamK
4a37227b95 Improve logging 2023-08-22 11:52:22 +02:00
AsamK
a9f1944636 Show better error message when using addDevice on a linked device 2023-08-21 17:23:16 +02:00
AsamK
6d23eb3bf6 Show better error message when using addDevice on a linked device 2023-08-21 17:14:04 +02:00
AsamK
3d13c69e41 Extend logging 2023-08-21 17:02:12 +02:00
AsamK
fb8624f630 Fix incorrect sql query 2023-08-21 17:00:15 +02:00
AsamK
795c5f6a04 Fix npr when upgrading old accounts 2023-08-20 22:37:25 +02:00
AsamK
98a8c991e2 Update gradle wrapper 2023-08-20 22:36:29 +02:00
AsamK
e867c57af8 Add addStickerPack command 2023-08-20 22:36:18 +02:00
AsamK
133e2cc222 Document listStickerPacks command 2023-08-20 19:41:00 +02:00
AsamK
e0a326f15b Fix prekey log output 2023-08-20 19:40:42 +02:00
AsamK
b3f550ee68 Unsubscribe in client after timeout 2023-08-17 21:06:55 +02:00
AsamK
29923cf930 Bump version to 0.12.0 2023-08-11 00:43:19 +02:00
AsamK
9a63f97a19 Update dependencies 2023-08-11 00:43:19 +02:00
AsamK
2d73ba6735 Update graalvm reflect config 2023-08-11 00:36:22 +02:00
AsamK
8037fb2d66 Switch to jsonrpsee
Fixes #1275
2023-08-11 00:36:22 +02:00
AsamK
edbf803a98 Update dependencies 2023-08-11 00:36:22 +02:00
AsamK
b51c791629 Adapt receive subscription notification to have payload in result field 2023-08-11 00:36:22 +02:00
AsamK
6cbd583746 Update CHANGELOG.md 2023-08-09 21:23:10 +02:00
AsamK
b55d75ef99 Update dependencies 2023-08-09 21:14:17 +02:00
AsamK
5e692df08c Ignore groovy deprecations 2023-08-09 21:13:58 +02:00
AsamK
e19ad40023 Update graalvm build tools 2023-08-09 21:01:46 +02:00
AsamK
934697af28 Update libsignal-service-java 2023-08-09 20:48:52 +02:00
AsamK
ca088bcc33 Extend tests 2023-08-09 20:48:52 +02:00
AsamK
1559d28ed8 Fix linking when preKeyCount is not available 2023-08-09 20:48:52 +02:00
AsamK
376a1704df Add missing handling for SecureValueRecovery.RestoreResponse.Missing response 2023-08-09 19:38:29 +02:00
AsamK
68dbf27b2f Update staging key backup service id 2023-08-09 19:37:15 +02:00
AsamK
6bde5960aa Fix issues with pni parsing 2023-08-07 21:03:39 +02:00
AsamK
86e1079195 Update libsignal-service 2023-08-06 19:09:11 +02:00
AsamK
409a707baa Update libsignal-service 2023-07-20 20:58:49 +02:00
AsamK
86f50e0355 Add support for SVR2 2023-07-14 20:28:34 +02:00
AsamK
02d4cb4a14 Update libsignal-service-java 2023-07-14 19:25:32 +02:00
Benjamin Loison
2487fff44a
Remove unnecessary spaces in README.md and add sh syntax highlighting (#1270) 2023-07-05 10:13:21 +02:00
AsamK
ffeae1a95a Store last resort kyber pre key from PniChangeNumber message 2023-07-01 14:06:35 +02:00
AsamK
e57e5b090e Update libsignal-service-java 2023-06-24 01:18:47 +02:00
AsamK
c8e35991b9 Update dependencies 2023-06-23 21:48:02 +02:00
AsamK
0ebfd989d1 Refactor ACI/PNI store handling 2023-06-18 17:54:52 +02:00
AsamK
306e38c9ee Implement support for kyber pre keys 2023-06-17 22:32:05 +02:00
AsamK
4e5c859aab Update logback 2023-06-17 17:22:26 +02:00
AsamK
ac815f7598 Fix json deserialization for request params
Fixes #1261
2023-06-17 12:59:55 +02:00
AsamK
a3f7de89f1 Update graalvm buildtools 2023-06-17 12:21:15 +02:00
AsamK
b70a43aeb5 Update graalvm config 2023-06-17 10:44:02 +02:00
Adimarantis
8726c4ede0
Update identities after trust (#1264) 2023-06-17 09:21:28 +02:00
AsamK
0c5993c0ad Add support for invalid pre key failure when sending message 2023-06-11 17:47:48 +02:00
AsamK
da25b2a763 Add missing return to app command handling 2023-06-11 17:17:04 +02:00
AsamK
aad4b53524 Update dependencies 2023-06-11 17:16:38 +02:00
AsamK
3d5c440aa2 Improve uuid/number handling 2023-06-11 16:39:54 +02:00
AsamK
4f8da7819e Reformat code 2023-06-05 19:30:18 +02:00
Adimarantis
a96c4938b1
Dbus identities (#1259)
* Dbus Identities and Trust

* Update src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java

* PR feedback updates

* Documentation and consistent case sensitivity

* doc for listIdentities and getIdentity
2023-06-05 19:26:00 +02:00
AsamK
c62a1e829f Remove duplicate address resolving 2023-06-03 16:11:21 +02:00
AsamK
106af6a801 Refactor trust command implementation 2023-06-03 16:10:47 +02:00
AsamK
2ae5297f7d Refactor App init method 2023-06-02 22:52:45 +02:00
AsamK
a7db3a5610 Extract dbus client command handling 2023-06-02 22:43:18 +02:00
AsamK
d0d3e20713 Add helper method to create valid dbus object path 2023-06-02 21:29:58 +02:00
AsamK
c852bd8a85 Remove libsignal logs on console, when log-file is given 2023-05-30 13:03:00 +02:00
AsamK
7499b41d6b Remove old methods/classes from graalvm config 2023-05-30 13:02:09 +02:00
AsamK
ee12805d05 Bump version to 0.11.11 2023-05-24 23:05:58 +02:00
AsamK
dacb48b4f4 Update sqlite-jdbc 2023-05-24 23:05:58 +02:00
AsamK
90f82b6d4c Update libsignal-service 2023-05-24 22:40:04 +02:00
AsamK
227f87e1ce Fallback to legacy send if group send fails due to invalid prekey 2023-05-23 19:34:13 +02:00
AsamK
83c75acd0a Log signal-cli version on startup 2023-05-23 19:34:13 +02:00
AsamK
ff162cb44d Refactor addDeviceLink method 2023-05-23 19:34:13 +02:00
AsamK
e5a67d6ce1 Refactor manager lib package structure 2023-05-23 19:34:13 +02:00
exquo
5197212d3f
Fix TextStyle doc example typo (#1251) 2023-05-22 17:35:34 +02:00
AsamK
8c1b5d54f7 Reduce log output of third party libs
Fixes #1064
2023-05-21 11:49:26 +02:00
AsamK
8a0005d900 Remove unused code 2023-05-21 11:18:18 +02:00
AsamK
a754eb6faf Better logging for registration failure 2023-05-21 11:15:49 +02:00
AsamK
c9082a63f0 Update user agent version 2023-05-21 11:05:59 +02:00
AsamK
314b3cafbb Refactor selfNumber in send command 2023-05-20 13:01:54 +02:00
AsamK
91700ce995 Implement textStyles for sending and receiving
Fixes #1250
2023-05-20 12:49:57 +02:00
AsamK
145a2f1179 Fix json deserialization in legacy stores
Fixes #1248
2023-05-18 11:08:57 +02:00
AsamK
6e61bc2000 Update dependencies 2023-05-18 11:00:22 +02:00
AsamK
9da6f3a702 Include all libsignal-client libs in native build
Fixes #1237
2023-05-17 19:51:57 +02:00
AsamK
760934d5a5 Fix deleting old unregistered recipient
Fixes #1242
2023-05-16 23:09:07 +02:00
AsamK
a3bc754e80 Fix migration of legacy recipient storage 2023-05-16 22:50:27 +02:00
AsamK
ae652b1294 Update graalvm buildtools 2023-05-16 22:49:59 +02:00
AsamK
ab01867235 Switch CI to temurin distribution 2023-05-11 20:20:51 +02:00
AsamK
6b0b36a555 Bump version to 0.11.10 2023-05-11 19:36:26 +02:00
AsamK
ee63a27fe9 Use Java 20 in CI build 2023-05-11 19:19:09 +02:00
AsamK
5f0c49d653 Update dependencies 2023-05-11 19:18:48 +02:00
AsamK
8a31b7f2c1 Implement editing of previous messages 2023-05-11 19:10:29 +02:00
AsamK
72390e595d Update libsignal-service-java 2023-05-11 17:45:23 +02:00
AsamK
e0e8e11443 Validate incoming messages before handling them 2023-04-23 19:57:06 +02:00
AsamK
f7f882e834 Use modern switch syntax 2023-04-23 19:55:23 +02:00
AsamK
60ad582012 Store envelopes using envelope proto 2023-04-23 19:39:36 +02:00
AsamK
f6aebb5917 Bump version to 0.11.9.1 2023-04-23 10:19:25 +02:00
AsamK
3a4ad96a00 Fix build with java 20
- previous fix required a jdk 17 to be installed as well
2023-04-22 19:19:00 +02:00
AsamK
e0ed651e53 Bump version to 0.11.9 2023-04-22 17:54:49 +02:00
AsamK
c703644dbe Fix build with java 20 2023-04-22 12:44:42 +02:00
AsamK
da4cc7dc6b Announce support for gift badges if linked device
Fixes #1226
2023-04-16 21:19:17 +02:00
AsamK
842f13b2fc Update libsignal-service-java 2023-04-16 21:19:17 +02:00
AsamK
d2251ccd14 Remove old libzkgroup fallback code 2023-04-16 21:09:24 +02:00
AsamK
6a3ebfd4c8 Update graalvm buildtools native 2023-04-13 18:08:52 +02:00
AsamK
ff803eaf45 Update gradle wrapper 2023-04-13 18:08:01 +02:00
AsamK
c93480692c Bump version to 0.11.8 2023-04-05 11:40:13 +02:00
AsamK
542a3f36a4 Fix issue with unknown identity serviceId
Fixes #1215
2023-04-05 11:25:53 +02:00
AsamK
24a8c528d0 Filter null from db result 2023-04-05 11:22:43 +02:00
AsamK
780c69d804 Reduce use of unknown serviceIds 2023-04-05 11:10:46 +02:00
AsamK
22c948166a Add labels to Containerfile 2023-04-04 12:02:24 +02:00
AsamK
64436bc9ab Refresh username after registering 2023-04-04 11:43:50 +02:00
AsamK
6106e1878b Update README.md 2023-04-03 19:00:56 +02:00
AsamK
c788c5a40e Add capabilities and read receipt handling to provisioning 2023-04-03 19:00:27 +02:00
AsamK
9f60ed534a Implement support for usernames 2023-04-03 19:00:05 +02:00
AsamK
03f193b34c Fix deleting old group in dbus mode
Fixes #1192
2023-04-02 19:25:49 +02:00
signals-from-outer-space
db42f61cbb Added missing file attachment attributes in JsonAttachment output
Closes #1217
Fixes #1216
2023-04-02 18:49:42 +02:00
exquo
49591aedb4
Document accepting group invitations (#1218) 2023-04-02 17:58:54 +02:00
AsamK
21aa2b2a7f Update dependencies 2023-04-01 12:35:46 +02:00
AsamK
276ecef300 Update libsignal-service-java
- Use session based number verification and registration
2023-04-01 12:19:53 +02:00
AsamK
20b3563f21 Update gradle wrapper 2023-03-18 21:06:59 +01:00
cedb
15630356e1 Change content-type check to check contains
So far it was doing an equals check, but a string like "application/json; charset=utf-8"
is similarly valid. And some clients like OkHttp actually automatically add the
charset.

Closes #1152
2023-03-03 18:11:56 +01:00
AsamK
f1fd528483 Fix sending large text messages to multiple recipients
Fixes #1177
2023-03-03 18:06:31 +01:00
AsamK
75d7270d5a Add verbose exception log for send error 2023-03-03 17:58:02 +01:00
AsamK
3206639778 Scrub E164 in dbus path
Related #1189
2023-02-19 20:18:05 +01:00
AsamK
2e63c3b4f7 Update CHANGELOG.md 2023-02-19 16:05:14 +01:00
AsamK
d63405d170 Bump version 2023-02-19 14:59:33 +01:00
AsamK
91e0db185c Fix remove recipient method
Fixes #1183
2023-02-19 14:21:16 +01:00
AsamK
f97543eecd Update gradle 2023-02-19 14:21:16 +01:00
AsamK
3606fb67bb Update libsignal-service-java 2023-02-19 14:21:16 +01:00
AsamK
426b59d13e Add dependencyResolutionManagement 2023-02-19 13:58:33 +01:00
AsamK
d94ec8e144 Update dependencies 2023-02-19 13:28:44 +01:00
Marvin A. Ruder
4186349bba
Bump sqlite-jdbc from 3.40.0.0 to 3.40.1.0 (#1178)
* Should fix #1129
2023-02-06 18:20:32 +01:00
AsamK
7816325e63 Fix issue with missing pni identity key
Fixes #1176
2023-02-05 12:49:12 +01:00
AsamK
15da210de7 Print text styles in plain text output 2023-01-27 21:46:39 +01:00
AsamK
a4f7632981 Update dependencies 2023-01-27 21:44:41 +01:00
AsamK
a1b16a9118 Update CONTRIBUTING.md 2023-01-27 21:25:40 +01:00
AsamK
c100b504dc Document submitRateLimitChallenge 2023-01-21 19:42:49 +01:00
AsamK
161ec9f828 Update dependencies 2023-01-07 12:14:47 +01:00
AsamK
210466e7d9 Allow JSON-RPC commands without account param if only one account exists 2022-12-30 13:50:40 +01:00
AsamK
0702159596 Bump version 2022-12-18 20:09:15 +01:00
AsamK
8d7e533196 Update dependencies 2022-12-18 20:05:53 +01:00
AsamK
47feda6ae4 Restrict workflow permissions 2022-12-04 23:16:53 +01:00
AsamK
44c945f45d Update dependencies 2022-11-24 17:31:11 +01:00
ced-b
35def4445d
Fix handling of attachments in JSON RPC (#1109)
* Fix handling of attachments in JSON RPC

It turns out that using a custom serializer on an
input stream did not work well. For one the stream seems
to be getting closed before the JSON gets written. But
also the method for writing it was throwing an
UnsupportedOperationException further down in Jackson.

The above simplifies the matter by simply outputting the
Base64 string first and then setting it on the model.

* Add missing files to attachment fix

Co-authored-by: cedb <cedb@keylimebox.org>
2022-11-24 17:29:45 +01:00
ced-b
3e60303b90
Add alive check (#1107)
Adds a simple HTTP endpoint that can be used by the container
environment to see if the app is started and available.

Co-authored-by: cedb <cedb@keylimebox.org>
2022-11-22 07:58:34 +01:00
AsamK
b6e9dfa97d Add fallback locale for voice verification
Fixes #1101
2022-11-20 11:27:33 +01:00
AsamK
5771bb858f Allow using data URIs for updateGroup/updateProfile avatars
Fixes #1082
2022-11-14 19:31:40 +01:00
AsamK
dcaf1cc189 Bump version 2022-11-09 19:00:59 +01:00
AsamK
5e1fc79c33 Fix SignalAccount initialization
Fixes #1092
2022-11-08 17:18:24 +01:00
AsamK
8997d7f91f Update README.md 2022-11-08 17:18:22 +01:00
AsamK
54a08f560e Bump version 2022-11-07 20:12:41 +01:00
AsamK
ccb37c00f6 Update dependencies 2022-11-07 19:43:15 +01:00
AsamK
6281cbfd5f Catch all exceptions when reading session record
Fixes #1083
2022-11-03 15:55:12 +01:00
AsamK
6502f3f487 Publish docker image to ghcr 2022-11-03 15:33:28 +01:00
AsamK
00535c9a42 Package native file as executable 2022-11-03 15:18:59 +01:00
AsamK
e6cf11cb3d Add missing check to httpAddres 2022-11-03 15:10:17 +01:00
AsamK
c5eb0fd351 Rework release workflow 2022-11-03 13:31:37 +01:00
AsamK
a780be70dd Add http endpoint events with SSE 2022-11-03 00:03:37 +01:00
AsamK
1d98e5307a Handle missing separator in query string parser 2022-11-02 23:16:38 +01:00
AsamK
36abb8ae8f Add check for exact path match
HttpExchange just checks startsWith, so would also match /api/v1/rpcfoobar
2022-11-02 21:17:28 +01:00
AsamK
0c4642aa20 Fix length for empty response to prevent chunked stream
The java HttpExchange expects length -1 to send Content-length: 0 ...
2022-11-02 21:15:08 +01:00
AsamK
1b029b765f Extract http endpoint handler function 2022-11-02 21:13:52 +01:00
AsamK
9563496efb Update CHANGELOG.md 2022-11-02 17:47:52 +01:00
AsamK
c628e27d2e Update man page 2022-11-02 17:46:20 +01:00
ced-b
1ad0e94b64
Exposing Signal CLI as HTTP Server (#1078)
* Add initial proof of concept for http server

* Add support for registration commands

* Add support  for MultiLocalCommands

* Improve handling of HTTP responses

Makes it so that responses area all uniformly JSON and wrapped
into the proper response envelope.

* Add caching for workflows

* Run http server with daemon command

This fits the existing command line API better

* Wrap the existing JSON RPC handler in HTTP Service

This is a redesign of earlier attempts to make an HTTP service. Fixing
that service turned out that it would have to be a copy of the
SignalJsonRpcDispatcherHandler. So instead of copy pasting all the
code the existing service is simply being wrapped.

* Switch http server to use command handler

* Clean up and simplification

* Pass full InetSocketAddress

* Minor fixes and improvements

Based on code review.

Co-authored-by: cedb <cedb@keylimebox.org>
2022-11-02 17:44:12 +01:00
AsamK
43face8ead Small improvements 2022-11-01 22:48:47 +01:00
ced-b
2e4d346bc8
Add command to get an attachment (#1080)
* Add command to get an attachment

* Refactor retrieving of attachments to use StreamDetails

* Refactor AttachmentCommand to GetAttachmentCommand

* Minor improvements to GetAttachmentCommand

* Use JSON serializer to serialize binary data

Serializing the stream is better for memory handling than
loading the whole thing into the file.

* Clean up unneeded class

* Added command to doc

Co-authored-by: cedb <cedb@keylimebox.org>
2022-11-01 22:47:43 +01:00
AsamK
bf76c04664 Refactor JsonRpcReader to for handling a single message 2022-11-01 18:06:40 +01:00
AsamK
ae678871ec Extract JSON-RPC command handler 2022-11-01 17:10:15 +01:00
AsamK
9620eb06ac Update libsignal-service 2022-11-01 13:58:09 +01:00
AsamK
9096229637 Improve behavior with synchronous and asynchronous receivers 2022-11-01 13:58:09 +01:00
AsamK
eec3d782d3 Add caching for workflows 2022-10-31 16:40:39 +01:00
AsamK
43a7478791 Update reflect-config.json 2022-10-31 15:29:18 +01:00
AsamK
175057e781 Implement receive command for JSON-RPC mode
The command returns a list of messages, as soon as the timeout is reached
after the last message has been received or the maximum number of messages
has been received.
2022-10-31 11:56:25 +01:00
AsamK
de2bfc7f79 Add optional message limit for receive command 2022-10-31 11:17:52 +01:00
AsamK
5ed9db4f08 Implement replying to stories 2022-10-30 18:18:21 +01:00
AsamK
fea19c9e20 Implement reacting to stories 2022-10-30 14:41:02 +01:00
AsamK
207764e0be Add option to disable adding message to send log 2022-10-30 11:00:25 +01:00
AsamK
49aaff2bbe Increase sqlite busy timeout 2022-10-29 13:54:06 +02:00
AsamK
25e84f2f5d Add account to plain text output
Fixes #1075
2022-10-29 13:49:14 +02:00
AsamK
e63f2fafb9 Add color to listContacts output
Fixes #1072
2022-10-28 20:12:11 +02:00
AsamK
0b5a063b62 Use complete address instead of only identifier for retry envelope
Fixes #1074
2022-10-28 18:13:25 +02:00
AsamK
e0c2f58e8d Store attachments with a file extension
Taken from the filename if present, otherwise guessed from the contentType
2022-10-22 22:00:31 +02:00
AsamK
0084a2e722 Update reflect-config.json 2022-10-22 17:43:15 +02:00
AsamK
7ff1500122 Improve logging in prekey store 2022-10-22 17:43:15 +02:00
AsamK
7805622f07 Send long text messages as attachment instead
This matches the behavior of the official clients.
2022-10-22 17:43:15 +02:00
AsamK
a8e68dce3a Extract MimeUtils 2022-10-22 17:43:15 +02:00
AsamK
b9eee539bd Add PNI to recipients 2022-10-21 22:02:33 +02:00
AsamK
e450f36e81 Don't output caption if it's empty 2022-10-21 16:22:09 +02:00
AsamK
ae221e0447 Disable graalvm toolchain detection if GRAALVM_HOME is set 2022-10-21 10:34:08 +02:00
AsamK
2a1be0bd85 Improve graalvm native build wih resource autodetect 2022-10-21 10:34:08 +02:00
AsamK
af324eeca5 Bump version 2022-10-19 20:35:53 +02:00
AsamK
eb71fd1a5a Add java 19 to CI 2022-10-19 20:34:42 +02:00
AsamK
e4a4788d5e Add native graalvm build to release 2022-10-19 20:34:16 +02:00
AsamK
47b6fe7dbe Enable story capability
Only receiving is supported
2022-10-19 19:11:37 +02:00
AsamK
9ffacfe90e Add --ignore-stories flag to prevent receiving story messages 2022-10-19 19:11:37 +02:00
AsamK
3f7d8c60b9 Add workaround for #1045 2022-10-19 17:51:12 +02:00
AsamK
2e5d8fe561 Add build graalvm native step for CI 2022-10-19 15:46:58 +02:00
AsamK
7188c75351 Update reflect-config 2022-10-19 15:36:17 +02:00
AsamK
316c35b258 Add additional logging for reading message cache 2022-10-19 11:02:10 +02:00
AsamK
9da42e27f1 Update workflow actions 2022-10-18 18:11:35 +02:00
AsamK
0aee7ff552 Update graalvm buildtools 2022-10-18 18:11:35 +02:00
AsamK
228713ebb5 Reset pre key offset if it somehow gets corrupted
Fixes #1055
2022-10-18 17:55:51 +02:00
AsamK
266129c61b Update reflect-config 2022-10-18 17:38:46 +02:00
AsamK
3522e43617 Update dependencies 2022-10-16 20:47:51 +02:00
AsamK
45a5795c9c Handle PniChangeNumber 2022-10-16 20:07:33 +02:00
AsamK
94d79692df Update to clap 4 2022-10-09 12:30:25 +02:00
AsamK
58bb4b5358 Update client dependencies 2022-10-09 12:18:43 +02:00
AsamK
51fef48016 Refactor resolve recipient 2022-10-08 17:42:03 +02:00
AsamK
7ab013cee9 Do recipient merge in one transaction 2022-10-08 17:42:03 +02:00
AsamK
f2b334b57a Refactor check for registered users 2022-10-08 17:42:03 +02:00
AsamK
7eb7ee44f2 Refactor RecipientAddress 2022-10-08 17:42:03 +02:00
AsamK
34cc64f8ce Ensure self profile key is always stored in profile store
Fixes #1040
2022-10-07 21:51:01 +02:00
AsamK
ca5951861a Fix issue when receiving invalid message from invalid sender 2022-10-07 21:50:07 +02:00
AsamK
605f31d1ad Improve handling of group join messages 2022-10-07 21:17:45 +02:00
AsamK
30167d81e6 Add missing check for story group context 2022-10-07 21:17:45 +02:00
AsamK
a247b444e5 Fix typo 2022-10-07 21:17:45 +02:00
AsamK
1424a2980f Approve join requests instead of just adding the member 2022-10-07 21:17:45 +02:00
AsamK
01e1115806 Refresh group before updating 2022-10-07 21:17:45 +02:00
AsamK
c9c8af42c2 Implement refuse group join requests 2022-10-07 19:49:43 +02:00
AsamK
489fb2ac22 Improve error message when joining a group with already pending admin approval 2022-10-07 19:31:27 +02:00
AsamK
a708025a16 GraalVM agent formatting changes 2022-10-07 19:30:34 +02:00
AsamK
31429b7faf Bump version 2022-10-07 17:24:29 +02:00
Benjamin Schmid
9c5235c273
fix(GraalVM): explictly declare symbols causing GraalVM compiler failure (#1037)
Fixes #1016
2022-10-07 17:16:32 +02:00
AsamK
8e717e00b1 Add missing urgent column to projection
Fixes #1031
2022-10-07 12:09:43 +02:00
AsamK
9a4693136d Fix update from old versions without PNI
Fixes #1032
2022-10-07 12:04:22 +02:00
AsamK
cf0110ab95 Update libsignal-service
Fixes #1030
2022-10-06 21:56:40 +02:00
AsamK
abc5d5e863 Bump version 2022-10-06 17:59:59 +02:00
technillogue
0c74338c9c Bump user agent version
Closes #1024
2022-10-06 17:57:48 +02:00
AsamK
1dd22132ff Update libsignal-service 2022-10-06 17:55:16 +02:00
AsamK
76c400d2c3 Show better error message when signal-cli version is outdated 2022-10-06 17:55:16 +02:00
ETL
d9472ec19c
Update user agent (#1023)
Recent changes from Signal caused DeprecatedVersionException to occur.

Changing the user agent debugged the receiving (sending still erroring)
2022-10-06 08:03:25 +02:00
AsamK
9d821fb892 Bump version 2022-10-05 20:08:24 +02:00
AsamK
8c6553ce73 Update dependencies 2022-10-05 20:08:21 +02:00
AsamK
1d4ed23394 Fix sending messages to groups
Fixes #1019
2022-10-03 21:31:30 +02:00
AsamK
c1fb44a145 Ignore md files in fat jar build 2022-10-03 21:30:01 +02:00
AsamK
333aacf4ab Delete migrated stores after closing the input stream
Fixes #1018
2022-10-03 13:38:41 +02:00
AsamK
5b5827f885 Update gradle 2022-10-03 13:13:41 +02:00
AsamK
6fbbf38a84 Fix building fatJar 2022-10-03 13:13:17 +02:00
AsamK
c1004fb4f8 Bump version 2022-10-02 18:16:12 +02:00
AsamK
de8ddb2a2b Update dependencies 2022-10-02 18:02:25 +02:00
AsamK
6feff1e42b Add sendPaymentNotification dbus method
Closes #1010
2022-09-18 16:56:30 +02:00
AsamK
ed3992d993 Use CDSI for contact discovery in compat mode 2022-09-17 12:21:28 +02:00
AsamK
60ed2c292f Update libsignal-service-java 2022-09-17 11:26:44 +02:00
AsamK
1d77153a2b Add --scrub-log flag to remove possibly sensitive information from the log 2022-09-04 11:15:23 +02:00
AsamK
2e8e81a926 Update dependencies 2022-09-02 22:33:48 +02:00
AsamK
c7aa9834a9 Fix default value for phone number sharing mode
Fixes #1002
2022-08-29 19:31:30 +02:00
AsamK
ac8925b2bd Always use content sender if available 2022-08-28 17:15:24 +02:00
AsamK
25fb1b08bc Log error for fatal load errors 2022-08-28 16:32:35 +02:00
AsamK
adcc88823f Create database tables with strict mode 2022-08-28 16:06:13 +02:00
AsamK
280d8d7f10 Key tables on serviceId instead of recipientId 2022-08-28 16:04:05 +02:00
AsamK
04fa046815 Move test config 2022-08-28 16:04:05 +02:00
AsamK
11a06d6b33 Extract method to read result set 2022-08-28 16:04:05 +02:00
AsamK
38c9fe9cb5 Store urgent field in database 2022-08-28 16:04:05 +02:00
AsamK
2c586266ff Disallow sending an empty message
It would be ignored by the offical apps anyway
2022-08-28 16:04:05 +02:00
AsamK
4120630309 Remove fallback to reading stdin if no message body is given
To read a message from stdin, use the `--message-from-stdin` flag
2022-08-28 16:04:05 +02:00
AsamK
1ea4309a2a Change meaning of -v flag from --version to --verbose 2022-08-28 16:04:05 +02:00
AsamK
08dc65350f Move sender key store to database 2022-08-28 16:04:05 +02:00
AsamK
0c4a037dde Move identity store to database 2022-08-28 16:04:05 +02:00
AsamK
dc8b83a110 Implement SignalServiceAccountDataStore for PNI 2022-08-28 16:04:05 +02:00
AsamK
484daa4c69 Move session store to database 2022-08-28 16:04:05 +02:00
AsamK
65c9a2e185 Move group store to database 2022-08-28 16:04:05 +02:00
AsamK
46adc1af98 Add RecipientIdCreator for creating recipientIds from the database 2022-08-28 16:04:05 +02:00
AsamK
7da2e1b262 Move pre key stores to database 2022-08-28 16:04:05 +02:00
AsamK
9a698929f4 Move sticker store to database 2022-08-28 16:04:05 +02:00
AsamK
862c2fec87 Move recipient store to database 2022-08-28 15:41:27 +02:00
AsamK
9d534dc7bb Store account file version after migration 2022-08-28 15:40:23 +02:00
AsamK
a25043e5d4 Add fallback KBS and migrate to current version 2022-08-28 15:35:15 +02:00
AsamK
cd77d3d410 Update KBS enclave 2022-08-28 15:35:11 +02:00
AsamK
0d72c03fa5 Update CDSI enclave 2022-08-19 17:01:24 +02:00
AsamK
173a2416fa Bump version to 0.10.11 2022-08-17 18:24:54 +02:00
AsamK
71fff4b14f Update sqlite-jdbc 2022-08-17 18:21:06 +02:00
AsamK
007acf8c6d Adapt log level when using system locale 2022-08-17 18:13:14 +02:00
AsamK
6843643aad Update libsignal-service-java 2022-08-11 20:17:21 +02:00
AsamK
64f6a1f072 Update CDS config 2022-08-11 18:59:40 +02:00
AsamK
b09811c1d4 Update libsignal-service-java 2022-08-09 23:20:19 +02:00
AsamK
a593051512 Implement receive handling for story messages 2022-08-09 23:20:12 +02:00
AsamK
81e36d4f9b Update libsignal-service-java 2022-08-03 18:02:56 +02:00
Sebastian Scheibner
597ac9b504 Update FUNDING.yml 2022-07-30 16:59:08 +02:00
AsamK
525f04d446 Update CHANGELOG.md 2022-07-30 16:52:20 +02:00
AsamK
d8a5244a88 Bump version to 0.10.10 2022-07-30 14:56:17 +02:00
AsamK
d69b9ea394 Update KBS enclave
Fixes #985
2022-07-28 17:00:09 +02:00
AsamK
7a42737287 Workaround possible GraalVM issue 2022-07-27 20:58:58 +02:00
AsamK
1cc21834e2 Workaround possible GraalVM issue
Fixes #987
2022-07-27 18:20:07 +02:00
AsamK
956cb97331 Update libsignal-service-java 2022-07-24 10:46:20 +02:00
AsamK
72293d8d87 Bump version to 0.10.9 2022-07-16 15:25:58 +02:00
AsamK
de583475f9 Update libsignal-service-java 2022-07-16 15:17:48 +02:00
AsamK
ed7d023581 Update gradle wrapper 2022-07-16 11:08:39 +02:00
AsamK
457b093dce Improve import of contact from storage 2022-07-16 11:08:39 +02:00
AsamK
dcde9fbe8e Use toList() Stream method 2022-07-16 11:08:39 +02:00
AsamK
f4346e3f0a Update account attributes before checking whoAmI 2022-07-16 11:08:39 +02:00
AsamK
9da2a00403 Fix issue with loading legacy profile store
Fixes #981
2022-07-15 20:13:36 +02:00
AsamK
1c7d1861d6 Update graalvm buildtools 2022-07-15 20:07:28 +02:00
AsamK
9f7979314f Prevent duplicate family name when handling contact sync message 2022-06-27 16:57:46 +02:00
AsamK
dca1d479e8 Update graalvm buildtools 2022-06-27 15:39:53 +02:00
AsamK
c586f58286 Reset cached storage manifest after provisioning/registering 2022-06-21 20:38:10 +02:00
AsamK
9553b1ef00 Check account identifiers on the server before updating the account attributes 2022-06-21 20:38:10 +02:00
AsamK
a4db5d616a Create master key before storage sync if it doesn't exist yet 2022-06-21 20:38:10 +02:00
AsamK
c1dc44d4fd Separate registrationLock attribute from master key 2022-06-21 20:38:10 +02:00
John Rush
6bbbccb9ac
Update README.md (#972)
Fix typo from "JSON-PRC" to "JSON-RPC".
2022-06-21 10:11:30 +02:00
AsamK
280bdbefdc Only send profile key update message from the primary device 2022-06-18 12:28:02 +02:00
AsamK
abebffb2cd Improve output for profile key update messages 2022-06-18 12:28:02 +02:00
AsamK
adce64bc21 Bump version 2022-06-13 15:46:03 +02:00
AsamK
4ea3d94d07 Improve number filtering of listContacts command
If the given number is not registered, don't output all recipients
2022-06-13 15:35:38 +02:00
AsamK
aaa6412469 Allow registering new accounts on both live and staging environments
in the same config directory
2022-06-12 17:29:25 +02:00
AsamK
c487929bcd Make version command work on the command line 2022-06-12 17:29:20 +02:00
AsamK
0b63e78d2b Add logging to test script 2022-06-12 17:29:03 +02:00
AsamK
e9e66e1005 Handle groups sync message again 2022-06-11 12:34:55 +02:00
AsamK
7bb690e58e Update libsignal-service-java 2022-06-11 12:34:55 +02:00
AsamK
26620f3137 Refactor identity key store 2022-06-09 21:05:36 +02:00
AsamK
c8cd36bde8 Unsubscribe receive if jsonRpcSender channel is closed 2022-06-08 17:51:18 +02:00
AsamK
7bf06aef5e Store self profile key in profile store after linking 2022-06-08 17:51:16 +02:00
AsamK
0e65e67077 Log more detailed provisioning errors 2022-06-08 17:51:11 +02:00
AsamK
936a68433d Add additional logging for payment address parsing 2022-06-08 15:21:24 +02:00
AsamK
8236696492 Fix typo 2022-06-08 15:00:57 +02:00
AsamK
1757e939e1 Reformat sql statements in MessageSendLogStore 2022-06-07 15:26:42 +02:00
AsamK
5afe9c5337 Rename ThreadInfo to LegacyThreadInfo 2022-06-07 15:15:44 +02:00
AsamK
5b5a1718e9 Update register error message 2022-06-07 11:53:53 +02:00
AsamK
51c2352d67 Extend logging when determining default locale 2022-06-06 17:14:17 +02:00
AsamK
3ad87e1362 Reformat 2022-06-06 17:13:41 +02:00
Kevin
cb5e3c6bf7
Added base64 encoded attachment support (#966)
* Added base64 encoded attachment support

* Added final

* Added full RFC 2397 support

* Added feedback

* Update doc

* Update signal-cli.1.adoc

Co-authored-by: Sebastian Scheibner <asamk@gmx.de>
2022-06-04 11:11:35 +02:00
AsamK
63e94a9fb4 Bump version 2022-05-29 22:25:53 +02:00
AsamK
badbb55ef2 Split given/family name in updateContact command 2022-05-29 22:21:24 +02:00
AsamK
27dbc671e0 Add option to send read receipts for all received data messages
Fixes #850
2022-05-26 18:00:23 +02:00
AsamK
fd92a96e1a Wrap ignoreAttachments option in a ReceiveConfig record 2022-05-26 17:53:14 +02:00
AsamK
8828b60288 Refactor SendReceiptAction to take type argument 2022-05-26 17:37:54 +02:00
AsamK
e03c48e0ae Use console charset for reading/writing to stdin/out 2022-05-26 15:01:36 +02:00
AsamK
425e451237 Update dbus-java 2022-05-26 15:01:36 +02:00
AsamK
d8d859ab02 Fix inspection issues 2022-05-26 12:23:21 +02:00
AsamK
b178c7c67a Implement sending link previews
Fixes #276
2022-05-25 23:23:33 +02:00
AsamK
0f701df91f Refactor attachment upload helpers 2022-05-25 22:31:15 +02:00
AsamK
b292de8ae6 Store retrieved storage manifest locally 2022-05-24 21:09:06 +02:00
AsamK
87016f6ecf Handle account record the same as other records when reading storage 2022-05-24 21:09:06 +02:00
AsamK
145962597c Store family name in recipient store 2022-05-24 21:09:06 +02:00
AsamK
9ad24614cb Rename main/master device to primary device 2022-05-24 14:36:33 +02:00
AsamK
ad65eb7ea2 Refresh pre keys after receiving a sync message with PNI identity 2022-05-23 17:43:55 +02:00
AsamK
ce7aeb02bc Only generate prekeys if the corresponding identity key exists 2022-05-23 17:39:18 +02:00
AsamK
5b1c6c0d64 Split contact name field in given name and family name 2022-05-23 16:42:38 +02:00
AsamK
69e952738b Update code style for text blocks 2022-05-23 16:26:07 +02:00
AsamK
621d822a6c Refresh self profile before rotating profile key 2022-05-23 16:24:42 +02:00
AsamK
3abb641c7c Reduce direct use of recipient store 2022-05-23 13:21:28 +02:00
AsamK
995eaa6e7c Print more detailed error message when registering with non-normalized number
Fixes #958
2022-05-22 22:01:11 +02:00
AsamK
cf07512d24 Update json-rpc client 2022-05-21 12:11:03 +02:00
Sebastian Scheibner
5a63b5419f
Update README.md 2022-05-21 11:47:46 +02:00
AsamK
34c0968f5e Add mobile-coin-address to updateProfile command 2022-05-21 10:44:28 +02:00
AsamK
bf75d9b4e0 Decrypt and verify the profile payment address 2022-05-21 10:44:28 +02:00
AsamK
3666531f8b Refactor manager update profile method 2022-05-21 09:29:58 +02:00
AsamK
7587a60387 Implement sendPayment notification command 2022-05-21 09:04:23 +02:00
AsamK
b18991b9fb Update documentation 2022-05-21 09:00:42 +02:00
AsamK
2ecddba375 Update json-rpc client 2022-05-20 12:11:28 +02:00
AsamK
5f941004f5 Extend listContacts command with profiles and filtering 2022-05-20 11:53:33 +02:00
AsamK
496cd5e621 Fix repackage if building with multiple java versions 2022-05-19 13:48:34 +02:00
AsamK
470aeadbd9 Bump version 2022-05-19 13:06:57 +02:00
AsamK
06e2811012 Only update profile keys from authoritative group changes 2022-05-19 12:55:37 +02:00
AsamK
be28d13d0d Update libsignal-service-java 2022-05-19 10:35:48 +02:00
AsamK
cf1626ea31 Rotate profile key after blocking a contact/group 2022-05-18 19:19:16 +02:00
AsamK
b1e56faab2 Store profile sharing enabled for contacts
Automatically enable it when sending direct messages
2022-05-18 19:12:55 +02:00
AsamK
06a9884e99 Don't reset avatar url path when updating profile with same avatar 2022-05-18 19:12:54 +02:00
AsamK
7ac6c9a170 Cleanup fileChannel if file locking fails 2022-05-18 16:04:35 +02:00
AsamK
53f47d42fc Refactor set blocked methods to accept multiple recipientIds/groupIds 2022-05-18 11:09:05 +02:00
AsamK
2d60f98e93 Keep unrestricted unidentified access if it was set before 2022-05-18 10:45:53 +02:00
AsamK
bb9d44811c Include unrestricted unidentified access state in getUserStatus response 2022-05-17 20:39:06 +02:00
AsamK
376fcba9ec Include reason for inactive group link in error message 2022-05-17 20:22:56 +02:00
AsamK
e844abcad1 Store payment address of profiles 2022-05-17 20:20:03 +02:00
AsamK
c3425979dd Added new parameter to filter the output of listGroups by groupId
Fixes #953
2022-05-16 15:22:03 +02:00
AsamK
68eb6b6bb4 Update graalvm config
Fixes #942
2022-05-16 14:35:34 +02:00
AsamK
f0fe1fac66 Update native-image handling in tests 2022-05-16 14:19:15 +02:00
AsamK
477e6516ed Prevent printing stack trace for unregistered users 2022-05-16 12:27:43 +02:00
AsamK
22add1cbee Add command to delete local account data
Fixes #912
2022-05-16 12:27:43 +02:00
AsamK
55dde93811 Store information if account is registerd on LIVE or STAGING env in account file
Fixes #896
2022-05-16 12:27:43 +02:00
AsamK
656282459c Add warning if user has no profile name set 2022-05-14 15:51:23 +02:00
AsamK
35679216f7 Extract getSelfProfile method 2022-05-14 15:51:23 +02:00
AsamK
a80e18169a Update libsignal-service-java 2022-05-14 15:51:23 +02:00
AsamK
5837a6982b Fix deleting a recipient which has no uuid
Fixes #946
2022-05-02 17:13:30 +02:00
AsamK
275be59c25 Fix graalvm native build
Fixes #944
2022-04-26 22:53:47 +02:00
AsamK
a0c304d3ca Update dependencies 2022-04-18 11:02:29 +02:00
AsamK
f968d9bf3b Use Java 17 for codeql 2022-04-12 15:45:42 +02:00
AsamK
0309c85c6a Update gradle wrapper 2022-04-12 15:44:23 +02:00
AsamK
59b2d2f5a1 Add Java 18 to CI workflows 2022-04-12 15:40:28 +02:00
AsamK
a48601b028 Update repackage-native-libs.yml 2022-04-11 23:02:41 +02:00
AsamK
406faa1bbb Bump version 2022-04-11 22:30:32 +02:00
AsamK
8f85d164ff Update reflect-config.json 2022-04-11 22:30:32 +02:00
AsamK
6893e91190 Update dependencies 2022-04-11 22:24:48 +02:00
AsamK
945ff44de3 Refresh pre keys for PNI identity
Fixes #930
2022-04-11 20:05:02 +02:00
AsamK
2a20e70aab Add support for banning/unbanning group members 2022-04-09 19:03:05 +02:00
AsamK
69f1d0c213 Workaround adoc issue 2022-04-09 19:03:05 +02:00
AsamK
2c15995289 Output RATE_LIMIT_FAILURE type more reliably in json output
Fixes #923
2022-04-06 22:35:51 +02:00
AsamK
af71115767 Update reflect-config.json 2022-04-06 22:34:34 +02:00
AsamK
02a018462b Prevent deleting a group locally if the user is still a member
Fixes #924
2022-04-06 22:28:07 +02:00
AsamK
8dc82a30af Fix check if there was a send error when creating a group without members
Fixes #925
2022-04-06 22:17:06 +02:00
AsamK
c8f819cb94 Fix output of rate limit exception 2022-04-06 22:09:22 +02:00
AsamK
d27a12a6cf Update libsignal-service-java 2022-03-29 21:37:06 +02:00
AsamK
86e5ef7382 Fix plain text output of blocked group ids 2022-03-27 18:57:21 +02:00
AsamK
b5d578e483 Update graalvm build tools plugin 2022-03-27 18:56:36 +02:00
AsamK
9eb97746c1 Update libsignal-service-java 2022-03-17 23:33:57 +01:00
AsamK
fd25ef539f Bump version 2022-03-17 22:33:43 +01:00
AsamK
4f5d5afc4f Use correct captcha url in test script 2022-03-17 21:49:29 +01:00
AsamK
0686fd8e68 Fix multi account commands for newly created accounts
Fixes #913
2022-03-17 21:45:30 +01:00
AsamK
942999b7b4 Update libsignal-service-java 2022-03-16 21:08:41 +01:00
AsamK
3c2fa65e05 Fix NoSuchElementException in json serialization for messages from an untrusted identity
Fixes #910
2022-03-16 19:37:58 +01:00
AsamK
90df362c35 Bump version 2022-03-02 22:58:22 +01:00
AsamK
bf2a83755e Mark --target-timestamp flag as required for sendReceipt command
Fixes #901
2022-03-02 22:45:26 +01:00
AsamK
6f8784a1c9 Update libsignal-service-java
Fixes #897
2022-02-24 17:31:33 +01:00
AsamK
8b75504822 Bump version 2022-02-20 16:57:49 +01:00
AsamK
ec945cd227 Add --message-from-stdin flag for send command 2022-02-20 14:22:53 +01:00
AsamK
f3b2df62da Update libsignal-service-java 2022-02-20 14:22:53 +01:00
AsamK
2c44b65e9f Prevent preKeyIds from starting at zero 2022-02-20 14:22:53 +01:00
AsamK
1ffb6d6907 Handle UnsupportedOperationException in daemon command 2022-02-20 14:22:53 +01:00
AsamK
69fe3986cf Handle OverlappingFileLockException when linking 2022-02-20 14:22:53 +01:00
AsamK
abde122a35 Implement JSON-RPC client PoC 2022-02-20 14:22:49 +01:00
AsamK
7261129609 Rename error field in json receive response to exception 2022-02-19 18:47:11 +01:00
AsamK
3f582e9c2e Prevent a stale jsonrpc connection from interfering with message receiving
Fixes #893
2022-02-19 18:47:11 +01:00
AsamK
832604e763 Update graalvm build tools 2022-02-19 18:47:11 +01:00
AsamK
ccce539843 Improve error messages when daemon is already running 2022-02-13 20:08:30 +01:00
AsamK
90c787f8e2 Load multiple accounts in parallel 2022-02-13 20:08:30 +01:00
AsamK
cf0cc50e32 Improve stop receive handling
Only interrupt the receive thread if it is currently waiting for new
messages from the server, otherwise just set a stop flag.
2022-02-12 14:09:30 +01:00
AsamK
bb3b9692e3 Implement basic listAccounts for dbus client mode
Fixes #891
2022-02-12 11:20:05 +01:00
AsamK
0e0ef402fc Improve decryption error logging 2022-02-12 11:17:44 +01:00
AsamK
b0bb602eb5 Update libsignal-service-java 2022-02-11 22:52:06 +01:00
AsamK
d690b35ed9 Implement support for change number as linked device 2022-02-11 21:03:54 +01:00
AsamK
f207c2abc3 Reexport dbus objects when self number changes 2022-02-11 21:03:54 +01:00
AsamK
796f4d0d96 Prevent stripping number from self recipient in edge cases 2022-02-11 21:03:54 +01:00
AsamK
8985cc2656 Update self identifiers after whoAmI request 2022-02-11 21:03:54 +01:00
AsamK
7a06d3959e Extract number verification code logic 2022-02-11 21:03:54 +01:00
AsamK
292ef0f2da Move credentials provider to SignalAccount 2022-02-11 21:03:54 +01:00
AsamK
0476895c3d Store account list in accounts.json file 2022-02-11 21:03:54 +01:00
AsamK
ff6b733cd0 Add SignalAccountFiles as a central entry point 2022-02-11 21:03:54 +01:00
AsamK
1db7f8d76e Add additional logging to message send log store 2022-02-11 21:03:54 +01:00
AsamK
6dabf4550b Fix type of device id to Integer
Fixes #889
2022-02-11 21:03:54 +01:00
AsamK
fd8ba66509 Fix behavior when reading a v1 group from storage that has already been migrated locally
Fixes #888
2022-02-10 15:42:43 +01:00
AsamK
8966535efe Update reflect-config.json 2022-02-10 15:42:43 +01:00
Simon F
76f27449df
Add reference to alpine linux aport to README (#887) 2022-02-10 07:43:55 +01:00
AsamK
38ade4e985 Close database connection before sleeping 2022-02-09 19:09:03 +01:00
AsamK
8e773d92c1 Align receive timeout behavior for dbus client with cli and JSON-RPC
Timeout is reset by every incoming message
2022-02-06 19:33:50 +01:00
AsamK
5cccf52103 Cleanup manager package 2022-02-06 17:46:34 +01:00
AsamK
3040da99c4 Extra Database base class from AccountDatabase 2022-02-06 13:01:35 +01:00
AsamK
b9f66248ac Use RecipientAddress in AvatarStore 2022-02-06 12:29:47 +01:00
AsamK
285bfafdc1 Log exception when saving file fails 2022-02-04 15:43:20 +01:00
AsamK
aadd908464 Add new CA certificate to trust store for chat server.
Existing one expires in 2023.
2022-02-03 19:31:09 +01:00
AsamK
73d44ba3fe Switch to a less cpu intensive function to check if libsignal-client is available 2022-02-03 19:05:30 +01:00
Sebastian Scheibner
8c6b909365
Update README.md 2022-02-02 15:02:21 +01:00
AsamK
641856ebb4 Bump version 2022-02-01 21:52:34 +01:00
AsamK
be0993c5d8 Improve JSON-RPC subscribeReceive method with subscription id 2022-02-01 20:59:49 +01:00
exquo
e5a8cdb056
Repackage signal-client native builds (#879)
* Repackage signal-client native builds

* Change repo to upstream

* Use `listAccounts` to test run signal-cli

* Use "macOS" in filename
2022-02-01 20:57:32 +01:00
AsamK
e284b99076 Refactor JsonMessageEnvelope to remove unnecessary number canonicalization 2022-01-29 15:05:14 +01:00
AsamK
380c892e24 Add more informative thread names 2022-01-29 15:05:14 +01:00
AsamK
2e74acaabe Add --log-file parameter to write logs to separate file
Use logback for more control over the log output

Fixes #845
2022-01-29 15:05:08 +01:00
AsamK
95cc0ae7fd Implement MessageSendLog for resending after encryption error 2022-01-28 22:55:51 +01:00
AsamK
3491782912 Fix sender check for requesting message resend 2022-01-27 23:10:26 +01:00
AsamK
ffaa9d2ed3 Output sender also for sealed sender messages that fail to decrypt 2022-01-27 20:08:27 +01:00
morph027
d812c249ba
add GraalVM reflections for GroupJoinInfo (#872)
Signed-off-by: morph027 <stefan.heitmueller@gmx.com>

Co-authored-by: morph027 <stefan.heitmueller@gmx.com>
2022-01-26 22:04:36 +01:00
AsamK
238455ad6c Mark profile for refresh when receiving a profile key message 2022-01-26 22:01:09 +01:00
AsamK
ede0dfeef4 Fix output for envelope receipts 2022-01-26 22:01:09 +01:00
AsamK
67146f9cc7 Create stores in SignalAccount lazily 2022-01-26 21:03:04 +01:00
AsamK
e5537dc4db Update graalvm config 2022-01-26 19:22:46 +01:00
AsamK
5d23b1ed9d Improve error handling of getUserStatus command for invalid phonen numbers 2022-01-23 20:51:10 +01:00
morph027
166bec0f8d
add org.whispersystems.signalservice.internal.push.SignalServiceProtos.storyContext_ to graalvm reflect config (#868)
Signed-off-by: morph027 <stefan.heitmueller@gmx.com>

Co-authored-by: morph027 <stefan.heitmueller@gmx.com>
2022-01-23 20:48:55 +01:00
AsamK
d51b957ada Bump version 2022-01-22 22:58:46 +01:00
AsamK
4ffb93129d Update libsignal-service-java 2022-01-22 16:55:51 +01:00
AsamK
9439de1c15 Add recipient id to logging 2022-01-22 16:55:35 +01:00
AsamK
80befec589 Make deviceId an int 2022-01-22 16:41:00 +01:00
AsamK
a3c5cfd2f4 Archive old sessions when an identity key has changed 2022-01-22 13:21:56 +01:00
AsamK
7d935749aa Fix profile fetch with an invalid LANG variable 2022-01-17 18:26:08 +01:00
AsamK
4310059e6a Update gradle 2022-01-16 10:45:56 +01:00
AsamK
7b2b258b1d Update year 2022-01-16 10:45:36 +01:00
AsamK
c7e9e19a8a Fix CHANGELOG 2022-01-16 10:44:08 +01:00
AsamK
382469f5fd Bump version 2022-01-16 10:07:17 +01:00
AsamK
fe9989197f Fix debug message 2022-01-16 10:07:17 +01:00
AsamK
a01d6b085a Log the time it takes to send a group message 2022-01-15 18:21:26 +01:00
AsamK
c8cc428e3f Improve performance when fetching multiple profiles 2022-01-15 18:18:40 +01:00
AsamK
365323f574 Ignore decryption failures from blocked contacts 2022-01-15 16:24:25 +01:00
AsamK
3587d1c397 Rename sandbox to staging environment
To match the upstream name
2022-01-05 23:41:17 +01:00
AsamK
8a5f98dac6 Add sticker pack url to list output 2022-01-03 18:50:27 +01:00
AsamK
99eef05084 Retrieve sticker pack before sending if necessary 2022-01-03 17:54:53 +01:00
AsamK
beb3adcc72 Change stickerId to hex everywhere
Remove packKey from output
2022-01-03 17:51:04 +01:00
AsamK
e70463d7b8 Implement listStickerPacks command 2022-01-03 16:11:03 +01:00
AsamK
404063a080 Add support for sending stickers 2022-01-03 13:24:13 +01:00
AsamK
5d83e149b3 Add verbose logging for decryption errors of incoming messages 2022-01-02 21:36:43 +01:00
Sebastian Scheibner
65ff7a43db
Update CONTRIBUTING.md 2022-01-02 21:31:16 +01:00
Orazio
9af3e2ca90
Set security options for the example signal-cli-socket systemd unit (#852)
* Restrict socket access to root and users in the signal-cli group

* Sandbox signal-cli-socket service using systemd features

* Add RemoveIPC too.

* Restore original placeholder for ExecStart path.
2022-01-02 20:37:41 +01:00
AsamK
69ea12b956 Mark isRegistered() dbus method as deprecated
It always return true.
2022-01-02 17:52:40 +01:00
AsamK
541ac777bc Improve pin failure message in dbus mode 2022-01-02 17:52:20 +01:00
AsamK
5b76d7458f Add config files for systemd sysusers and tmpfiles 2022-01-02 17:31:12 +01:00
AsamK
6a188a67dd Adapt log levels 2022-01-02 17:31:12 +01:00
AsamK
805f976d9e Implement multi account commands for dbus client 2022-01-02 17:31:12 +01:00
AsamK
00cda598c8 Extract ProvisioningManager and RegistrationManager interfaces 2021-12-31 16:39:33 +01:00
AsamK
332780b1a6 Make GroupV2Helper package-private 2021-12-31 16:19:25 +01:00
AsamK
ffcda46c31 Extract AccountHelper 2021-12-31 16:19:12 +01:00
AsamK
f5e5dd551d Extract ReceiveHelper 2021-12-30 22:44:38 +01:00
AsamK
c7a7d00da5 Refactor Context to create helpers lazily 2021-12-30 22:02:03 +01:00
AsamK
c88c92086e Add UnregisteredRecipientException 2021-12-30 17:15:49 +01:00
AsamK
a7ecb9e10f Extract RecipientHelper 2021-12-30 17:15:49 +01:00
AsamK
d28b6522d5 Update dependencies 2021-12-30 17:15:49 +01:00
AsamK
a738fb725b Adapt log levels 2021-12-30 13:30:05 +01:00
AsamK
592491ab4e Update CHANGELOG.md 2021-12-30 12:15:58 +01:00
AsamK
1e8c5eb522 Add additional log verbosity levels 2021-12-30 12:03:41 +01:00
AsamK
e3fcc9b3ba Add additional logging 2021-12-30 11:53:22 +01:00
AsamK
fba7a6a75c Paralellize profile fetching 2021-12-26 17:14:06 +01:00
AsamK
3b81ba3596 Move saving out of synchronized block 2021-12-26 12:40:06 +01:00
AsamK
f7b2916618 Align dbus handling of no account parameter with normal mode 2021-12-26 12:30:02 +01:00
AsamK
db154df4a4 Update graalvm-config
Fixes #848
2021-12-26 10:28:03 +01:00
AsamK
c66f92d488 Update libsignal-service-java 2021-12-26 09:28:53 +01:00
AsamK
a0593f4031 Disable unidentified access for recipient if it fails once 2021-12-25 16:19:21 +01:00
AsamK
ceb6084eda Throw unregistered exception in getRegisteredUser 2021-12-25 16:13:07 +01:00
AsamK
7c9839b114 Improve error handling for profile fetching 2021-12-25 16:12:38 +01:00
AsamK
6dc8435fa1 Optimize getAccessFor method 2021-12-25 16:07:27 +01:00
AsamK
7e803dfc46 Log profile decryption failure 2021-12-25 16:06:33 +01:00
AsamK
f03df0a8c0 Update handling of unrestricted unidentified sender access.
Fixes #843
2021-12-25 16:06:12 +01:00
AsamK
88ea61e28f Start preKeyIds with a random number
Fixes #842
2021-12-23 18:26:09 +01:00
AsamK
8cd8016c3d Add logging for executing action 2021-12-23 18:22:14 +01:00
AsamK
6fcec33ab6 Add error message when creating sende keys path fails 2021-12-23 13:43:53 +01:00
AsamK
bddff2cb88 Save account file after adding distribution ids 2021-12-22 19:19:50 +01:00
AsamK
c2801c447d Return unknown version if project version is not available 2021-12-22 19:19:19 +01:00
AsamK
f9ecaa8ad6 Add workaround for jsonrpc clients that send null params 2021-12-22 19:18:42 +01:00
AsamK
9a72733c4f Improve exit code for message sending
Exit with 0 status code if the message was sent successfully to at least
one recipient, otherwise exit with status code 2 or 4 (for untrusted).

Fixes #828
2021-12-22 12:47:42 +01:00
AsamK
4aa8e3f2f2 Catch all exceptions when deserializig session records 2021-12-22 11:19:22 +01:00
AsamK
0da37d0c90 Update graalvm native buildtools 2021-12-22 10:45:58 +01:00
AsamK
5a3afed7a8 Update graalvm config
Fixes #841
2021-12-22 10:45:30 +01:00
AsamK
00b3be044e Send typing messages with sender keys 2021-12-20 18:46:03 +01:00
AsamK
172011234b Retry failed messages after trusting a new identity 2021-12-20 17:48:36 +01:00
AsamK
71e0c3f80c Use Duration for timeout 2021-12-20 16:12:37 +01:00
AsamK
fa3c79828a Update graalvm config 2021-12-20 14:44:58 +01:00
AsamK
dc2470d046 Don't store default values of group blocked/permissionDenied 2021-12-20 14:38:48 +01:00
AsamK
baed2b7ead Implement simple handling of incoming decryption error message 2021-12-20 14:38:48 +01:00
AsamK
1f48ce1f39 Implementing sending group messages with sender keys 2021-12-20 14:38:48 +01:00
AsamK
c134f1b78e Update libsignal-service-java 2021-12-20 14:38:48 +01:00
AsamK
d21f9cf029 Improve profile fetching 2021-12-20 14:04:07 +01:00
AsamK
e7896235a2 Update gradle wrapper 2021-12-19 13:26:43 +01:00
AsamK
1c9d16e199 Improve error handling for tcp address parsing 2021-12-16 21:10:15 +01:00
AsamK
6bdfa11b66 Prevent NPE if no locale is configured
Fixes #833
2021-12-15 21:54:53 +01:00
AsamK
d1ccd11fcb Bump version 2021-12-11 21:24:25 +01:00
AsamK
fac241ea69 Fix making man pages 2021-12-11 21:04:17 +01:00
AsamK
a57a2bb326 Update tests 2021-12-11 21:01:10 +01:00
AsamK
d248f249e3 Implement more methods for DbusManagerImpl 2021-12-11 20:01:36 +01:00
AsamK
4f50668fe3 Update CHANGELOG.md 2021-12-11 19:38:06 +01:00
AsamK
d9c8711eb0 Implement sendGroupTying dbus method 2021-12-11 19:38:06 +01:00
AsamK
4999487476 Update FUNDING.yml 2021-12-11 19:22:16 +01:00
AsamK
62687d103f Replace collect(Collectors.toList()) with toList() 2021-12-11 13:10:39 +01:00
AsamK
06e93b84da Handle send failures as non fatal and return detailed results in json output
Fixes #348
2021-12-11 12:44:11 +01:00
AsamK
ceafe96e81 Include recipient identifier in send error message 2021-12-10 20:21:14 +01:00
AsamK
b8ac75313f Update resource-config.json 2021-12-10 20:17:52 +01:00
AsamK
f0d9a33d9a Update man pages 2021-12-10 18:39:44 +01:00
AsamK
0bd142ab6b Update bouncycastle 2021-12-10 17:55:34 +01:00
AsamK
c3f0539526 Update libsignal-service-java 2021-12-08 22:31:49 +01:00
AsamK
e9caf21bd3 Print uuid in listIdentities command if number unknown 2021-12-07 00:02:47 +01:00
AsamK
10df4338b1 Improve behavior of changed recipient id 2021-12-07 00:02:24 +01:00
AsamK
bbe74ef020 Always use correct recipientId after recipients were merged 2021-12-06 19:37:14 +01:00
AsamK
9c811ecc02 Extend logging in RecipientStore 2021-12-06 19:18:18 +01:00
AsamK
8867a7b9ee Convert RecipientAddress to record 2021-12-06 18:57:11 +01:00
AsamK
c3a9022bec Add debug log when reading message from stdin 2021-12-05 16:26:18 +01:00
AsamK
cb346fdec4 Update CHANGELOG.md 2021-12-05 16:12:33 +01:00
AsamK
a53bb1c4c6 Adapt error message for multi-account only commands 2021-12-05 16:08:14 +01:00
AsamK
c9928043b2 Copy managers list to prevent ConcurrentModificationException 2021-12-05 15:32:42 +01:00
AsamK
16bf7af297 Remove jackson from lib's api 2021-12-05 15:32:42 +01:00
AsamK
a5013dd08d Close account if user is not registered 2021-12-05 15:32:42 +01:00
AsamK
32c2fae2f7 Update reflect-config.json 2021-12-05 12:34:29 +01:00
AsamK
124d10d6f8 Fix issue when loading a legacy account file without aci 2021-12-05 12:01:12 +01:00
AsamK
6c1013b024 Improve error message when an account is already in use 2021-12-05 12:00:49 +01:00
AsamK
c8b9ab1911 Improve handling of unregistered account 2021-12-05 12:00:31 +01:00
jonas.hoefer
861f47d734 Add dbus methods: deleteContact and deleteRecipient
Closes #814
2021-12-05 11:01:25 +01:00
AsamK
e92d37e3a5 Cache group credentials in memory 2021-12-05 11:00:22 +01:00
AsamK
e83f43065e Remove dead code and fix inspection issues 2021-12-05 10:43:57 +01:00
technillogue
6ffeb7c431
Add -c for --config (#816) 2021-12-05 10:12:50 +01:00
AsamK
855d06dc76 Fix to always update recipientsMerged map when merging recipients 2021-12-03 14:25:07 +01:00
AsamK
f65f0e3873 Update graalvm buildtools 2021-12-03 13:50:39 +01:00
AsamK
f487af5b0c Add Automatic-Module-Name for manager lib 2021-11-28 16:56:05 +01:00
AsamK
7e7e4150e1 Add removeContact command
Closes #335
2021-11-26 20:50:54 +01:00
technillogue
5cd5697aea
add JsonPayment (#808) 2021-11-23 08:14:01 +01:00
AsamK
d13d150fe1 Implement sending message quotes
Fixes #213
2021-11-21 19:18:17 +01:00
AsamK
415b65d208 Only store recipient if there were changes 2021-11-19 17:17:13 +01:00
AsamK
c9dffe47f6 Update libsignal-service-java 2021-11-18 19:25:11 +01:00
AsamK
05ccfef93c Update reflect config 2021-11-15 18:02:41 +01:00
AsamK
f58f85ef60 Return json response if available in error data field 2021-11-14 15:24:21 +01:00
AsamK
fc8b6d0fcb Clean up base package 2021-11-14 15:00:06 +01:00
AsamK
382d8d22d0 Make send behavior more deterministic if there are unregistered recipients
Fixes #803
2021-11-14 14:42:17 +01:00
AsamK
fa5c09d23b Update hypfvieh dbus-java 4.0 beta which uses native java unix sockets
Fixes #673
Fixes #632
2021-11-14 11:39:32 +01:00
AsamK
53b84bad02 Implement sending mentions
Closes #584
2021-11-13 22:54:59 +01:00
AsamK
89f568dd1f Only update last received timestamp at most once per minute 2021-11-13 22:03:54 +01:00
AsamK
8aab644db9 Rename username to account 2021-11-12 16:51:33 +01:00
AsamK
398cddaf29 Adapt register command to reactivate account if possible
By default the unregister command just deactivates the account, in which
case it can be reactivated without sms verification if the local data is
still available.
If the account was deleted (with --delete-account) it cannot be reactivated.
2021-11-12 16:10:22 +01:00
AsamK
c73c58723c Implement unregister command for jsonrpc and dbus daemon 2021-11-12 16:07:35 +01:00
AsamK
b78573021d Merge multiple SendReceiptActions to same recipient to only send one receipt 2021-11-12 12:10:46 +01:00
AsamK
b7005884fd Implement startLink and finishLink for jsonrpc daemon 2021-11-11 19:15:20 +01:00
AsamK
79cc225869 Implement register and verify commands for json rpc 2021-11-11 19:14:32 +01:00
AsamK
4a1af0786c Add MultiAccountManager 2021-11-11 16:10:22 +01:00
AsamK
6261934dda Update gradle 2021-11-11 13:18:20 +01:00
AsamK
d3490facc8 Add getDefaultLocale utils method 2021-11-10 21:58:39 +01:00
AsamK
62dd2ee49e Add listAccounts command 2021-11-10 20:15:18 +01:00
AsamK
9c67aabebb Add JsonRpcMultiCommand 2021-11-10 20:12:27 +01:00
AsamK
64af4914ee Rename JsonRpcCommand class 2021-11-10 17:11:16 +01:00
AsamK
2879b31aba Rename --username to --account 2021-11-10 16:55:13 +01:00
AsamK
793df99bef Cache sender certificates in memory 2021-11-10 15:36:29 +01:00
AsamK
c30eba92cc Update reflect-config.json 2021-11-10 15:31:44 +01:00
AsamK
62dd5a169f Read phone number unlisted state from storage 2021-11-10 15:23:44 +01:00
AsamK
4baf0849a6 Read phone number sharing mode from storage
Fixes #755
2021-11-10 15:23:44 +01:00
AsamK
81a11dc977 Implement socket/tcp for daemon command 2021-11-10 12:12:35 +01:00
AsamK
7706a02e1b Update reflect-config.json 2021-11-10 12:12:35 +01:00
AsamK
25314b1d17 Synchronize plain text output of incoming messages 2021-11-10 10:30:34 +01:00
AsamK
54d8ee2a40 Fix remote delete in dbus receive 2021-11-10 10:24:53 +01:00
AsamK
dc8abd0032 Close Manager if checkAccountState fails 2021-11-09 22:46:37 +01:00
AsamK
2b0989adfe Disconnect websocket when receiving is done 2021-11-09 18:28:25 +01:00
AsamK
9c86baf0ea Rename jsonrpc bulk to batch message 2021-11-09 14:22:47 +01:00
technillogue
27a09fd408
Add DecryptedApproveMember, QuotedAttachment, and ModifyAvatarAction (#798) 2021-11-08 23:43:02 +01:00
AsamK
08f6dbae05 Fix missing bracket 2021-11-08 23:41:53 +01:00
AsamK
b81a83eec5 Extract JsonRpcNamespace 2021-11-08 22:16:45 +01:00
AsamK
e7a4bc5ef1 Extend logging in JsonRpcReader 2021-11-08 22:16:45 +01:00
AsamK
e495afcff5 Fix removeReceiveHandler to not incorrectly reset the receiveThread 2021-11-08 22:16:45 +01:00
AsamK
5dd602614c Move Writer creation out of WriterImpls 2021-11-08 22:16:44 +01:00
AsamK
b5eef3ccad Add logging bridge for java.util.logging 2021-11-08 22:16:44 +01:00
AsamK
c60c8e998f Fix ACI null pointer 2021-11-08 22:16:44 +01:00
AsamK
510965589b Extract SignalJsonRpcDispatcherHandler 2021-11-07 12:22:53 +01:00
AsamK
82bb4f22f0 Add exportObject helper method 2021-11-07 11:04:41 +01:00
John Freed
8a216e3245 Implement configuration properties for dbus
Closes #759

commit 169bb518bf
Author: John Freed <okgithub@johnfreed.com>
Date:   Fri Oct 15 08:53:34 2021 +0200

    remove org.asamk.signal.manager.api.Configuration

commit 27ecfee382
Author: John Freed <okgithub@johnfreed.com>
Date:   Fri Oct 15 08:40:13 2021 +0200

    add a DBus "daemon running" indicator

commit 94b3d9e2ed
Author: John Freed <okgithub@johnfreed.com>
Date:   Fri Oct 15 08:20:03 2021 +0200

    changing most DBus logger.info to logger.debug

commit 15da060127
Author: John Freed <okgithub@johnfreed.com>
Date:   Fri Oct 15 00:09:26 2021 +0200

    Configuration for Dbus and main

    Main program subcommand
    - fix logic to take into account previously unset flags
    - provide output in json and plain-text formats

    new Dbus Properties:
    - ConfigurationReadReceipts
    - ConfigurationUnidentifiedDeliveryIndicators
    - ConfigurationTypingIndicators
    - ConfigurationLinkPreviews

    removed getConfiguration and setConfiguration methods

    updated documentation

commit 09da3aae62
Merge: 3c40b11 18ad9fb
Author: John Freed <okgithub@johnfreed.com>
Date:   Thu Oct 14 15:24:07 2021 +0200

    Merge branch master into dbus_updateConfiguration

commit 3c40b11b8a
Merge: 8416d4a cadcc6c
Author: John Freed <okgithub@johnfreed.com>
Date:   Sat Oct 9 14:08:08 2021 +0200

    Merge branch master into dbus_updateConfiguration

commit 8416d4ac47
Author: John Freed <okgithub@johnfreed.com>
Date:   Mon Oct 4 08:48:56 2021 +0200

    Dbus get/setConfiguration methods

    implement:

    - getConfiguration() -> [readReceipts<b>, unidentifiedDeliveryIndicators<b>, typingIndicators<b>, linkPreviews<b>] -> <>::

    - setConfiguration(readReceipts<b>, unidentifiedDeliveryIndicators<b>, typingIndicators<b>, linkPreviews<b>) -> <>::

    Update documentation
2021-11-07 10:59:14 +01:00
AsamK
e22cc457ae Implement getConfiguration method in Manager 2021-11-07 10:38:26 +01:00
AsamK
a20bbe1246 Update libsignal-service-java 2021-11-06 23:17:03 +01:00
AsamK
510dc89e92 Implement close for DbusManagerImpl 2021-11-06 21:59:11 +01:00
AsamK
fa9401d186 Update reflect-config.json 2021-11-06 21:18:16 +01:00
AsamK
32818a8608 Refactor ReceiveCommand in dbus mode and remove ExtendedDbusCommand 2021-11-06 21:09:06 +01:00
AsamK
eec7aec069 Fix error type for dbus rate limit challenge 2021-11-06 15:41:58 +01:00
AsamK
2ab42ca547 Remove libsignal-service from manager lib API 2021-11-06 13:38:10 +01:00
AsamK
9075cc1a30 Refactor receive api 2021-11-06 12:17:50 +01:00
AsamK
b615a4b04d Convert RecipientIdentifier to record 2021-10-31 21:24:25 +01:00
AsamK
31dec5a666 Handle UnauthenticatedResponseException internally 2021-10-31 20:53:03 +01:00
AsamK
782f96b580 Replace UnregisteredUserException 2021-10-31 20:43:29 +01:00
AsamK
659761f006 Add InactiveGroupLinkException 2021-10-31 19:45:30 +01:00
AsamK
3cf7721cd7 Add InvalidDeviceLinkException exception 2021-10-31 19:35:00 +01:00
AsamK
d783df510a Add Pair record 2021-10-31 19:15:52 +01:00
AsamK
1e87240db8 Use java.util.Optional in Manager interface 2021-10-31 18:01:17 +01:00
AsamK
f39983f78a Add new dbus message received signals with extendable extras map 2021-10-31 12:40:21 +01:00
AsamK
204aa31885 Refactor dbus receive message handler 2021-10-30 13:30:58 +02:00
John Freed
cb70209c60 Implement viewedReceipt
commit cd29144e81
Merge: 14532be f884175
Author: AsamK <asamk@gmx.de>
Date:   Sat Oct 30 12:46:59 2021 +0200

    Merge branch 'master' into dbus_sendviewed

commit 14532befde
Author: John Freed <okgithub@johnfreed.com>
Date:   Thu Oct 7 08:24:00 2021 +0200

    update deliveryReceipt to conform

commit a9a6edaf3f
Author: John Freed <okgithub@johnfreed.com>
Date:   Thu Oct 7 07:40:20 2021 +0200

    implement viewedReceipt

    for Dbus and Json -- note that this changes the JsonReceiptMessage
    structure

    update documentation

Closes #764
2021-10-30 12:54:41 +02:00
AsamK
f884175748 Add fatJar gradle task to create a single executable jar file 2021-10-27 20:59:02 +02:00
AsamK
1fae09433d Improve dbus error handling
Fixes #787
2021-10-27 20:00:36 +02:00
AsamK
ce7aa580b6 Use record classes 2021-10-27 14:39:40 +02:00
AsamK
ce70a623c2 Use Java 17 2021-10-27 14:39:40 +02:00
AsamK
9cb1409918 Fix unlikely issues with null values 2021-10-27 14:39:40 +02:00
AsamK
fc5af35a04 Replace File.delete with Files.delete 2021-10-27 14:39:40 +02:00
AsamK
4e69b34efe Update documentation 2021-10-27 14:39:40 +02:00
AsamK
69b7e73063 Update slf4j 2021-10-27 14:39:40 +02:00
AsamK
95a27c8ec4 Update tests 2021-10-27 14:39:40 +02:00
AsamK
06aeeaa6e6 Update reflect-config.json 2021-10-27 14:39:40 +02:00
AsamK
e83e9ae313 Bump version 2021-10-24 20:09:03 +02:00
AsamK
f69d9e64aa Update dbus-java version 2021-10-24 19:57:31 +02:00
AsamK
b07200342a Use challenge captchas for proof required exception 2021-10-24 19:32:13 +02:00
AsamK
9b102c49d0 Adapt behavior of receive command as dbus client to match normal mode 2021-10-24 19:16:35 +02:00
AsamK
004293362e Update libsignal-service-java 2021-10-24 19:16:01 +02:00
AsamK
fc0a9b4102 Move receive thread handling to manager 2021-10-22 17:39:33 +02:00
AsamK
5c389c875d Split receiveMessages method 2021-10-21 21:19:14 +02:00
AsamK
430c155f7e Fix comment 2021-10-21 21:02:02 +02:00
AsamK
f5ba7894ae Add setIgnoreAttachments method 2021-10-21 21:01:48 +02:00
AsamK
3636023cb8 Improve error message when the last provisioning steps fail 2021-10-19 22:16:35 +02:00
AsamK
d4b9356c5c Add missing null check
Fixes #784
2021-10-18 16:48:07 +02:00
AsamK
bff0030aed Update reflect-config.json 2021-10-18 16:47:26 +02:00
AsamK
f5089789fb Bump version 2021-10-16 10:05:41 +02:00
AsamK
f57db857da Update CHANGELOG.md 2021-10-15 22:36:57 +02:00
AsamK
cf31ad6ccf Check if configuration message contains value before using it 2021-10-15 21:18:47 +02:00
AsamK
0e56d1c32a Update reflect-config 2021-10-15 21:18:18 +02:00
AsamK
1c27723083 Update build pipeline to java 17 2021-10-15 21:01:37 +02:00
AsamK
3b685190a8 Add missing unexport groups call 2021-10-15 21:00:21 +02:00
AsamK
ea7f4845e8 Update libsignal-service-java 2021-10-15 20:46:38 +02:00
AsamK
4a3b0e5124 Reconnect websocket with exponential backof if connection is lost 2021-10-15 20:02:03 +02:00
AsamK
5648714641 Clear queued message actions after handling
Fixes #777
2021-10-15 20:01:54 +02:00
John Freed
18ad9fbb4e
fix typos in DBus doc (#774)
and expand on functioning of joinGroup method
2021-10-13 08:00:07 +02:00
AsamK
f094cd6806 Extract IdentityHelper 2021-10-12 22:14:39 +02:00
AsamK
997b3c6a2a Restrict blocking of group to master device 2021-10-12 20:57:25 +02:00
AsamK
e977f38bdd Refactor to remove ProfileKeyProvider and UnidentifiedAccessSenderCertificateProvider 2021-10-12 20:57:25 +02:00
AsamK
15c66684c1 Update graalvm buildtools 2021-10-12 20:57:25 +02:00
John Freed
a95886c491
update DBus documentation (#773) 2021-10-11 16:53:24 +02:00
AsamK
09730b474b Update libsignal-service-java 2021-10-10 13:31:44 +02:00
AsamK
bfddb40d73 Reconnect websockets after errors 2021-10-10 13:31:34 +02:00
AsamK
07742843df Update gradle wrapper 2021-10-10 13:30:47 +02:00
AsamK
abd0e71814 Update documentation 2021-10-09 17:57:32 +02:00
technillogue
d82f4a8717
Update to new provisioning URL scheme (#762) 2021-10-09 17:55:33 +02:00
John Freed
6501ffcdac Update documentation 2021-10-09 17:41:23 +02:00
AsamK
997b4f0c3f Implement new dbus group interface 2021-10-09 17:41:23 +02:00
AsamK
b5d4a5000b Add DeviceNotFound Error 2021-10-09 17:04:17 +02:00
John Freed
cadcc6c8ef
update docs for DBus listDevices method (#768) 2021-10-09 13:04:07 +02:00
AsamK
179855272a Fix dbus properties GetAll method for variants 2021-10-07 20:56:29 +02:00
AsamK
c56a8df9b2 Return struct instead of object path directly for dbus list devices 2021-10-07 20:56:29 +02:00
AsamK
7829a8d631 Fix device id type 2021-10-07 20:56:29 +02:00
John Freed
d4838bd646
implement DBus submitRateLimitChallenge method (#763)
update documentation
2021-10-07 07:46:15 +02:00
AsamK
26594dd0ee Retrieve self profile from storage 2021-10-03 16:17:58 +02:00
AsamK
0709c0caf8 Update libsignal-service-java 2021-10-03 13:38:55 +02:00
AsamK
76ceac4d54 Read configurations from storage 2021-10-03 13:37:27 +02:00
AsamK
8b83992e95 Don't repeatedly try to refetch group info if permission was denied
i.e. if the user is no longer a member of that group
2021-10-02 18:40:36 +02:00
AsamK
778adacb80 Refactor dbus linked devices interface
Export a separate dbus object for each device
2021-10-02 18:04:30 +02:00
AsamK
1548ce9c79 Add helper classes for exporting dbus properties 2021-10-02 17:16:08 +02:00
AsamK
9839be48f3 Extract configurationStore variable 2021-10-01 17:52:33 +02:00
AsamK
6f5e72119e Implement configuration handling
Closes #747
2021-09-30 21:41:24 +02:00
AsamK
c9f5550d18 Remove workaround for getBoolean from JsonRpcLocalCommand 2021-09-30 19:36:31 +02:00
AsamK
f44b148946 Allow message from pending member if it's just a group update
Fixes #751
2021-09-28 23:48:16 +02:00
AsamK
593cd7d8ca Refactor dbus client mode to improve maintainability 2021-09-28 22:33:35 +02:00
AsamK
d72b838560 Refactor Manager interface 2021-09-28 21:13:02 +02:00
AsamK
b91c162159 Extract Manager interface 2021-09-28 21:13:02 +02:00
AsamK
1a81bbecbb Do not send message resend request to own device 2021-09-28 21:13:02 +02:00
AsamK
7c9fd9d0fb Refactor NoteToSelf to singleton class 2021-09-28 21:13:02 +02:00
AsamK
4acab9043c Reformat code 2021-09-28 18:42:05 +02:00
John Freed
ba817e2ae4
Implement Dbus updateProfile with givenName (#734)
two versions of updateProfile implemented:
- one with givenName and familyName
- one with just name

update documentation
2021-09-28 18:41:10 +02:00
AsamK
375c9d60cf Refactor isRegistered 2021-09-26 21:49:36 +02:00
John Freed
1c4a32fef4
implement Dbus isRegistered() methods (#729)
* implement Dbus isRegistered() methods

isRegistered(number<s>) returns a boolean

isRegistered(numbers<as>) returns an array of Booleans

* Dbus isRegistered() methods

restore isRegistered() and respond to other requests by AsamK
2021-09-26 20:09:57 +02:00
AsamK
df8dd54791 Reformat code 2021-09-26 09:27:55 +02:00
John Freed
e78463ea0a
implement Dbus updateAccount and listDevices (#730)
* implement Dbus updateAccount and listDevices

implement updateAccount(deviceName<s>) to change device name

implement listDevices

update documentation

* implement Dbus addDevice and removeDevice

update documentation as well

* Dbus add/remove/list/update devices

modifications responding to requests by AsamK

* Dbus incorporating InvalidUri error

Co-authored-by: AsamK <asamk@gmx.de>
2021-09-26 09:26:12 +02:00
John Freed
d47574351e
implement Dbus setExpirationTimer (#735)
implement method

update documentation
2021-09-26 09:04:40 +02:00
John Freed
8bee08fd96
implement Dbus sync methods (#737)
implement two Dbus methods:
- sendContacts
- sendSyncRequest

update documentation
2021-09-26 09:00:26 +02:00
John Freed
1ca0e75ef1
implement Dbus stickerpack method (#740)
implement uploadStickerPack

update documentation
2021-09-26 08:59:38 +02:00
AsamK
982e887c9f Reformat code 2021-09-21 22:30:27 +02:00
John Freed
d622967192
Implement Dbus setPin and removePin (#733)
and update documentation
2021-09-21 22:26:26 +02:00
AsamK
6c29d90503 Adapt visibility 2021-09-15 21:34:46 +02:00
AsamK
e562daa1f3 Update README.md 2021-09-15 21:34:05 +02:00
AsamK
8e2bb1d393 Update FUNDING.yml 2021-09-15 21:25:46 +02:00
JtheSaw
11b3758416
Add sendTyping and sendReceipt to dbus interface (#718)
* Add sendTyping and sendReceipt to dbus interface

* Resolve requested changes

* Adapt documentation
2021-09-13 17:01:26 +02:00
AsamK
12e85ec671 Remove custom -PappArgs handling, gradle now supports --args 2021-09-12 19:20:21 +02:00
AsamK
627a587952 Use official graalvm native-image gradle plugin 2021-09-12 19:08:47 +02:00
AsamK
cbff7217c1 Bump version 2021-09-12 17:47:02 +02:00
AsamK
882e45de55 Update graalvm config 2021-09-12 14:48:01 +02:00
AsamK
f48593f265 Exit immediately if an uncaught error is thrown on the main thread 2021-09-12 14:37:56 +02:00
AsamK
62d8873a92 Request message resend if incoming message can't be decrypted 2021-09-12 13:21:48 +02:00
AsamK
fbafa75fe2 Store announcement group capability 2021-09-12 13:21:48 +02:00
AsamK
e3d5ebaa9e Refresh prekeys after receiving a pre key message, if necessary 2021-09-12 12:04:28 +02:00
AsamK
2196ac6975 Extract PreKeyHelper from Manager 2021-09-12 11:59:20 +02:00
AsamK
74e576c907 Convert RateLimitException to a network failure send message result 2021-09-10 17:48:44 +02:00
AsamK
6ac4af4974 Fix plain text output for getUserStatus command
Fixes #711
2021-09-10 17:24:28 +02:00
AsamK
50e5acdf52 Fix printing proof required error
libsignal-service classifies it as network failure as well.
2021-09-10 10:13:51 +02:00
AsamK
eee140f74f Add submitRateLimitChallenge command
Related #708
2021-09-09 19:20:48 +02:00
AsamK
1856e79a50 Add missing check if client zk operations are null
Fixes #710
2021-09-09 18:58:45 +02:00
AsamK
a17262d9ff Catch ProofRequiredException from getPreKeys request and wrap in SendMessageResult 2021-09-09 18:54:48 +02:00
AsamK
0e6644a890 Remove unnecessary step from codeql analysis 2021-09-08 20:53:01 +02:00
AsamK
2044a7d7a5 Print stack trace of exception causes in verbose mode 2021-09-08 20:38:24 +02:00
AsamK
e3c37a0239 Log error message if libzkgroup or libsignal-client is missing
Fixes #660
2021-09-08 20:10:07 +02:00
AsamK
537b704951 Ignore set profile failure if libzkgroup is missing
Fixes #709
2021-09-08 20:09:22 +02:00
AsamK
656ca6b5e4 Prevent creation of RecipientAddress with UNKNOWN_UUID 2021-09-05 16:06:13 +02:00
AsamK
2e01a05e71 Implement retrieving data from remote storage
Related #604
2021-09-05 15:52:55 +02:00
AsamK
299671480f Add possibility to update the device name 2021-09-05 11:41:38 +02:00
AsamK
5a2e37a6e2 Only handle jsonRpc requests, after receive thread has caught up with old messages 2021-09-04 15:06:25 +02:00
AsamK
ac18006abb Implement support for receiving sender key messages 2021-09-04 13:54:06 +02:00
AsamK
35622ac684 Use EMPTY send event listeners 2021-09-04 13:54:06 +02:00
AsamK
891c05210e Improve comment in SessionStore 2021-09-04 10:48:32 +02:00
AsamK
43bcc95713 Add missing isActive check 2021-09-03 21:30:45 +02:00
AsamK
b903102407 Update libsignal-service-java 2021-09-03 20:12:59 +02:00
AsamK
e83bfb9e03 Print more information for call messages 2021-09-01 20:02:20 +02:00
AsamK
0d0978011d Fix handling incoming contacts sync message 2021-08-30 21:07:24 +02:00
AsamK
626406a43c Create libsignal dependencies only when required 2021-08-30 15:07:12 +02:00
AsamK
1f0c2d5c78 Remove registration lock pin before deleting account 2021-08-30 14:12:39 +02:00
AsamK
7a3522dc01 Prevent endless loop when receiving contact sync message 2021-08-30 13:55:25 +02:00
AsamK
32150b1aaa Move all message decryption to IncomingMessageHandler 2021-08-30 13:39:27 +02:00
AsamK
5743cf4455 Improve dbus register error message if called with invalid number 2021-08-30 13:33:54 +02:00
AsamK
8bcd8d87d2 Update libsignal-service-java 2021-08-29 13:37:24 +02:00
AsamK
85c5caeaca Don't handle blocked or forbidden messages 2021-08-27 09:04:14 +02:00
AsamK
634437d22d Delete cached failed messages after 30 days 2021-08-26 15:26:25 +02:00
AsamK
8bc6c0abcb Extract ContactHelper and IncomingMessageHandler 2021-08-26 15:25:02 +02:00
AsamK
debbaa81ba Extract AttachmentHelper and SyncHelper 2021-08-26 12:05:15 +02:00
AsamK
e532a24cf8 Move more profile functionality to ProfileHelper 2021-08-26 10:56:30 +02:00
AsamK
cd3741d236 Rename internal quitGroup method 2021-08-26 10:28:04 +02:00
AsamK
7f64a9812c Prevent non-admins from sending to announcement groups
Only reactions are allowed
2021-08-26 09:34:06 +02:00
AsamK
944c3327ee Extract GroupHelper 2021-08-26 08:58:39 +02:00
AsamK
6ee0a95aa2 Update URL for reaching Signal chat server 2021-08-25 23:05:46 +02:00
AsamK
7106a997cf Update tests 2021-08-25 21:27:20 +02:00
AsamK
95792be9bc Align cli param names for recipient 2021-08-25 21:21:19 +02:00
AsamK
ca52c01031 Adapt log level 2021-08-25 20:56:41 +02:00
AsamK
467a48bac5 Add RecipientIdentifier as external Manager interface 2021-08-25 20:12:10 +02:00
AsamK
cd7172ee57 Refactor message send methods 2021-08-25 12:23:31 +02:00
AsamK
23a006c311 Enable announcement group capability 2021-08-25 12:23:31 +02:00
AsamK
8c661c23be Accept single values for jsonrpc requests where a list is expected 2021-08-24 12:37:50 +02:00
AsamK
6c3106db5d Add new --trust-new-identities global parameter
Closes #360
2021-08-23 15:58:05 +02:00
AsamK
6dd1a21606 Handle queued actions also when thread is interrupted 2021-08-23 14:39:40 +02:00
AsamK
9a9dd3b217 Extend error information in json output for received messages from untrusted identity
Fixes #91
2021-08-22 19:28:13 +02:00
AsamK
4f67ac674b Trust an identity with its scannable safety numbers from the other device
Attention, the scannable fingerprints are asymetric, so the scannable
fingerprints from the local listIdentities command can't be used to trust
an identity. The scannable fingerprint must come from the other device.
2021-08-22 19:23:49 +02:00
AsamK
0a5e836ab6 Fix rare null pointer exception when receiving message from untrusted identity 2021-08-22 18:47:20 +02:00
AsamK
a7c9995655 Print message expiration time in listGroups command 2021-08-22 16:53:01 +02:00
AsamK
e3752e733a Implement sendReceipt command
Fixes #305
2021-08-22 14:25:48 +02:00
AsamK
76942ea458 Add member uuids to listGroup json output 2021-08-22 13:01:51 +02:00
AsamK
5bbfd32598 Extend json output with number and uuid fields 2021-08-22 12:36:25 +02:00
AsamK
73e137137d Discard messages from non-admins in announcement groups 2021-08-22 10:17:47 +02:00
AsamK
610e32aa52 Implement announcement groups 2021-08-22 09:55:53 +02:00
AsamK
b745f1f902 Trim zero bytes from profile fields 2021-08-22 08:54:21 +02:00
AsamK
a18d6b3fe4 Add json output listContacts command 2021-08-21 19:03:51 +02:00
AsamK
11c90fa032 Add json output listIdentities command 2021-08-21 18:54:55 +02:00
AsamK
70fc2381d3 Add json output listDevices and uploadStickerPack commands 2021-08-21 18:31:14 +02:00
AsamK
893b7f7f9d Refactor message sending 2021-08-21 15:51:54 +02:00
AsamK
b77d820661 Handle changed identity key correctly when sending message
Fixes #686
2021-08-20 20:03:59 +02:00
AsamK
19f7b5d78d Log a debug message when dropping json rpc response for request without id 2021-08-20 19:04:35 +02:00
AsamK
ef2a013db3 Let commands specify their own default output if none is provided by the user 2021-08-20 18:43:54 +02:00
AsamK
af292d8f0e Refactor command creation 2021-08-20 18:42:38 +02:00
technillogue
47143a90e1 reflect config to serialize jsonrpc
Closes #687
2021-08-19 21:18:31 +02:00
AsamK
e00eaf10e8 Adapt User-Agent string to get rate limit challenges 2021-08-18 19:37:03 +02:00
AsamK
89d498f87d Update README.md 2021-08-16 19:55:30 +02:00
AsamK
7089912fb0 Remove registrationLockV1 code
The corresponding endpoint has been removed on the Signal server
2021-08-15 21:30:21 +02:00
AsamK
dbfa8bb66b Update graalvm-config 2021-08-15 21:29:26 +02:00
AsamK
28f735741a Fix JsonRpcLocalCommand interface 2021-08-15 21:20:26 +02:00
AsamK
b810e303ec Update libsignal-service-java 2021-08-15 21:04:03 +02:00
AsamK
7ea3900854 Update CHANGELOG.md 2021-08-15 16:05:52 +02:00
technillogue
0c070b9719
add reflection config for v1 groups (#683) 2021-08-14 09:26:43 +02:00
AsamK
0bbd75c469 Implement JsonRpc command for remoteDelete and sendReaction 2021-08-10 18:51:48 +02:00
AsamK
b24fa98e3c Implement JsonRpc command for quitGroup 2021-08-10 18:51:48 +02:00
AsamK
7b809c6547 Implement JsonRpc command for joinGroup 2021-08-10 18:51:48 +02:00
AsamK
5d8d0dcad6 Implement JsonRpc command for commands without output 2021-08-10 18:51:48 +02:00
AsamK
6826e3cb49 Implement JsonRpc command for updateGroup
Co-authored-by: technillogue <technillogue@gmail.com>

Closes #666
2021-08-10 18:51:48 +02:00
AsamK
b09677a46c fix 2021-08-10 18:51:48 +02:00
AsamK
a8bbdb54d0 Implement jsonRpc command
Co-authored-by: technillogue <technillogue@gmail.com>

Closes #668
2021-08-10 18:16:50 +02:00
AsamK
6c00054407 Replace --group parameter with --group-id 2021-08-10 14:34:22 +02:00
AsamK
15e8029715 Add PlainTextWriter interface 2021-08-09 19:03:59 +02:00
AsamK
641dc7577c Rename --endsession parameter to --end-session 2021-08-09 17:42:34 +02:00
AsamK
8f781c019f Add dbus SignalControl interface to register/verify/link accounts 2021-08-08 18:43:14 +02:00
AsamK
48b2c7ff8a Refactor output writers 2021-08-08 17:32:55 +02:00
AsamK
f449a242e4 Remove fallbacks to deprecated data paths 2021-08-08 15:52:54 +02:00
AsamK
17d00d6ca8 Remove deprecated --json parameter 2021-08-08 10:44:23 +02:00
AsamK
54f7bc5d79 Bump version 2021-08-07 10:22:55 +02:00
AsamK
dde98e9b06 Update bouncycastle 2021-08-07 10:22:30 +02:00
AsamK
8dced20b0f Make name optional for updateContact
Fixes #676
2021-08-05 18:00:05 +02:00
AsamK
b1ebdc8343 Extract decryptProfileIfKeyKnown helper method 2021-07-31 22:19:31 +02:00
AsamK
07893546d0 Add hint to sticker upload error message 2021-07-31 22:19:31 +02:00
technillogue
9e72248e1b
update Graal reflect config with legacy classes (#667) 2021-07-24 09:58:29 +02:00
technillogue
8cc4877627
Include source name in JSON output (#663)
* add sourceName

* avoid sourceName might not have been initialized

* catch NullPointerException instead of checking for null

* Update JsonMessageEnvelope.java

Co-authored-by: AsamK <asamk@gmx.de>
Fixes #663
2021-07-23 17:19:09 +02:00
AsamK
dedbafb99a Bump version 2021-06-20 14:33:04 +02:00
exquo
f1d6890da4
Add README note about glibc version requirement for libsignal-client (#647)
Ref #643
2021-06-17 16:11:56 +02:00
AsamK
ca3871e223 Handle missing captcha parameter correctly
Fixes #644
2021-06-15 23:15:36 +02:00
AsamK
a0f04a9bc1 Bump version 2021-06-13 15:39:50 +02:00
AsamK
2d068997c5 Implement sticker pack retrieval
Fixes #410
2021-06-13 15:02:16 +02:00
AsamK
f40c351662 Add optional content type to json sticker pack manifest 2021-06-13 14:32:58 +02:00
AsamK
0b2d37fe68 Rename method parameter 2021-06-13 14:32:58 +02:00
AsamK
5e50a4cc4a Use correct hex implementation 2021-06-13 14:32:58 +02:00
AsamK
7e223dc228 Add sendTyping command
Fixes #602
2021-06-12 17:57:15 +02:00
AsamK
609ebf024b Update libsignal-service-java 2021-06-12 16:22:51 +02:00
AsamK
ec3d2346ef Strip url scheme from captcha string 2021-06-12 16:22:51 +02:00
AsamK
87406e2cdb Implement --delete flag for quitGroup
Closes #638
2021-06-12 11:33:19 +02:00
AsamK
d1e760f447 Reformat code 2021-06-12 08:53:37 +02:00
AsamK
795b73df87 Skip invalid contact records 2021-06-12 08:49:37 +02:00
AsamK
0001a9b300 Skip invalid group records
Fixes #642
2021-06-12 08:47:18 +02:00
AsamK
39c4cf24b8 Refresh group if group update conflicts with remote edit
Fixes #639
2021-06-02 20:40:02 +02:00
AsamK
a257a2f7b5 Add dbus signal handler on specific object
Otherwise the messages from all exported objects would be received

Fixes #635
2021-05-31 19:07:30 +02:00
AsamK
1ce1ae91be Use System.currentTimeMillis 2021-05-29 10:08:16 +02:00
AsamK
a70dfdc8b8 Fix error message 2021-05-28 18:09:41 +02:00
AsamK
15b16f3dc3 Update README.md 2021-05-24 23:39:01 +02:00
AsamK
cfc818872f Add hint that messages must be regularly received 2021-05-24 12:18:33 +02:00
AsamK
2a0bba62be
Update ci.yml 2021-05-23 13:39:44 +02:00
AsamK
9567835434 Update ci.yml 2021-05-22 13:38:13 +02:00
AsamK
79f1ca5491 Make lib module jar reproducible 2021-05-22 13:34:59 +02:00
AsamK
d3a4a3a99e
Update README.md 2021-05-21 22:29:04 +02:00
AsamK
bfd6b605e9 Prevent sending invalid locale to server 2021-05-21 15:38:11 +02:00
AsamK
b8a0901fbd Improve command line help
Fixes #450
2021-05-20 20:54:11 +02:00
AsamK
ab40344567 Extend tests 2021-05-20 20:09:57 +02:00
AsamK
1d87befdab
Update FUNDING.yml 2021-05-20 19:40:41 +02:00
AsamK
30690785fd Update libsignal-service-java 2021-05-19 22:51:35 +02:00
AsamK
f445cfb5c1 Include proof required information in sending error 2021-05-16 16:53:04 +02:00
AsamK
2016cf2a5f Fix camel case device-id flag 2021-05-16 16:11:55 +02:00
AsamK
109ce26780 Update tests 2021-05-16 16:11:15 +02:00
AsamK
5c3fc44d00 Update documentation 2021-05-15 18:53:00 +02:00
AsamK
761baf7206 Update tests 2021-05-15 18:40:16 +02:00
AsamK
81ee2c2d2b Update group with remaining options, after creating it 2021-05-15 18:26:45 +02:00
AsamK
ea633efc9c Prevent last admin from leaving group 2021-05-15 18:05:07 +02:00
AsamK
78f22c7020 Implement setting group permissions 2021-05-15 17:04:22 +02:00
AsamK
7170a68571 Implement setting expiration timer for groups 2021-05-15 17:04:22 +02:00
AsamK
03589f858b Implement configuring of group link 2021-05-15 17:04:22 +02:00
AsamK
3de30e166f Implement add/remove admin privileges 2021-05-15 17:04:22 +02:00
AsamK
b972522d74 Rename group v2 helper 2021-05-15 17:04:22 +02:00
AsamK
a91e3f762e Implement remove group members 2021-05-15 17:04:22 +02:00
AsamK
4ebacd0e1f Split createGroup out of updateGroup method 2021-05-14 21:33:04 +02:00
AsamK
dd0effc10c Add group descriptions 2021-05-13 20:05:46 +02:00
AsamK
8e8eed7b06 Update argparse4j 2021-05-13 18:06:57 +02:00
AsamK
06e9f8ba64 Update libsignal-service-java 2021-05-13 17:30:29 +02:00
AsamK
c1d3a647a2 Bump version 2021-05-13 14:51:20 +02:00
AsamK
726237cfaa Add test script to run tests against sandbox and update graalvm config 2021-05-13 13:10:27 +02:00
AsamK
dc92d824d3 Update graalvm config 2021-05-13 13:00:55 +02:00
AsamK
4fd3657f3d Prevent error when including self in member list 2021-05-13 11:56:03 +02:00
AsamK
da29cdfe10 Only send plain text pin if locked with registration lock v1 2021-05-13 10:35:01 +02:00
AsamK
db756bfe10 Add --service-environment to allow testing against sandbox environment 2021-05-12 23:28:52 +02:00
Florian7843
726103d138
Fixed typo, where "note" was written as "not" (#619) 2021-05-12 22:55:31 +02:00
AsamK
ea11f3b1fd Fix NPE when legacy profile has no capabilities
Fixes #616
2021-05-12 20:12:05 +02:00
AsamK
03a5483791 Remove old classes from graalvm config
Fixes #617
2021-05-12 19:45:35 +02:00
AsamK
3fc5bec149 Prevent NPE during migration, when profile key is null 2021-05-12 19:34:09 +02:00
AsamK
21d62c4557 Bump version 2021-05-11 22:02:36 +02:00
AsamK
2727487902 Don't send null message to self 2021-05-11 22:02:36 +02:00
AsamK
fa44f8b6a8 Add sendSyncRequest to man page 2021-05-11 22:02:36 +02:00
AsamK
a312f87529 Update dbus-java 2021-05-11 21:44:44 +02:00
AsamK
2ed19f5eaa Update CHANGELOG.md 2021-05-11 18:45:38 +02:00
AsamK
a851b5e655 Update graalvm config 2021-05-11 18:40:58 +02:00
AsamK
0455d3e8a8 Warn when using a legacy data path 2021-05-11 18:39:11 +02:00
AsamK
19c004e987 Store available profile data even if we don't have the profile key 2021-05-11 18:37:18 +02:00
AsamK
7364f0f7cf Trust address/uuid combination from unidentified sender certificate 2021-05-09 19:48:51 +02:00
AsamK
3643d57d0e Implement preliminary phone number privacy for sender certificate 2021-05-09 19:34:07 +02:00
AsamK
8217541d5e Reset profile key credentials when new profile key is changed 2021-05-09 19:28:49 +02:00
AsamK
ab95e635ce Allow relinking an account if it's no longer authorized 2021-05-09 12:22:44 +02:00
AsamK
0bc2141245 Log information when link message from main device has been received 2021-05-08 21:25:12 +02:00
AsamK
6cb867cbeb Encrypt/decrypt device names 2021-05-08 21:25:12 +02:00
AsamK
56ac648922 Reduce default receive timeout to 1 second 2021-05-08 15:30:27 +02:00
AsamK
6eb486e858 Store device name in account file and prevent it from becoming null on the server 2021-05-08 15:29:00 +02:00
AsamK
a4e34e600e Check if account file already exists before actually completing device link 2021-05-08 15:19:49 +02:00
AsamK
e188121733 Adapt systemd service to allow successful shutdown 2021-05-07 18:00:20 +02:00
AsamK
f43acc5c60 Update CHANGELOG.md 2021-05-05 20:21:44 +02:00
AsamK
1bd60eea81 Renew session if message decryption fails with ProtocolInvalidMessageException 2021-05-05 20:20:02 +02:00
AsamK
b7f05a1c80 Extend updateProfile command to set family name 2021-05-05 19:32:52 +02:00
AsamK
3d361d54bb Add version to account file 2021-05-05 19:02:22 +02:00
AsamK
3357945a5a Reduce usage of deprecated resolved methods 2021-05-04 21:18:25 +02:00
AsamK
5427fa0132 Archive recipient's sessions after identity key switch 2021-05-04 20:38:00 +02:00
AsamK
57617accb2 Update CHANGELOG.md 2021-05-04 19:53:35 +02:00
AsamK
451b4c8433 Update CHANGELOG.md 2021-05-03 21:02:42 +02:00
AsamK
9e3c9db5c0 Add sendSyncRequest command 2021-05-03 20:37:13 +02:00
AsamK
36475bb632 Prevent updateContact and block commands on linked devices
The changes would be overwritten with the next sync anyway

Fixes #600
2021-05-03 19:46:35 +02:00
AsamK
312c6c8bb2 Check if profileKey is null for old accounts 2021-05-03 18:43:45 +02:00
AsamK
4f578c2645 Create an initial empty profile after registration 2021-05-03 18:43:45 +02:00
AsamK
7afb1347b4 Attempt to refresh recipients uuid if sending fails 2021-05-03 18:43:45 +02:00
AsamK
0091c1cf26 Add --delete-account argument to completely delete an account 2021-05-03 18:43:45 +02:00
AsamK
c79860b493 Minor fixes 2021-05-03 18:43:45 +02:00
AsamK
530ef51ba7 Handle saving inside SignalAccount 2021-05-03 18:43:45 +02:00
AsamK
5b8c0c4e2d Refactor group store 2021-05-03 18:43:45 +02:00
AsamK
a1014ba39c Correctly store uuid from server 2021-05-03 18:43:45 +02:00
AsamK
624fa4fda4 Refactor sticker store 2021-05-03 18:43:45 +02:00
AsamK
4e123a2dc3 Split load signal account method 2021-05-03 18:43:45 +02:00
AsamK
224d8194cc Refactor contact and profile store 2021-05-03 18:43:45 +02:00
AsamK
a96bd91770 Fix displaying group quit messages 2021-05-01 16:02:32 +02:00
AsamK
08962fd1dc Don't clear contact store before receiving new sync contacts 2021-05-01 15:03:26 +02:00
AsamK
a05a24873a Only respond to sync requests if we're the master device 2021-05-01 15:03:26 +02:00
AsamK
deb4ecd04f Retrieve profile to get latest identity key 2021-05-01 08:46:00 +02:00
AsamK
2ef59d692a Store messages in cache by recipient id 2021-05-01 08:46:00 +02:00
AsamK
8a0c6cae15 Refactor identity key store 2021-05-01 08:46:00 +02:00
AsamK
afb22deada Refactor signed pre key store 2021-05-01 08:46:00 +02:00
AsamK
ccc380f575 Refactor pre key store 2021-05-01 08:46:00 +02:00
AsamK
f77519445c Refactor sessions store 2021-05-01 08:46:00 +02:00
AsamK
9f5347964b Refactor recipients store 2021-05-01 08:46:00 +02:00
AsamK
3ad3b2c966 Move RecipientStore to recipients package 2021-05-01 08:46:00 +02:00
AsamK
357e278f48 Remove error handling for oracle unlimited crypto issue 2021-05-01 08:45:10 +02:00
infra
0a63dd1db4
Enable unlimited strength crypto via system Security property (#608) 2021-05-01 08:38:31 +02:00
AsamK
bda9528392 Add missing reflection declarations for graalvm #576
commit 5bdc0d2f72
Author: René Filip <renefilip@mail.com>
Date:   Sun Mar 21 09:01:49 2021 +0100

    add missing declarations

commit a4b7f00f27
Author: René Filip <renefilip@mail.com>
Date:   Sat Mar 20 17:39:10 2021 +0100

    add missing reflection declarations for graalvm

Closes #576
2021-04-28 20:37:26 +02:00
infra
c5c3720f80
Enables reproducible builds by disabling timestamps and enabling reproducible build order in archive outputs. (#607)
Co-authored-by: infra <infra@sterile.solutions>
2021-04-27 17:50:36 +02:00
AsamK
b9b4d846d3 Resolve recipient address when displaying untrusted identity message 2021-04-23 22:00:09 +02:00
AsamK
3935ebf81b Update gradle 2021-04-15 19:37:27 +02:00
Adaptive Garage
05abb3f9f6
Send remote delete (#593)
* Implementation of remoteDelete command, iteration 1

* Implementation of remoteDelete command, iteration 2

* Implementation of remoteDelete command, iteration 3

* Implementation of remoteDelete command, iteration 4

* Implementation of remoteDelete command, iteration 5

* Implementation of remoteDelete command, iteration 6

* Renaming dbus methods remoteGroupDelete -> sendGroupRemoteDeleteMessage, remoteDelete -> sendRemoteDeleteMessage
2021-04-05 19:49:45 +02:00
Adaptive Garage
2ad18342a8
Dbus sendreaction doc (#591)
* Documentation of dbus methods sendGroupMessageReaction, sendMessageReaction

* Documentation of dbus methods sendGroupMessageReaction, sendMessageReaction. Fix 1.
2021-04-05 17:00:20 +02:00
exquo
7832afd819
Improve DBus man page (#589)
* Improve DBus man page

- Expand synopsis
- Add examples
- Fix typos

* Update to DBus man page
2021-04-03 21:22:05 +02:00
AsamK
b39f7c1807 Remove redundant public modifiers from interface 2021-04-03 19:08:45 +02:00
AsamK
4f9c0172ef Update README 2021-04-02 09:22:15 +02:00
Adimarantis
caf16231aa
Adding Dbus manpage (#564)
* some small dbus return code fixes

* Added DBus manpage

* changed getDisplayName behaviour

* reverted change in manager

* some small dbus return code fixes

* Added DBus manpage

* changed getDisplayName behaviour

* reverted change in manager

* Dbus manpage
2021-04-02 09:19:07 +02:00
Adaptive Garage
8f4d89e2f7
dbus implementation of sendReaction command (#581) 2021-04-02 08:53:54 +02:00
Adaptive Garage
ea035db94f
Fix sendReaction to group (#580)
Co-authored-by: rknotek <roman.knotek@comint.cz>
2021-03-24 21:49:03 +01:00
AsamK
b5f0a26084 Use a new serviceID for the re-deployed KBS setup in staging. 2021-03-13 10:10:07 +01:00
AsamK
1bf848cde1 Ignore broken user data again for multi account commands 2021-03-08 21:21:51 +01:00
AsamK
be4b683a41 Allow MultiLocalCommands to be called when no local users exist 2021-03-08 21:21:51 +01:00
AsamK
9944b666b0 Return URI instead of String 2021-03-08 21:21:51 +01:00
AsamK
2935b96070 Return a Manager from ProvisioningManager and RegistrationManager when finished 2021-03-08 21:21:51 +01:00
Adimarantis
a7b414a870
some small dbus return code fixes (#556)
* some small dbus return code fixes

* Added DBus manpage

* changed getDisplayName behaviour

* reverted change in manager
2021-03-07 21:05:49 +01:00
AsamK
2ea56a1b67
Update README.md 2021-03-07 16:26:33 +01:00
AsamK
52739140ef Bump version 2021-03-02 20:48:52 +01:00
AsamK
253757cb31 Improve dbus impl 2021-03-01 20:39:45 +01:00
AsamK
631f10c916 Reformat 2021-03-01 20:33:12 +01:00
Adimarantis
1d2c7a479d
Dbus enhancements (#543)
* Dbus enhancements

* reverted sendMessage, completed isContactBlocked, fixed formatting

* Updates based on feedback and fixes

* Added trim

* fixed getContactName Exception handling
2021-03-01 20:31:17 +01:00
AsamK
8d0de67530 Add getDisplayName to SignalProfile 2021-02-28 10:19:40 +01:00
AsamK
9ca89b3dfa Catch all exceptions when loading cached message 2021-02-28 09:49:02 +01:00
AsamK
86711b0e5c Print exception name when failing to load state fiel 2021-02-27 17:44:33 +01:00
AsamK
17d6b256e8 Create CONTRIBUTING.md 2021-02-27 17:44:33 +01:00
AsamK
ef2ba0b8e0 Create FUNDING.yml 2021-02-27 17:44:27 +01:00
AsamK
4860caef63 Improve behavior of trust command
- Remove all other identities for the same number

Fixes #540
2021-02-25 19:20:02 +01:00
AsamK
8249f852f9 Fix issue with broken sessions
Fixes #530
2021-02-23 21:50:31 +01:00
AsamK
221d937eec Add CommandException to abstract cli return codes for errors 2021-02-23 21:42:42 +01:00
AsamK
c6395b9f35 Use PlainTextWriter for all cli stdout output 2021-02-22 20:43:02 +01:00
AsamK
de273586b4 Use var instead of explicit types 2021-02-21 15:01:41 +01:00
AsamK
03c30519b1 Refactor ReceiveMessageHandler
Introduce PlainTextWriter to improve indentation handling.
2021-02-20 19:22:36 +01:00
AsamK
6c33a89f82 Reformat code 2021-02-19 18:04:08 +01:00
Atomic-Bean
237abe431b
Output "SharedContacts" field from a SignalDataMessage (#529)
* Initial version of SharedContacts from data message. Need to change location of avatar downloaded and fix plain text mode

* Made empty strings for json null and fixed plaintext output

* Removed old comments, simplified if-statement and added a 'leadingSpaces' field to the print attachments/mentions functions

* Added AsamK's changes
2021-02-19 18:03:15 +01:00
AsamK
9f3276d7e3 Reformat code 2021-02-19 17:56:43 +01:00
Adimarantis
d0ce3c1543
Add updateProfile to Dbus (#522)
* Added updateProfile on Dbus

* added updateProfile on Dbus (fix)

Co-authored-by: Adimarantis <adimarantis@gmail.com>
2021-02-19 17:54:59 +01:00
AsamK
129a846cc1 Bump version 2021-02-14 11:01:06 +01:00
AsamK
9eeba88bd0 Add more information for libsignal-client native dependency 2021-02-14 10:40:35 +01:00
AsamK
0dc33e1892 Add more information for CaptchaRequiredException 2021-02-13 18:40:27 +01:00
AsamK
3ed776e4cc Only attempt to delete profile avatar if it exists
Fixes #486
2021-02-13 15:16:54 +01:00
AsamK
40fc712581 Update signal-service-java 2021-02-13 09:58:40 +01:00
Michael Kebe
630803c3d1
GraalVM: added reflection config (#507)
* GraalVM: added reflection config for delete messages

* GraalVM: added reflection config for PreKey exchange

* GraalVM: added reflection config for DuplicateMessageException

* GraalVM: added reflection config for JsonRemoteDelete

* GraalVM: added reflection config for JsonAttachment

* GraalVM: added reflection config for JsonSticker and Contacts
2021-02-09 17:39:36 +01:00
AsamK
0797217588 Print additional call message content 2021-02-07 18:47:21 +01:00
Dom
23df85ff90
Proposal for the Manager class to manage an ExecutorService for all SignalServiceMessageSender instances (#482)
* Modified the Manager class to provide an ExecuterService for the SignalServiceMessageSender.

* removed unnesessary comment

* Changed the ExecutorService to a unbounded newCachedThreadPool

Co-authored-by: Cutkh <cutkh@users.noreply.github.com>
2021-02-03 19:40:12 +01:00
Michael Kebe
c276055302
GraalVM configuration update (#477)
* graalvm configuration update

removed unnecessary classes from reflect
added libsignal_jni.so to resource-config.json
graalvm configuration changed location of ias.store and whisper.store

* graalvm configuration fixes receiving messages

* graalvm config setPin

* graalvm config quitGroup

* graalvm config trust

* graalvm config more receive failed to decrypt error

* graalvm config --output=json

* graalvm config JsonTypingMessage
2021-01-27 16:35:29 +01:00
AsamK
a811d1a05a Add support for about and aboutEmoji for profiles 2021-01-24 00:02:07 +01:00
AsamK
7d802fb8c5 Refactor ServiceConfig and add sandbox config 2021-01-23 23:29:18 +01:00
AsamK
4eaec83594 Extract checkLibVersions task to gradle plugin 2021-01-23 23:29:18 +01:00
AsamK
c72aeed8bb Extract lib module 2021-01-23 23:29:18 +01:00
AsamK
4adb11dada Convert gradle scripts to kotlin 2021-01-23 16:00:03 +01:00
AsamK
69149b16c1 Prepare build.gradle for kotlin migration 2021-01-23 13:38:13 +01:00
AsamK
383e7db360 Update gradle wrapper 2021-01-23 13:00:12 +01:00
AsamK
644aacf595 Update libsignal 2021-01-23 12:59:47 +01:00
AsamK
b4311c7b76 Add more config generated by agent 2021-01-23 11:13:01 +01:00
AsamK
de3b077a6f Update libsignal 2021-01-23 11:12:54 +01:00
Michael Kebe
a709447536
Added GraalVM configuration to create a native binary (#452)
* Initial GraalVM configuration

* graalvm reflection changes for v0.7.4

* graalvm removed unneeded options for native-image

* updated gradle plugin org.mikeneck.graalvm-native-image to 1.1.0

* moved from gradle graalvm-native-image plugin to native-build.sh

* added missing graalvm reflection config for receive

* refactored native-build.sh to a gradle task buildNativeBinary
2021-01-23 11:11:50 +01:00
Benjamin Schmid
cb596c15f1
doc(README): put links to manpage & wiki first (#459)
- Directly provide links to the complete man page below usage
- Extend explanation of `USERNAME`
2021-01-21 18:44:31 +01:00
AsamK
d50db1d671 Bump version 2021-01-19 17:31:10 +01:00
AsamK
6f4b171683 Request storage key after linking 2021-01-19 17:04:02 +01:00
AsamK
eae516a9a7 Fix issue with incorrectly saving signalingKey
Fixes #442, #447
2021-01-19 16:58:28 +01:00
AsamK
c3c1802b4d Store storage key from keys sync message 2021-01-18 20:33:04 +01:00
AsamK
80e15ad54e Only allow setting PIN by master device 2021-01-18 20:29:01 +01:00
AsamK
f4ed9a01b7 If contact name is not set, print profile name instead 2021-01-18 20:28:25 +01:00
AsamK
804ad34a08 Send and handle fetch profile sync message 2021-01-17 17:38:33 +01:00
AsamK
70690fef36 Use getRegisteredUsers instead of getContacts for updating v1 group
Fixes #437
2021-01-17 16:52:10 +01:00
AsamK
a80e26896a Bump version 2021-01-17 13:14:12 +01:00
AsamK
c440520ea6 Ignore relay in json output if null 2021-01-17 12:36:11 +01:00
AsamK
a28ad7195c Add remote delete info to json output
Fixes #424
2021-01-17 11:57:46 +01:00
AsamK
3b29add396 Add typing message to json output
Fixes #423
2021-01-17 11:43:39 +01:00
AsamK
5a2c4b8dfd Add viewOnce boolean to json data message 2021-01-17 11:29:11 +01:00
AsamK
46a4c2c0d0 Make fields in json classes final and omit unnecessary nulls when serializing
Fix sender in sync read messages
2021-01-17 11:23:02 +01:00
AsamK
dd4225dcb1 Rename Cli class to App 2021-01-16 21:20:12 +01:00
AsamK
a2debdb234 Check if output type is supported by command 2021-01-16 21:12:01 +01:00
AsamK
c588130491 Fix group info for json dbus messages 2021-01-16 20:12:24 +01:00
AsamK
690ce2829f Fix logger names 2021-01-16 20:11:50 +01:00
AsamK
03bf043959 Extract JsonWriter for json output 2021-01-16 20:11:32 +01:00
AsamK
d4b4bd8603 Add an enum for output types 2021-01-16 18:52:06 +01:00
AsamK
14c8f07b8d Move buildArgumentParser to Cli class 2021-01-16 18:09:29 +01:00
AsamK
fe25ae275b Use getRegisteredUsers (CDS2) instead of getContacts for getUserStatus command
That's what the official app does, looks like the old contact discovery
system is not working anymore.
2021-01-16 17:06:10 +01:00
AsamK
06404667a1 Use exit 4 when sending a single recipient message fails due to untrusted identity key
Fixes #88
2021-01-16 15:38:38 +01:00
AsamK
e1134d832a Send self messages as normal messages, new flag --note-to-self for sync message
Fixes #373
2021-01-16 11:56:41 +01:00
AsamK
b31e97dd2d Move recipients/group argument check to send commands 2021-01-16 10:21:38 +01:00
AsamK
9e061c8667 Update systemd service file 2021-01-16 09:00:03 +01:00
AsamK
ca86c421eb Allow calling signal-cli without -u flag
For daemon command all local users will be exposed as dbus objects
If only one local user exists, all other commands will use that user,
otherwise a user has to be specified.
2021-01-16 09:00:03 +01:00
AsamK
a97bbf8608 Improve logging for provisioning 2021-01-16 09:00:03 +01:00
AsamK
c0f5ff8805 Prevent incorrect error log about saving failed if an exception was thrown 2021-01-16 09:00:03 +01:00
AsamK
9a775171b5 Replace Base64 class from libsignal with java.util.Base64 2021-01-15 22:32:13 +01:00
AsamK
e6ea5d55f8 Update man page 2021-01-15 22:32:13 +01:00
AsamK
8d985d84fb Set log level to debug for verbose mode 2021-01-15 18:29:48 +01:00
AsamK
54a2a95fb5 Fix loading some account files without legacy store 2021-01-15 18:29:48 +01:00
AsamK
fc76c9badf Remove unnecessary isRegistered checks 2021-01-15 12:21:19 +01:00
AsamK
cc40c437d1 Use global output flag for daemon command 2021-01-15 12:09:37 +01:00
AsamK
5938d54784 Add --verbose flag to show extended logging
Fixes #379
2021-01-15 11:43:53 +01:00
AsamK
20681b8d89 Extract some utils from manager 2021-01-14 22:19:54 +01:00
AsamK
5760a53831 Update man page 2021-01-14 22:19:54 +01:00
AsamK
c95897d17b Fix file name for contact avatars 2021-01-14 21:26:20 +01:00
AsamK
96d316b1dd Create an AttachmentStore 2021-01-14 21:26:01 +01:00
AsamK
9bb935b11f Always include profile key in direct messages
Adjusts behavior to official client

Fixes #416
2021-01-14 18:41:21 +01:00
Atomic-Bean
9bba7a85ab
Added sticker field to json output. Also added hidden mac file to .gitignore (#418) 2021-01-14 18:10:35 +01:00
AsamK
a643609ed2 Create an AvatarStore 2021-01-13 22:35:58 +01:00
AsamK
6bd857ad8b Always delete temporary files on exit 2021-01-13 20:56:23 +01:00
AsamK
0624d6a808 Make loggers private 2021-01-13 20:19:34 +01:00
AsamK
783c88cb6a Ignore group message if the sender is not in the group 2021-01-13 19:13:03 +01:00
AsamK
f0834c7a47 Reformat man doc and clarify help text 2021-01-13 17:04:58 +01:00
Atomic-Bean
90f5cd79c9
Added JSON output to listGroups and allowed json to be activated with -j (#401)
* Added json output to listGroups and allowed json to be activated with -j

* Renamed classes

* Added AsamK's suggestions

* Removed isRegisted check since that is causing a conflict with upstream

* Fixed an issue in the help message for listGroupsCommand

* Re-enabled --json for receive and getUserStatuses commands as deprecated

* Added better depricated warning message and clarified some java doc stuff
2021-01-13 16:51:31 +01:00
AsamK
c9fa28d844 Extract pre key generation to KeyUtils 2021-01-12 20:40:17 +01:00
AsamK
bc47c0d5d6 Refactor message cache 2021-01-11 21:18:03 +01:00
AsamK
38267fa2a1 Update copyright notices 2021-01-11 19:51:24 +01:00
AsamK
e74be0c345 Refactor register and verify 2021-01-10 23:06:13 +01:00
AsamK
6c8a1ff3d3 Check for null query when decoding device link uri 2021-01-10 23:06:13 +01:00
AsamK
263fdceb94 Fix expectedV2Id serialization 2021-01-10 23:06:13 +01:00
AsamK
51db5495c0 Fix pin hash version to match android 2021-01-10 18:16:42 +01:00
AsamK
9244d1e8a8 Disable registration lock before removing pin 2021-01-10 18:16:26 +01:00
AsamK
0c7da68d98 Download group info if it's missing in the cache 2021-01-10 15:26:45 +01:00
AsamK
88d81c7a63 Move IdentityKeyPair generation to KeyUtils
in preparation for rust libsignal which doesn't provide the method
2021-01-04 18:04:10 +01:00
AsamK
00339b1abe Improve user status command 2021-01-03 21:04:32 +01:00
Atomic-Bean
1c5de83370
Command to check if number is registered (#391)
* Added the isRegistered command

* Minor fixes

* Corrected description

* Added AsamK's suggestions

Fixes #178
2021-01-03 21:02:34 +01:00
AsamK
a475bc50e9 Bump version 2020-12-31 18:07:06 +01:00
AsamK
f1e5fc6c0b Request profiles without uuid if libzkgroup is not available
Fixes #397
2020-12-31 16:14:30 +01:00
AsamK
425626ef94 Implement registration pin lock with KBS
Fixes #323
Fixes #268
2020-12-31 15:41:00 +01:00
AsamK
a52f6a6657 Replace Collections with Set.of/Map.of/List.of 2020-12-30 16:50:17 +01:00
AsamK
bbdd6a8910 Cleanup utils 2020-12-29 23:01:58 +01:00
AsamK
b738f5740c Move storage package to manager 2020-12-29 22:15:38 +01:00
AsamK
9e6a353427 Move group classes to separate package 2020-12-29 22:09:06 +01:00
AsamK
22f19c4067 Use File instead of String 2020-12-26 18:08:01 +01:00
AsamK
5c754b6f5d Use slf4j simple logger 2020-12-26 18:07:58 +01:00
AsamK
6a82029ab4 Use base64 group id for protobuf group file to match avatar files
base64 with '/' replaced by '_'
2020-12-25 13:46:35 +01:00
AsamK
caabde4acf Fix prevention of adding group members a second time 2020-12-25 13:42:51 +01:00
AsamK
ff998fce57 Fix handling data messages of sync messages 2020-12-24 18:05:12 +01:00
AsamK
e11e020886 Retrieve group v2 avatars
Fixes #392
2020-12-24 17:53:23 +01:00
AsamK
9942d967a4 Refactor to use GroupId class to wrap the byte array
Helps distinguish between group v1 and v2 ids
2020-12-24 16:36:47 +01:00
AsamK
67f62947c6 Add null check and change some formatting 2020-12-23 11:33:01 +01:00
Atomic-Bean
58db3cbd53
Quotes, Mentions and Reactions in non-daemon JSON mode (#389)
* Added support for quotes, mentions and reactions in non-daemon JSON output
2020-12-23 11:23:40 +01:00
AsamK
548c313b4c Download quote attachment thumbnails and slightly improve the quote output 2020-12-23 00:18:28 +01:00
AsamK
83d5d53d8a Bump version 2020-12-21 21:59:41 +01:00
AsamK
8957a08453 Print warning if libzkgroup is missing 2020-12-21 21:56:48 +01:00
AsamK
445e8592c4 Implement join group via invitation link 2020-12-21 21:21:40 +01:00
AsamK
9912da9546 Show group invite link in group list 2020-12-21 16:59:54 +01:00
AsamK
6be0b2da77 Implement blocking for v2 groups 2020-12-21 15:24:52 +01:00
AsamK
17608ce522 Implement accepting and declining group invitations 2020-12-21 15:23:50 +01:00
AsamK
c49b05cd75 Get UUIDs for unknown numbers from server 2020-12-21 14:56:37 +01:00
AsamK
2617757edb Add group v2 id to json output 2020-12-21 14:30:42 +01:00
AsamK
4d17e50323 Bump version 2020-12-15 23:07:16 +01:00
AsamK
49c4b762b6 Prevent NullPointerException when destination is null for some reason 2020-12-15 18:58:49 +01:00
AsamK
1098b64711 Implement quit group 2020-12-14 19:14:58 +01:00
AsamK
1fd62ee342 Implement updating of v2 groups 2020-12-13 12:01:18 +01:00
AsamK
98dee97cc6 Apply decrypted group change when receiving signed change 2020-12-12 11:51:38 +01:00
AsamK
c10910e466 Migrate local group to v2 if another member has migrated it 2020-12-12 11:42:38 +01:00
AsamK
f6061f95de Update dbus-java 2020-12-11 23:26:00 +01:00
AsamK
591c0fe8a3 Reformat project 2020-12-08 20:59:20 +01:00
AsamK
4f2261e86f Implement creating V2 Groups 2020-12-08 20:47:44 +01:00
AsamK
d267974223 Show pending and requesting members of v2 groups 2020-12-04 19:51:36 +01:00
AsamK
6bfcba4940 Only update account attributes if already registered 2020-12-01 19:06:41 +01:00
AsamK
4acc9a96e3 Implement a sticker store 2020-11-25 21:12:40 +01:00
AsamK
6a1b7dc597 Implement support for sending/receiving Group V2 messages
Requires libzkgroup to work, which is currently only included for x86_64 Linux

Related #354
2020-11-23 22:40:14 +01:00
AsamK
6d016bcfc9 Update codestyle 2020-11-23 22:40:14 +01:00
AsamK
9fff8f5b14 Bump version 2020-11-22 15:50:34 +01:00
AsamK
4c3a249a2c Add CHANGELOG.md 2020-11-22 15:49:42 +01:00
AsamK
943b2c7304 Add output for new message infos 2020-11-22 12:56:32 +01:00
AsamK
c3e1d4fc75 Add possibility to pass a captcha token to register command
Fixes #251
2020-11-22 11:03:14 +01:00
AsamK
4485188789 Adapt json output to always use receiptMessage and remove isReceipt field
Fixes #346
2020-11-22 10:48:55 +01:00
AsamK
a634b46eb2 Remove legacy EncapsulatedExceptions from manager 2020-11-22 10:38:28 +01:00
AsamK
d94a7511dd Use StandardCharsets.UTF_8 2020-11-22 10:03:41 +01:00
AsamK
8a86f250ec Store profile keys only in profile store
Fixes #328
2020-11-21 20:11:46 +01:00
AsamK
8c1f082c8a Save account data after executing message actions
Fixes #361
2020-11-21 11:51:59 +01:00
AsamK
2ab8646168 Don't retry messages if they fail for another reason than untrusted identity 2020-11-21 11:51:31 +01:00
AsamK
019efbe22c Show view once, remote delete and mentions info when receiving message 2020-11-21 11:50:40 +01:00
AsamK
b0502f9f82 Update dependencies 2020-11-21 11:49:06 +01:00
AsamK
94a2da5bc1
Update codeql-analysis.yml 2020-11-19 17:17:32 +01:00
AsamK
3cbb8de656 Print addition message info 2020-10-22 18:30:26 +02:00
AsamK
83877d6939 Bump version 2020-10-14 18:39:18 +02:00
AsamK
a54fc92c05 Fix behavior for recipients with only UUIDs
Fixes #359
2020-10-11 11:15:34 +02:00
Mateusz Piotrowski
ae39d6a085 Bump required JRE version in README 2020-09-28 18:11:12 +02:00
AsamK
e713fd83a9 Bump version 2020-09-11 16:25:12 +02:00
AsamK
ad509e8097 Refactor ProfileStore to handle name/uuid addresses correctly 2020-09-11 16:22:30 +02:00
AsamK
bb24a2aa31 Add workaround to fix crashes if native libzkgroup is not available
Fixes #350
Fixes #349
Fixes #344
2020-09-11 15:35:44 +02:00
AsamK
bb59d1c9c9 Ignore error if downloading profile avatar fails 2020-09-11 09:23:30 +02:00
AsamK
2ccff8f51d Support saving profiles for users without uuids
Fixes #347
2020-09-11 09:16:31 +02:00
AsamK
7334c78450 Prevent corrupting account file, when serialization fails 2020-09-11 09:14:41 +02:00
AsamK
87c0282af5 Bump version 2020-09-10 16:02:46 +02:00
AsamK
4d80117e87 Update gradle wrapper 2020-09-10 16:02:41 +02:00
AsamK
20e253372b Remove deprecated calls 2020-09-10 14:40:52 +02:00
AsamK
b94c1e50e6 Cache profiles for 24h before retrieving them again 2020-09-10 14:20:16 +02:00
AsamK
0f3aa22519 Retrieve avatar profile image 2020-09-10 12:20:04 +02:00
AsamK
6c4d272309 Update libsignal-service 2020-09-10 11:07:30 +02:00
AsamK
4d8b103570 Use java 14 for CI builds 2020-09-10 10:16:24 +02:00
Lars K.W. Gohlke
0dfe4d189b cleanup: removes deprecation 2020-09-06 20:43:23 +02:00
Lars K.W. Gohlke
a747ddbae4 replaces strings to enable compile time checking 2020-09-06 20:43:23 +02:00
Lars K.W. Gohlke
7e1764200b Update codeql-analysis.yml 2020-08-27 18:06:09 +02:00
Lars K.W. Gohlke
057168c421 set to jdk11 2020-08-27 18:06:09 +02:00
exquo
1be13392da Adjust link to a renamed wiki page 2020-08-19 13:03:38 +02:00
AsamK
2e1660f066 Update README.md 2020-08-14 20:52:21 +02:00
AsamK
2c5a70cc47 Improve stderr output 2020-08-14 20:49:54 +02:00
AsamK
2c3d222e84 Remove unnecessary stderr output
Fixes #334
2020-08-14 20:49:54 +02:00
Mateusz Piotrowski
b1e9f4e158 Mention the availability of signal-cli on FreeBSD 2020-08-14 20:49:50 +02:00
AsamK
e6c1e03e21 Update dependencies
updateProfile can now only update both name and avatar at the same time,
as the upstream API has changed.
2020-08-09 13:00:29 +02:00
AsamK
6b02b1076c Update dependencies 2020-08-06 22:35:59 +02:00
AsamK
f96770df3c Move decrypting recipient profile to separate method 2020-08-06 22:35:59 +02:00
Mateusz Piotrowski
3aade45643 Fix a typo 2020-08-05 20:23:06 +02:00
AsamK
1ba2626ae9
Create codeql-analysis.yml 2020-08-04 22:37:04 +02:00
AsamK
2f9873c35e Use isEmpty() 2020-07-02 21:34:52 +02:00
Elburz Sorkhabi
23282fc7e8 add further clarification to addDevice docs
I added a short note mentioning to add quotation marks around the full URI, otherwise the user receives "Invalid device URI" errors from Java.
2020-06-22 18:32:50 +02:00
AsamK
4177deccf1 Ignore closed channel exception when closing the channel lock 2020-06-05 12:14:04 +02:00
AsamK
a83924238f Print more information for sync requests 2020-06-05 12:13:38 +02:00
AsamK
34caba2a7a Delay auto responses to messages until caught up with old messages
To prevent responding with old state, if the last receive call was a long
time ago.
2020-06-05 12:13:17 +02:00
AsamK
d14b8ac71f Detect when receive has caught up with old messages 2020-06-04 18:44:13 +02:00
AsamK
5829e3f117 Create service config only once 2020-06-04 17:59:05 +02:00
AsamK
22336460cc Update dependencies 2020-06-04 17:07:03 +02:00
exquo
f324a43298 Remove references to the native unix-java library
Since version 0.6.8 signal-cli uses hypfvieh dbus-java, so installing the packages libunixsocket-java (Debian), libmatthew-java (Fedora) or libmatthew-unix-java (ArchLinux) is not necessary.
2020-06-02 17:55:55 +02:00
AsamK
cf1cd60b9f Bump version 2020-05-22 15:03:35 +02:00
AsamK
bfb12b0872 Refactor sendMessage and extract sendSelfMessage method 2020-05-22 12:54:22 +02:00
AsamK
1aba9f370e Extract sending of expiration timer update to separate method 2020-05-22 12:48:39 +02:00
AsamK
e048b1886d Store number/uuid in recipient store after receiving a message
Necessary to find the correct session if the sender send the next message
with only the uuid.

Fixes #309
2020-05-22 12:32:36 +02:00
Matúš Košút
b382a4260b
Contact config - message expiration time (#308)
Co-authored-by: Matus Kosut <matus.kosut@ntnu.no>
2020-05-16 22:55:53 +02:00
AsamK
1e0aa8929d Separate DbusSignal implementation from Manager 2020-05-15 23:11:18 +02:00
AsamK
d08508e6ef Move Exception classes to corresponding package 2020-05-15 20:03:51 +02:00
AsamK
0287272a3b Make fields final for DBusSignal classes 2020-05-14 23:44:24 +02:00
AsamK
063f2fb294 Update dependencies 2020-05-14 19:47:35 +02:00
AsamK
28be77572f Update dependency 2020-05-14 19:14:20 +02:00
AsamK
d520023fc7 Refactor Manager and SignalAccount to implement Closeable
Should make sure that file lock and web socket connections are closed
reliably.
2020-05-13 23:33:40 +02:00
AsamK
87f65de0c5 Save account state after ending session even if sending the message has failed 2020-05-11 18:31:22 +02:00
AsamK
a02031aa80 Refactor Manager to always have a valid SignalAccount instance
Extract ProvisioningManager to link new devices
2020-05-11 18:07:37 +02:00
AsamK
8163a42d3a Split manager ServiceConfig from BaseConfig 2020-05-11 14:51:55 +02:00
AsamK
06caf4ebb3 Update dependencies 2020-05-11 11:49:02 +02:00
AsamK
916d0e3cf1 Don't send group info request after receiving QUIT for unknown group
The sender has quit the group so he won't respond to the info request anyway
2020-05-07 12:41:49 +02:00
AsamK
26840a2f0f Update dependencies 2020-05-06 20:11:26 +02:00
AsamK
a486b752e8 Improve asciidoc formatting of the man page 2020-05-06 09:24:54 +02:00
AsamK
d8ef312b5f Remove version check which isn't working correctly 2020-05-06 09:18:48 +02:00
AsamK
00777a469c Switch to hypfvieh dbus-java
Removes transitive dependency on libmatthew-unix-java

Fixes #285
2020-05-06 09:13:49 +02:00
AsamK
207075c236 Update README.md
Closes #286
2020-05-06 08:37:30 +02:00
AsamK
08749fcee0 When sending an end session message clear local session store also if sending message fails 2020-04-21 20:36:28 +02:00
AsamK
19b01ff2e9 Also catch IllegalArgumentException when sending messages during receive
It's necessary to keep receiving messages if a session state is corrupted.
e.g:
Exception in thread "main" java.lang.IllegalArgumentException: Empty key
        at java.base/javax.crypto.spec.SecretKeySpec.<init>(Unknown Source)
        at org.whispersystems.libsignal.ratchet.ChainKey.getBaseMaterial(ChainKey.java:57)
        at org.whispersystems.libsignal.ratchet.ChainKey.getMessageKeys(ChainKey.java:47)
        at org.whispersystems.libsignal.SessionCipher.encrypt(SessionCipher.java:97)
        at org.signal.libsignal.metadata.SealedSessionCipher.encrypt(SealedSessionCipher.java:70)
        at org.whispersystems.signalservice.api.crypto.SignalServiceCipher.encrypt(SignalServiceCipher.java:86)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.getEncryptedMessage(SignalServiceMessageSender.java:1456)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.getEncryptedMessages(SignalServiceMessageSender.java:1406)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.sendMessage(SignalServiceMessageSender.java:1276)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.sendReceipt(SignalServiceMessageSender.java:206)
        at org.asamk.signal.manager.Manager.sendReceipt(Manager.java:686)
        at org.asamk.signal.manager.Manager.handleMessage(Manager.java:1562)
        at org.asamk.signal.manager.Manager.receiveMessages(Manager.java:1496)
        at org.asamk.signal.commands.ReceiveCommand.handleCommand(ReceiveCommand.java:160)
        at org.asamk.signal.Main.handleCommands(Main.java:137)
        at org.asamk.signal.Main.main(Main.java:60)
2020-04-21 20:33:23 +02:00
AsamK
6ca695b65e Bump version 2020-04-03 18:00:27 +02:00
AsamK
ae41d0c502 Output json when receiving messages from dbus and --json parameter is given
Fixes #138
2020-04-03 16:22:10 +02:00
AsamK
e04c45766d Rename fingerprint to safety number
Fixes #92
2020-04-03 14:27:18 +02:00
AsamK
f51f0cbbcf Return message timestamp after sucessfully sending a message
Fixes #104
2020-04-03 14:02:18 +02:00
AsamK
320e126eeb Add RecipientStore to resolve all identifiers to SignalServiceAddress
Should fix #290
2020-04-03 13:22:36 +02:00
narodnik
d49d536c32
Add a new sync dbus message which shows messages you sent. Necessary for having synchronized chats where you want your message to appear. Format is similar to receive message dbus except instead of sender, it has sender (source) and receiver (destination). (#289) 2020-04-03 13:16:57 +02:00
AsamK
e684a902bb Update dependencies 2020-03-30 22:00:41 +02:00
signal-stickers
b68575dd16
Use correct sticker pack key length of 32. (#288)
* Use correct sticker pack key length of 32.

* Update dependencies

Co-authored-by: AsamK <asamk@gmx.de>
2020-03-30 21:19:17 +02:00
AsamK
57390ae735 Bump version 2020-03-29 15:26:28 +02:00
AsamK
b3870d6281 Update gradle wrapper 2020-03-29 14:49:01 +02:00
AsamK
ff18b1bf99 Get untrusted identity from inner exception
Fixes #283
2020-03-29 14:45:11 +02:00
AsamK
7e5aec6e15 Store uuids in identity and session store 2020-03-29 13:32:45 +02:00
AsamK
416f43b225 Fix potential crash that could happen when legacy thread.id is null or empty 2020-03-27 15:33:27 +01:00
AsamK
286070c054 Use legacy sender certificate, until uuid support is complete 2020-03-25 20:34:12 +01:00
AsamK
d50dc69f08 Remove unused methods from LegacyJsonThreadStore 2020-03-24 19:30:21 +01:00
AsamK
5df8f32820 Mark our own identity key as trusted initially
to match Signal-Android behavior
2020-03-24 18:16:05 +01:00
AsamK
995de3ef5b Improve behavior, when authorization fails
- register command should still be possible, to regain authorization
- reset uuid after registering, otherwise the verify request will fail
2020-03-24 18:15:21 +01:00
AsamK
9546a79308 Print better error message for captcha required error 2020-03-24 15:14:20 +01:00
AsamK
efa1c43b0b Get uuids from contact store when resolving numbers 2020-03-24 14:36:12 +01:00
AsamK
26aa31edc2 Only send our profile key to recipient who are in our contact list 2020-03-24 14:36:12 +01:00
AsamK
20bf605e36 Only store our own profile key in contact list, if a contact entry already exists 2020-03-24 14:36:12 +01:00
AsamK
6665dc0e48 Set uuid after verify and linking and request it at startup for existing clients 2020-03-24 14:36:12 +01:00
AsamK
1b56485fc8 Send delivery receipt for data messages that need it
With the unidentified sender messages, the Signal server cannot do this
automatically anymore.
2020-03-23 20:51:13 +01:00
AsamK
b62694dbc7 Remove ThreadStore and store message expiration time in group/contact store
To match the implemenation of Signal-Android
2020-03-23 20:51:13 +01:00
AsamK
f982d2752e Store group member uuids in group store
The member list is now stored as a mixed list of strings and objects, e.g.:
"members": [ "+XXXX", { "number": "+XXXX", "uuid": "XXX-XX" } ]
2020-03-23 20:51:13 +01:00
AsamK
a4e1d69788 Store contact uuids in contact store 2020-03-23 17:43:37 +01:00
AsamK
eb0648828a Show recipient of sent sync message also when destination is not present 2020-03-23 17:10:44 +01:00
AsamK
0ce64dc923 Use lambda for ThreadLocal 2020-03-23 17:10:11 +01:00
AsamK
e2b7bda65b Use SignalServiceAddress in more places 2020-03-23 17:09:56 +01:00
AsamK
8a44b37774 Add documentation for sticker upload 2020-03-23 14:49:21 +01:00
AsamK
4f1ee83475 Reformat project 2020-03-23 14:49:21 +01:00
AsamK
4ff28458ff Refactor sticker upload 2020-03-23 14:49:21 +01:00
Signal Stickers
23845eab47 Add support for uploading stickers.
Closes #256
2020-03-23 14:49:17 +01:00
AsamK
3f315df6c8 Add toString method to Hex utils 2020-03-23 13:21:56 +01:00
AsamK
bb06ae9d9a Mark group as active when the user hasn't left it
Fixes #269
2020-03-22 18:27:29 +01:00
AsamK
67f6378f7f Fix storing received profile keys 2020-03-22 17:17:28 +01:00
AsamK
a6562b3b7b Implement sending messages using unidentified sender 2020-03-22 17:17:14 +01:00
AsamK
d7f7c84e6c Fix some inspection issues 2020-03-21 14:41:11 +01:00
AsamK
0dc6b1327e Update libsignal-service-java
- Use new ProfileKey class instead of byte array
- Add capabilities (for future support of uuid and groups v2)
2020-03-21 14:37:02 +01:00
AsamK
31434ac5ec Update gradle wrapper 2020-03-21 14:32:42 +01:00
AsamK
063fb95dca Add command sendReaction for emoji reactions 2020-02-22 11:29:17 +01:00
AsamK
f3b8df789d Print message reactions 2020-02-22 10:35:55 +01:00
AsamK
37ed02f4ce Update to libsignal 2.15.3_unofficial_2 2020-02-12 20:36:23 +01:00
AsamK
2cd6b2b99b Show contact name for message Sender
Fixes #265
2020-02-12 20:23:32 +01:00
Lars K.W. Gohlke
f3ecddba6f refactor extracts method for security inits 2020-01-27 17:39:26 +01:00
AsamK
88a5614f2b Update gradle wrapper 2020-01-26 14:50:32 +01:00
Daniel Schäufele
8b9640ba14 Add support for blocking contacts and accounts (#260)
* Add blockContact and unblockContact subcommands

* Send blocked status in contacts sync

* Use only one method for blocking and unblocking

* Add blocking/unblocking for groups

* Prevent blocked messages from being printed

* Print blocked property in listContacts and listGroups commands

* Handle BlockedListMessages

* Store blocked state from incoming contact and group sync messages

* Minor changes and corrections

* Add block and unblock commands to man file (and also fix some headings of commands)
2020-01-22 08:39:28 +01:00
AsamK
7f9379f78b Canonicalize number when listing identities 2020-01-21 22:09:21 +01:00
AsamK
cfd1e5544d Canonicalize number before getting/setting contact info 2020-01-21 22:08:16 +01:00
AsamK
eca1737d28 Upload attachment before sending to fix sending attachments to multiple recipients
Fixes #259
2020-01-21 20:32:52 +01:00
AsamK
4bafc7212a Update copyright notice 2020-01-21 20:32:19 +01:00
AsamK
60d530eae4 Add output for additional sync messages 2020-01-06 14:36:19 +01:00
AsamK
e03d04e14b Fix showing sender of synced messages 2020-01-06 14:35:54 +01:00
AsamK
3b2682a57a Display more information for received messages 2019-12-31 13:02:49 +01:00
AsamK
6cfddc0aff Improve SignalServiceAddress handling 2019-12-30 16:47:12 +01:00
AsamK
4ca3fe87f4 Update gradle wrapper 2019-12-30 16:25:28 +01:00
signal-stickers
85025d2e25 Update to libsignal 2.15.3 (#255) 2019-12-30 16:25:12 +01:00
AsamK
8115b16bfb Use guessContentTypeFromStream as fallback for probeContentType method
Fixes #233
Fixes #109
2019-12-07 15:47:57 +01:00
VisibleCode
e508fc50e9 Add listContacts subcommand (#248) 2019-12-03 21:57:27 +01:00
AsamK
b402b65066 Bump version 2019-11-11 21:29:36 +01:00
AsamK
89552f916b Support receiving unidentified messages for dbus 2019-11-11 21:29:12 +01:00
AsamK
df81911e44 Extract getMessageReceiver method 2019-11-11 21:24:04 +01:00
AsamK
8ad9c9b0ff Improve receiving unidentified messages 2019-11-11 21:22:12 +01:00
AsamK
90b752b912 Use correct sender device for receiving sealed messages 2019-11-11 19:34:31 +01:00
kpcyrd
50b6174dd6 Use https for checkLibVersions 2019-11-11 19:28:55 +01:00
kpcyrd
209c613e43 Add basic sealed sender support 2019-11-11 19:27:11 +01:00
AsamK
9d836414f0 Bump version 2019-11-02 13:40:58 +01:00
Gabriel Fernández Valdés
717120aed1 added sync type to sync messages json 2019-11-01 09:52:57 +01:00
AsamK
faae998a7e Refactor UpdateContactCommand 2019-10-16 19:27:51 +02:00
Jérémy Bobbio
53e7f83188 Add commands to update contact names on Signal servers
As Signal Desktop does not allow its users to update the contact names,
it would be nice to be able to update contact names from signal-cli when
the latter is the master device.

The command `setContactName` allow to set the name for the given contact
in the local store. `sendContacts` can then be used to push the updated
contact list on Signal servers.

Closes #228
2019-10-16 19:27:42 +02:00
AsamK
0722ec2361 Update dependencies 2019-10-16 19:27:42 +02:00
AsamK
b2efef4d8c Reformat imports 2019-10-16 19:27:42 +02:00
AsamK
958d10fcd1 Merge profile commands to a single UpdateProfileCommand 2019-10-16 19:27:42 +02:00
Jérémy Bobbio
abb6ebc910 Add commands to update profile name and avatar
Two new commands are added `setProfileName` and `setProfileAvatar` which
allow to update the name and avatar visible by other users for the
current profiles.

Closes #227
2019-10-16 19:27:36 +02:00
AsamK
c53bb132eb Include profile key in outgoing messages 2019-10-16 19:15:50 +02:00
Gabriel Fernández Valdés
62696fbc67 Added JsonSyncDataMessage class with destination field. 2019-09-29 16:58:57 +02:00
Gabriel Fernández Valdés
7e267f1ebb Added ReceiptMessage to JSON output 2019-09-29 12:47:51 +02:00
AsamK
625034b2d2 Update dependencies 2019-09-29 11:21:41 +02:00
AsamK
e490604d43 Output attachment id as json string to prevent rounding due to conversion to double
Fixes #226
2019-09-29 11:21:15 +02:00
AsamK
9aa13e92fe Require java 1.8
- VERSION_1_7 is deprecated in java 12
- the used gradle version already requires java 1.8
2019-09-11 11:30:13 +02:00
AsamK
1df862234d Switch to github actions 2019-09-11 11:01:27 +02:00
AsamK
1184a87f2d Bump version 2019-09-05 20:04:42 +02:00
AsamK
129f48e109 Fix sending sync messages for group messages
Fixes #210
2019-09-05 19:43:24 +02:00
AsamK
6e9a3dd649 Update dependencies 2019-09-05 13:49:19 +02:00
AsamK
bd69660ac6 Send expirationTime with all group updates
Fixes #140
2019-09-05 13:49:19 +02:00
AsamK
83122737dc Update gradle wrapper 2019-09-05 13:49:19 +02:00
AsamK
e36a54e7cc Synchronize fileChannel access
Potention fix for #89
2019-09-05 13:49:19 +02:00
Juergen Kurzmann
8c295a3f90 Update SignalAccount storage on unregister
- save registered false state in the SignalAccount storage on unregister action
2019-09-05 12:29:23 +02:00
Juergen Kurzmann
78474453d7 Throw error on failed authorization
- to exit signal-cli in case the number was registered elsewhere
2019-08-03 12:10:29 +02:00
AsamK
8574eb3f95 Update dependencies 2019-07-13 14:24:14 +02:00
AsamK
93ae4641fa Update libsignal-service-java 2019-07-13 14:22:20 +02:00
AsamK
35181251bf Update libsignal-service-java dependency 2019-06-19 21:47:18 +02:00
AsamK
24714454dd Send self messages only as sync messages
To align with the way Note to Self messages are implemented on Android
2019-03-23 22:08:25 +01:00
AsamK
6f7350d031 Update dependencies 2019-03-23 22:05:59 +01:00
AsamK
6d5cfa32e2 Fix NPE when receiving contacts sync message
Fixes #191
2019-02-13 21:19:31 +01:00
AsamK
c90d5db608 Update libsignal-service-java 2019-02-13 21:05:27 +01:00
Parker Higgins
58895aaf03 Expose filename of attachments to json message handler (#185) 2019-01-09 20:17:45 +01:00
AsamK
a055f282c6 Bump version 0.6.2 2018-12-16 21:14:25 +01:00
AsamK
f3878c54a6 Update signal-service-java 2018-12-16 21:14:00 +01:00
Herohtar
51c130b406 Don't abort on empty recipient unless there was also no group specified. (#176)
* Don't abort on empty recipient unless there was also no group specified.

* Fixed potential error if user tries to send `endsession` to a group

* Display error if trying to send `endsession` to a group

* No need for this check since we're handling that condition above
2018-12-14 18:15:12 +01:00
Tai Groot
5d843d82ef Minor spelling/grammar fix 2018-12-14 08:46:40 +01:00
AsamK
fd550d6088 Update libsignal-service-java 2018-12-12 22:21:49 +01:00
AsamK
ea8f7e7528 Bump version 0.6.1
- Added getGroupIds dbus command
- Use "NativePRNG" pseudo random number generator, if available
- Switch default data path:
  $XDG_DATA_HOME/signal-cli ($HOME/.local/share/signal-cli)
  Existing data paths will continue to work (used as fallback)
2018-12-09 18:27:11 +01:00
AsamK
337f84ed21 Change default data path to $XDG_DATA_HOME/signal-cli
Closes #152 and #125
2018-12-08 18:26:54 +01:00
AsamK
ffbc356218 Update gradle wrapper 2018-12-01 14:31:41 +01:00
Lars K.W. Gohlke
65390ef1d8 makes checkLibVersions gradle 5 compatible 2018-12-01 14:28:34 +01:00
AsamK
e809792467 Save account after creating profile key 2018-11-25 22:07:48 +01:00
AsamK
5f2190713a Use custom SecureRandom instance
- Use NativePRNG algorithm instead of using SHA1PRNG if available
- Register a custom security provider to use the same SecureRandom everywhere
2018-11-25 22:07:34 +01:00
Vincent Olivier
cf972e5b6c Manager : removeLinkedDevices updates isMultiDevice and saves the account
Manager : addDevice, getLinkedDevices save the account

SignalAccount : save/load isMultiDevice
SignalAccount : save profileKey
SignalAccount : registrationLockPin doesn't automagically becomes the "null" string, and stays null if null
2018-11-21 11:04:10 +01:00
AsamK
7e897fa6d0 Fix inspections 2018-11-20 23:27:36 +01:00
AsamK
f60a10eb6e Split commands into separate classes 2018-11-20 23:19:39 +01:00
AsamK
2ab70edc68 Fix minor inspection issues 2018-11-19 23:00:32 +01:00
AsamK
860ec6f5dc Extract static methods from Main 2018-11-19 23:00:13 +01:00
AsamK
184354ffb7 Extract utils methods 2018-11-18 19:53:53 +01:00
AsamK
35c72f692f Extract SignalAccount from Manager 2018-11-18 17:12:39 +01:00
AsamK
701328b8c2 Move Manager to sub package 2018-11-18 11:08:24 +01:00
AsamK
7443225d96 Extract util methods to separate classes 2018-11-18 10:45:26 +01:00
AsamK
4ab904b88e Update signal-service-java dependency 2018-11-18 00:34:26 +01:00
AsamK
69185a937f
Update README.md 2018-11-17 21:16:32 +01:00
AsamK
35c00f1b2a Update libsignal-service-java to 2.9.0 2018-10-19 23:39:25 +02:00
AsamK
bb342babba Update signal-service-java to 2.8.0 2018-08-12 21:35:17 +02:00
AsamK
cafba8579f Reduce duplicate code 2018-08-12 21:35:17 +02:00
AsamK
12c296f9ec Add missing null check
Fixes #142
2018-08-12 21:35:17 +02:00
kllp
50fb5587ec Update README.md 2018-08-12 16:49:56 +02:00
kllp
8c2cd57a4f Update README.md 2018-08-12 16:49:56 +02:00
mqus
611d82425d Fix manpage 2018-08-12 16:48:34 +02:00
Benedikt Constantin Radtke
bebe7bc513 Send correct expiry value in group and contact syncs 2018-05-19 14:43:49 +02:00
Riamse
70c810ff17 Short comment to explain how to pass arguments to main application 2018-05-17 18:07:31 +02:00
Riamse
fbbd194e40 Duct tape solution to make daemon actually output JSON 2018-05-17 18:07:31 +02:00
Riamse
afe18ea5ac Gradle option to pass command line arguments to Java application 2018-05-17 18:07:31 +02:00
Riamse
a44034a79e Add command line argument for JSON output in daemon 2018-05-17 18:07:31 +02:00
AsamK
3bcc2fa621 Add travis build 2018-05-08 22:43:18 +02:00
nico
bdffcffd7a Add getGroupIds() to DBUS
getGroupIds() returns a list of group ids (byte arrays)
2018-05-04 22:33:29 +02:00
AsamK
86f5c9947b Version 0.6.0
- Simple json output
- dbus signal for receiving messages
- Registration lock PIN
- Output quoted message
2018-05-03 22:01:49 +02:00
AsamK
9b9ba0683b Print quotes from messages 2018-05-03 21:59:14 +02:00
AsamK
8127eaaf9d Update dependencies, gradle wrapper 2018-05-03 21:49:52 +02:00
AsamK
925d8db468 Update man page 2018-03-31 23:50:33 +02:00
AsamK
e057743232 Support registration lock PIN 2018-03-31 23:41:58 +02:00
AsamK
161ecc877d Update dependencies 2018-02-02 22:27:43 +01:00
AsamK
139fc358a2 Add output for new message fields 2018-01-21 23:16:57 +01:00
AsamK
d5fb37a416 Update argparse4j 2017-12-29 15:01:21 +01:00
AsamK
e63e6e1fa2 Update libsignal-service-java 2017-12-29 14:56:03 +01:00
AsamK
c5d91933b8 Update codeStyle config 2017-12-29 14:52:13 +01:00
AsamK
d12cfca155 Update gradle wrapper 2017-12-29 14:47:18 +01:00
AsamK
e36a2f862c Update libsignal-service-java 2017-09-07 22:18:08 +02:00
AsamK
9b56aa6259 Update libsignal-service 2017-08-17 21:31:07 +02:00
AsamK
804949ddea Send dbus signal, when receipt is received
Fixes #84
2017-06-18 12:53:06 +02:00
AsamK
ee1e52aa4c Update man page 2017-06-18 12:04:56 +02:00
AsamK
8717665d1d Implement json output for receive 2017-06-16 12:05:22 +02:00
AsamK
a1f0d74a99 Bump version 2017-06-16 11:40:08 +02:00
AsamK
24ab58cc14 Delete empty message cache directories 2017-06-16 00:00:19 +02:00
AsamK
4d3e67ff83 Use Base64 from libsignal 2017-06-16 00:00:19 +02:00
AsamK
ef55196806 Close input stream from received sync groups and contacts
Fixes #75
2017-06-15 19:48:24 +02:00
AsamK
4377a2179b Send and receive verified messages
Fixes #85
2017-06-11 17:25:18 +02:00
AsamK
23fcd8a230 Update dependency 2017-06-11 16:27:00 +02:00
AsamK
d90015da0b Update dependencies 2017-06-09 21:56:21 +02:00
AsamK
0f1d0597ae Update dependencies
Sets the complete flag for contacts message, Fixes #81
2017-05-20 11:52:57 +02:00
AsamK
d270ea8c2e Update gradle wrapper 2017-05-20 11:52:25 +02:00
AsamK
78518e0898 Update gradle wrapper 2017-05-07 11:20:07 +02:00
AsamK
debcabd014 Implement updateGroup command via dbus
Fixes #77
2017-05-07 10:31:18 +02:00
AsamK
3c3d3e92dd Update dependencies, add attachment filename support
Fixes #76
2017-04-01 15:27:37 +02:00
AsamK
474372da6b Reformat 2017-02-26 11:35:46 +01:00
Pim Otte
0e16594a87 Actual re-order (I'm a dummy) 2017-02-26 11:27:59 +01:00
Pim Otte
4730e9cbc7 Re-order imports to match original structure 2017-02-26 11:27:59 +01:00
Pim Otte
b1ec1e6587 Rename thread package to threads 2017-02-26 11:27:59 +01:00
Pim Otte
a5aeec8902 Modifying methods to be public to match package division 2017-02-26 11:27:59 +01:00
Pim Otte
d91e20e1f8 Moving files to packages 2017-02-26 11:27:59 +01:00
AsamK
0744dcccf1 Move information from README to wiki/man page 2017-02-25 18:25:31 +01:00
Finn
6f2e8716c7 Allow retreving and updating group info and contact names via dbus (#62)
* dbus method to get contact info

* Add getGroupName method

* Save after updating contact name

* allow group updates over dbus

* Allow retreiving group member list as well

* Space after if before conditions if( -> if (

* Return an empty string if the contact is unknown

* Handle null/non-existant groups better

* Remove debug output and allow updating the avatar

* Remove extra variables in update messages
2017-02-22 21:26:34 +01:00
AsamK
8cd782ef94 Add listGroups command to man page 2017-02-22 21:22:40 +01:00
Pim Otte
5845dad769 Whitespace and output formatting fixes 2017-02-22 21:20:10 +01:00
Pim Otte
b0d7daeca2 Add ListGroups command
Option: -d/--detailed to display group members
2017-02-22 21:20:10 +01:00
Pim Otte
453f31891c Modify gitignore to include eclipse settings 2017-02-22 21:15:46 +01:00
Pim Otte
8e7fce54b9 Add eclipse plugin to build.gradle.
This allows easy generation of eclipse project files using `./gradlew
eclipse`
2017-02-22 21:15:46 +01:00
AsamK
8e8de2fe39 Rename man page to show it rendered on github 2017-02-19 17:35:58 +01:00
AsamK
c68cfe7d7c Update dependency 2017-02-18 13:15:02 +01:00
AsamK
74f21c4f18 Bump version 2017-02-18 12:35:49 +01:00
AsamK
0a68303ca4 Add command to update account attributes
This can fix problems with receiving messages, if for some reason, the
fetchesMessages property of the server is set incorrectly.
2017-02-18 12:35:32 +01:00
AsamK
be963ed49b Add unregister command
Fixes #57
2017-02-18 12:35:32 +01:00
AsamK
92c1f16799 Update dependency
Fixes #56
2017-02-18 12:00:34 +01:00
AsamK
d0e8bf6b44 Bump version 2017-02-17 20:39:29 +01:00
AsamK
fc888a3d89 Update dependencies 2017-02-12 13:26:47 +01:00
AsamK
e083a20a7e Bump version 2017-01-29 14:11:05 +01:00
AsamK
b4e3496139 Update README, man page
Add note about country calling code
2017-01-28 10:50:19 +01:00
AsamK
7ccfa26746 Update dependencies 2017-01-28 10:50:19 +01:00
AsamK
568963f187 Update gradle 2017-01-28 10:50:19 +01:00
Christoph Haefner
39dad8b642 Clarify config store when using signal.service 2017-01-25 21:06:14 +01:00
Christoph Haefner
1e639d18bf Clarify to use --dbus-system if system bus is isntalled 2017-01-25 21:06:14 +01:00
AsamK
6411b09aab Update dependencies 2017-01-10 20:46:46 +01:00
AsamK
d83e0526fb Show better error message, if libunix-java.so is not available
Fixes #39
2016-12-22 12:37:59 +01:00
AsamK
d89e93ad47 Add --ignore-attachments flag to receive and daemon command
Fixes #41
2016-12-22 12:27:55 +01:00
AsamK
aa9aadacf1 Bump version 2016-12-16 11:32:47 +01:00
AsamK
1b7c46b1c2 Update dependency 2016-12-16 11:32:26 +01:00
AsamK
447a188ff9 Use try-with-ressource statements instead of manually closing stream 2016-11-29 11:15:27 +01:00
AsamK
c3bfcff5a8 Update gradle 2016-11-29 11:00:49 +01:00
AsamK
c5cf78a50a Allow millisecond timeouts 2016-11-28 12:38:43 +01:00
AsamK
2351a89b00 Use nio Files.delete instead of File.delete everywhere 2016-11-28 12:28:44 +01:00
Benedikt Constantin Radtke
e364610c93 use java7's nio api to get more detailed error messages 2016-11-28 10:36:10 +01:00
AsamK
ae3e5be124 Update README.md 2016-11-28 10:30:52 +01:00
Lars Wallenborn
9dc42e4d33 Update README.md (#31) 2016-11-28 10:20:32 +01:00
AsamK
eb0860d350 Add another missing close() 2016-11-26 13:42:29 +01:00
AsamK
5b839bbae0 Fix crash when receiving group request for unkown group
Fixes #33
2016-11-26 13:26:04 +01:00
AsamK
c542fb87cb Add missing close of attachment input stream 2016-11-26 12:44:17 +01:00
AsamK
8bfef24ef7 Support sending and receiving group info requests 2016-11-25 14:03:58 +01:00
AsamK
998ec5e7aa Bump version 2016-11-18 21:50:00 +01:00
AsamK
6aefa38ee8 Add man page 2016-11-18 21:50:00 +01:00
AsamK
2f7a0b55d6 Format timestamps 2016-11-18 21:50:00 +01:00
AsamK
6ae610e2b1 Update gradle 2016-11-14 17:02:32 +01:00
AsamK
1bae3ba6f0 Update dependency 2016-11-14 13:25:30 +01:00
AsamK
447dd1cb4f Use new fork on maven central 2016-11-13 19:24:23 +01:00
AsamK
3b22ae1b31 Update dependency 2016-11-05 23:10:22 +01:00
AsamK
197619f1c0 Handle AssertionError also when linking devices 2016-11-03 20:51:25 +01:00
AsamK
82cecfff85 Implement support for sending disappearing messages
Stores the expiration timeout received from contacts in the config file

Fixes #27
2016-10-31 21:18:35 +01:00
AsamK
a4e22539a3 Cleanup 2016-10-31 21:18:35 +01:00
AsamK
93e2c58fcf Fix typo 2016-10-31 17:51:05 +01:00
AsamK
6c9f26f49b Split load function 2016-10-27 16:03:20 +02:00
AsamK
f97b0c0faa Add support for new safety numbers, that replace the hex fingerprint 2016-10-27 14:09:22 +02:00
AsamK
086bdb937a Update README 2016-10-27 10:46:30 +02:00
AsamK
2e19cd09f4 Update gradle wrapper 2016-10-27 10:46:22 +02:00
AsamK
7ceddf24df Update README.md 2016-09-13 21:18:23 +02:00
AsamK
fccb28fdf4 Update dependencies 2016-09-13 21:18:05 +02:00
AsamK
adbc08b2f7 Bump version 2016-08-29 10:53:47 +02:00
AsamK
293c176831 Format timestamps as ISO 8601 in UTC 2016-08-27 13:41:28 +02:00
AsamK
e4618456a1 Add support for contact color sync and receiving blocklists and expiring messages 2016-08-27 13:22:11 +02:00
AsamK
6597d48ecc Update dependencies 2016-08-27 13:19:21 +02:00
AsamK
e89e656b45 Update README.md
Fixes #17
2016-08-20 16:26:45 +02:00
AsamK
a724251f8d Bugfix: don't decrease trustLevel when receiving messages 2016-08-20 16:26:45 +02:00
AsamK
b2289568ef Retry decrypting of messages from previously untrusted keys
Decrypts messages from untrusted keys, if they are trusted now
2016-08-20 16:26:37 +02:00
AsamK
5ee375c74d Store encrypted messages on disk when receiving them
- Acknowledge to the server only after the message is stored.
- Delete the message when decrypting was successful
2016-08-20 16:01:31 +02:00
AsamK
6a9f791f0d Check if number is registered on Signal before adding to group
Fixes #15
2016-08-13 13:42:56 +02:00
AsamK
1efdf04394 Prevent sending to groups that the user has quit
Fixes #23
2016-08-12 18:24:30 +02:00
AsamK
ee5062a2cc Create config directory/files as only user readable
Directories are created with mode 700, files with 600

Fixes #21
2016-07-20 23:11:52 +02:00
AsamK
d78551564b Bump version 2016-07-18 13:44:29 +02:00
AsamK
f095d947f8 Implement listIdentities and trust commands
Print the fingerprints of all known phone numbers and can set their trust
2016-07-14 16:21:05 +02:00
AsamK
bfb51e414b Store untrusted identities in identityKeyStore 2016-07-14 16:20:27 +02:00
AsamK
55d485de88 Add added timestamp to Identities 2016-07-14 16:20:27 +02:00
AsamK
f2c2597379 Implement trustLevel for IdentityKeys 2016-07-14 16:20:27 +02:00
AsamK
0f0d8a873a Improve return codes
Always return non-zero code, when sending failed

Fixes #22
2016-07-14 16:20:14 +02:00
AsamK
9f075da269 Prevent NullPointerException when sending sync groups
ContentType was null, if it could not be determined
2016-07-14 16:07:34 +02:00
AsamK
c0a0f89896 Improve exception handling 2016-07-13 17:27:06 +02:00
AsamK
74fb7d9377 Fix typo 2016-07-08 11:35:19 +02:00
AsamK
c5ac72a9a5 Lock config file
Fixes #19
2016-07-07 01:06:08 +02:00
AsamK
d5797ebb69 Update README.md 2016-07-04 09:46:55 +02:00
AsamK
bc17f9317e Update README.md
Add Installation section

Closes #18
2016-07-03 12:43:30 +02:00
AsamK
24a9398cd7 Update README.md 2016-06-28 12:53:10 +02:00
AsamK
7ce080b6db Don’t remove self from group when sending group messages 2016-06-28 12:35:18 +02:00
AsamK
b1f0d40d44 Fix creating groups
Fixes #16
2016-06-28 00:14:15 +02:00
AsamK
c04a21be3d Bump version 2016-06-19 21:25:22 +02:00
AsamK
2972dd27c1 Use name in groupInfo only if it's a group update
Signal-Android send an empty name instead of absent, with group quit messages
2016-06-19 21:13:24 +02:00
AsamK
3e2024ff0a Add avatar image storage
Group and contact avatars are now stored in the avatars subfolder
of the settings path:
- contact-NUMBER
- group-GROUP_ID
2016-06-19 20:58:01 +02:00
AsamK
9427616906 Improve internal group handling for receiving 2016-06-19 18:33:24 +02:00
AsamK
d9b082a59e Show the contact name when receiving messages
Works only if the contact is stored in the config file already
2016-06-19 15:40:32 +02:00
AsamK
03c6f84fc2 Update gradle wrapper 2016-06-19 15:09:24 +02:00
AsamK
54558ae7fb Remove unused method 2016-06-19 15:08:57 +02:00
AsamK
4608fb433b Remove dependency on apache commons-io 2016-06-19 15:08:49 +02:00
AsamK
fb5f2ca5fa Update systemd service files 2016-05-19 18:22:52 +02:00
AsamK
39687f9d87 Update Readme and fix help bug in Main 2016-05-19 18:00:16 +02:00
AsamK
e59ceef6e3 Update gradle wrapper 2016-05-06 12:18:53 +02:00
AsamK
a46af40b61 Update dependency 2016-04-25 22:42:56 +02:00
AsamK
32beb8a0bd Implement a contacts store and contacts sync 2016-04-22 21:17:02 +02:00
AsamK
543dd98453 Update README.md 2016-04-16 16:10:24 +02:00
AsamK
46befdd638 Don't save if username is null 2016-04-16 15:07:49 +02:00
AsamK
15568512b1 Fix addDevice 2016-04-16 15:07:35 +02:00
AsamK
08a217108a Implement removing linked devices
Only allowed from the master device
2016-04-16 15:03:23 +02:00
AsamK
17ff7531d4 Add method to list linked devices 2016-04-16 14:36:56 +02:00
AsamK
800b92c4ba Always save when sending messages 2016-04-16 14:15:36 +02:00
AsamK
5c1127ced6 Remove own number from group when quitting 2016-04-16 14:15:25 +02:00
AsamK
3cc5704406 Remove own number when sending group messages 2016-04-16 14:15:06 +02:00
AsamK
0ad42a72ab Implement requesting/sending groups when linking device 2016-04-16 13:32:21 +02:00
AsamK
947818d317 Add possiblity to add new device, as master 2016-04-16 13:32:21 +02:00
AsamK
33956bde62 Implement device linking 2016-04-16 13:32:21 +02:00
Individual IT Services
f6b9222eda Receive messages (#10) 2016-04-11 10:49:53 +02:00
AsamK
5c117bd863 Correctly use API for sending non group messages
is necessary so the correct sync messages are generated
for linked accounts
2016-04-08 23:36:43 +02:00
AsamK
aa8a23aceb Handle received sync messages 2016-04-08 23:36:43 +02:00
AsamK
c2ae0c17c2 Fix typos 2016-04-08 23:36:43 +02:00
AsamK
4af9b5f011 Fix syntax for systemd service file: Environment 2016-04-03 16:25:22 +02:00
AsamK
81e94b2b72 Bump version 2016-04-03 15:54:45 +02:00
AsamK
9d18b01d85 Fix registering
Only query prekeys count if registration is complete
2016-04-03 14:28:24 +02:00
AsamK
edf5c9eb43 Use original bouncycastle instead of spongycastle
spongycastle is used by Signal-Android, because android has a crippled
bouncycastle. Spongycastle seems to have a problem with Oracle JDK 8.

Fixes #9
2016-04-03 14:08:46 +02:00
AsamK
f479cffc9f Set user-agent null if PROJECT_NAME is null
the name is only set if the code is run from a jar file
2016-04-02 22:57:13 +02:00
AsamK
7b8998727e Always use utf-8 encoding for compiling 2016-04-02 22:56:15 +02:00
AsamK
7ce99427e3 Bump version 2016-04-02 12:04:49 +02:00
AsamK
ffc393c716 Update README.md
Rename libtextsecure-java to libsignal-service-java
2016-03-30 23:26:39 +02:00
AsamK
0b6c09f883 Add rudimentary message receiving via dbus 2016-03-27 23:36:03 +02:00
AsamK
af8a27e87f Add timestamp to dbus MessageReceived signal 2016-03-27 23:35:36 +02:00
AsamK
dd934f1304 Reduce duplicate code 2016-03-27 23:34:59 +02:00
AsamK
083e33c4da Use e.printStackTrace() 2016-03-27 17:03:57 +02:00
AsamK
cc0177da10 Show source deviceId and relay, when receiving messages 2016-03-27 16:49:20 +02:00
AsamK
900b648f09 Refresh prekeys if there are less than 20 left on the server 2016-03-27 16:17:42 +02:00
AsamK
95278a95ce Use the old config directory .config/textsecure as fallback 2016-03-27 16:17:42 +02:00
AsamK
eabd361405 Rename to signal-cli
Changes experimental dbus interface from
org.asamk.TextSecure to org.asamk.Signal
2016-03-27 16:17:42 +02:00
AsamK
10719a443a Rename axolotl -> signalProtocol 2016-03-25 16:57:40 +01:00
AsamK
b06fafbf62 Update to signal-service-java 2.1.1 2016-03-25 16:50:51 +01:00
AsamK
78252a13df Update gradle 2016-03-21 16:01:10 +01:00
AsamK
5f4325283a Set initial java heap size to 2MB in service files
Make it more usable in memory restricted environments
2016-02-16 13:46:01 +01:00
AsamK
11e5dfbcf5 Update gradle 2016-02-10 13:04:57 +01:00
AsamK
de4a1d1933 Update README.md 2016-01-04 12:11:23 +01:00
AsamK
ea2b0f9d52 Bump version 2015-12-31 16:16:39 +01:00
AsamK
0130585355 Make config path configurable 2015-12-31 16:16:18 +01:00
AsamK
506bc5df13 Service: use user textsecure-cli 2015-12-31 16:16:18 +01:00
AsamK
df0ae3b8dd Fix typo 2015-12-31 15:21:23 +01:00
AsamK
13aafc6712 Add systemd service file with instance variable 2015-12-31 15:17:34 +01:00
AsamK
43ec78594c Implement fetch messages
Uses a patched libtextsecure-java
https://github.com/AsamK/libtextsecure-java/commits/master
2015-12-31 13:17:41 +01:00
AsamK
239afa07e8 Handle DBusExecutionExceptions 2015-12-31 12:54:25 +01:00
AsamK
ea8f62a298 Update gradle 2015-12-31 11:54:18 +01:00
AsamK
bc5b4dc764 Update dependencies 2015-12-30 18:13:49 +01:00
AsamK
3e013f1a8d Bump version 2015-12-30 18:11:54 +01:00
AsamK
acadd90a6d Send Signal "MessageReceived" on dbus when receiving messages 2015-12-30 18:11:54 +01:00
AsamK
fb36613402 Use File() correctly 2015-12-30 18:11:54 +01:00
AsamK
3d56067272 Fix exceptions to work over dbus 2015-12-30 17:39:07 +01:00
AsamK
2a0f9f7629 Update README.md
Add dbus info
2015-12-16 22:20:44 +01:00
AsamK
61392fd17d Take dbus name only when the service is ready 2015-12-16 21:38:32 +01:00
AsamK
60981479d7 Add example files for making a dbus activatable service 2015-12-16 21:38:30 +01:00
AsamK
27d9424f1e Rename package 2015-12-13 11:06:10 +01:00
AsamK
5859e7b9f7 Add possibility to send messages via dbus daemon 2015-12-12 22:56:30 +01:00
AsamK
a69e8facd2 Inline unnecessary methods 2015-12-12 22:09:51 +01:00
AsamK
208e12bdc6 Always call save() after modifying something 2015-12-12 22:09:06 +01:00
AsamK
9a1b348ed2 Implement daemon mode with dbus interface 2015-12-12 21:30:24 +01:00
AsamK
845e93ec0f Cleanup 2015-12-12 20:05:44 +01:00
AsamK
80cc0cad92 Fix build with Java 7 2015-12-12 20:05:14 +01:00
AsamK
ef5d3a65f8 Refactoring, move more functionality into Manager 2015-12-12 11:38:15 +01:00
AsamK
4b5bfcba80 Extract getTextSecureAttachments method 2015-12-10 21:42:44 +01:00
AsamK
c1abc12907 Check if the username is a valid phone number with country code 2015-12-06 17:22:39 +01:00
AsamK
b6684906fc Fix groups for upgraded clients 2015-12-06 15:45:31 +01:00
AsamK
9b7e9cc61e Set required java version to 1.7 2015-12-06 15:06:27 +01:00
AsamK
eeba9687cb Bump version 2015-11-28 01:05:45 +01:00
AsamK
95fdff18f5 Update README 2015-11-26 17:36:54 +01:00
AsamK
fb862e4dde Implement updateGroup 2015-11-26 17:02:28 +01:00
AsamK
1689dfcb38 Implement quitGroups 2015-11-26 15:02:16 +01:00
AsamK
09decf7916 Implement sending EndSession messages 2015-11-26 14:38:47 +01:00
AsamK
2c6796e3ce Move endsession and attachment handling to Manager 2015-11-26 14:17:32 +01:00
AsamK
2517919c49 Enable sending to groups 2015-11-25 14:39:33 +01:00
AsamK
c41ac8e7a3 Store group info in json 2015-11-25 14:39:33 +01:00
AsamK
d0dae4e064 Fix NPE when not specifying receive timeout 2015-11-25 14:39:33 +01:00
AsamK
6208eb72d8 Increase timeout 2015-11-25 12:58:52 +01:00
AsamK
b5400f77c3 Update gradle 2015-11-23 16:02:00 +01:00
AsamK
1b3cd51157 Bump version 2015-11-21 19:01:14 +01:00
AsamK
c5b884f62b Show GroupInfo of messages, if present 2015-11-21 19:01:14 +01:00
AsamK
96bd68e034 Add commandline option to specify receive timeou 2015-11-21 18:05:34 +01:00
AsamK
5accb9b02f Update dependencies 2015-11-18 19:18:06 +01:00
AsamK
75351e6ab7 Update dependencies 2015-11-10 19:08:18 +01:00
AsamK
2d3bc7e5fe Update dependencies 2015-10-25 21:15:15 +01:00
AsamK
1781984221 Fix formatting 2015-10-06 21:45:39 +02:00
AsamK
2c86b0bd9a Remove last remnants of org.json 2015-10-06 21:42:08 +02:00
xardas
4d83d2168a Make Json store use Jackson instead of Gson (as it's already linked)
Closes #4
2015-10-06 21:39:12 +02:00
AsamK
ae8479df8c Fix formatting of attachment size 2015-10-06 19:05:15 +02:00
AsamK
171f9441b4 Update dependencies 2015-10-01 09:34:55 +02:00
AsamK
35f88c7adc Bump version 2015-09-22 14:46:10 +02:00
AsamK
685e431ca0 Add -v and --version command line arguments
Only works running from a jar file
2015-09-22 14:45:52 +02:00
AsamK
ab25003061 Add version to user agent string 2015-09-22 14:44:11 +02:00
AsamK
7f21bf0f23 Add version to jar manifest 2015-09-22 14:43:24 +02:00
AsamK
cd8de7878c Make use of attachment size and preview 2015-09-22 13:23:16 +02:00
AsamK
b91abad2b5 Update textsecure-java to 1.8.0 2015-09-22 12:45:11 +02:00
AsamK
a6f65ae3a0 Print error if temporary attachment file can’t be deleted 2015-09-15 13:26:36 +02:00
AsamK
117f839547 Use generic type inference from java 8 2015-09-15 13:26:02 +02:00
AsamK
76a1e8ec2f Use System.err for error messages 2015-09-15 13:24:27 +02:00
AsamK
2796fff56d Update textescure-java to 1.7
Adapt code:
- Add USER_AGENT
- verifyAccount renamed to verifyAccountWithCode
2015-09-15 13:03:49 +02:00
AsamK
0e4fe8bc8f Update gradle 2.7 2015-09-15 12:48:04 +02:00
AsamK
9e1cd7e398 Fix coding issues 2015-08-07 13:22:15 +02:00
AsamK
e1b584ab84 Implement downloading attachments 2015-08-07 12:55:33 +02:00
AsamK
f06672db89 Use gradle-2.5-all needed by IDE 2015-08-07 12:41:14 +02:00
AsamK
1cb8c78bf4 Update README.md
fix typos
2015-08-01 13:56:19 +02:00
AsamK
df8a19c060 Update dependencies 2015-07-31 12:54:37 +02:00
AsamK
f55a168fbf Update README
installApp is now deprecated
2015-07-31 12:54:10 +02:00
AsamK
02b66bd69b Update gradle wrapper 2015-07-31 12:53:45 +02:00
AsamK
dbaf1c693c Catch AssertionError
Fixes #2
2015-07-08 16:22:04 +02:00
AsamK
6c02004326 Extract code from main() to functions 2015-07-08 16:14:48 +02:00
AsamK
1c4578ceac Update README.md 2015-07-08 15:46:07 +02:00
468 changed files with 58135 additions and 3381 deletions

96
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,96 @@
name: signal-cli CI
on:
push:
branches:
- '**'
pull_request:
workflow_call:
permissions:
contents: write # to fetch code (actions/checkout) and submit dependency graph (gradle/gradle-build-action)
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '21', '24' ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
dependency-graph: generate-and-submit
- name: Install asciidoc
run: sudo apt update && sudo apt --no-install-recommends install -y asciidoc-base
- name: Build with Gradle
run: ./gradlew --no-daemon build
- name: Build man page
run: |
cd man
make install
- name: Add man page to archive
run: |
version=$(tar tf build/distributions/signal-cli-*.tar | head -n1 | sed 's|signal-cli-\([^/]*\)/.*|\1|')
echo $version
tar --transform="flags=r;s|man|signal-cli-${version}/man|" -rf build/distributions/signal-cli-${version}.tar man/man{1,5}
- name: Compress archive
run: gzip -n -9 build/distributions/signal-cli-*.tar
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: signal-cli-archive-${{ matrix.java }}
path: build/distributions/signal-cli-*.tar.gz
build-graalvm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '21'
cache: 'gradle'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Gradle
run: ./gradlew --no-daemon nativeCompile
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: signal-cli-native
path: build/native/nativeCompile/signal-cli
build-client:
strategy:
matrix:
os:
- ubuntu
- macos
- windows
runs-on: ${{ matrix.os }}-latest
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v4
- name: Install rust
run: rustup default stable
- name: Build client
run: cargo build --release --verbose
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: signal-cli-client-${{ matrix.os }}
path: |
client/target/release/signal-cli-client
client/target/release/signal-cli-client.exe

60
.github/workflows/codeql-analysis.yml vendored Normal file
View file

@ -0,0 +1,60 @@
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '0 7 * * 4'
permissions:
contents: read # to fetch code (actions/checkout)
security-events: write
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 21
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

257
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,257 @@
name: release
on:
push:
tags:
- v*
permissions:
contents: write # to fetch code (actions/checkout) and create release
env:
IMAGE_NAME: signal-cli
IMAGE_REGISTRY: ghcr.io/asamk
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
jobs:
ci_wf:
permissions:
contents: write
uses: AsamK/signal-cli/.github/workflows/ci.yml@master
# ${{ github.repository }} not accepted here
lib_to_jar:
needs: ci_wf
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
signal_cli_version: ${{ steps.cli_ver.outputs.version }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- name: Download signal-cli build from CI workflow
uses: actions/download-artifact@v4
- name: Get signal-cli version
id: cli_ver
run: |
ver="${GITHUB_REF_NAME#v}"
echo "version=${ver}" >> $GITHUB_OUTPUT
- name: Extract archive
run: |
tree .
ARCHIVE_DIR=$(ls signal-cli-archive-*/ -d | tail -n1)
tar -xzf ./"${ARCHIVE_DIR}"/*.tar.gz
mv ./"${ARCHIVE_DIR}"/*.tar.gz signal-cli-${{ steps.cli_ver.outputs.version }}.tar.gz
rm -rf signal-cli-archive-*/
# - name: Get signal-client jar version
# id: lib_ver
# run: |
# JAR_PREFIX=libsignal-client-
# jar_file=$(find ./signal-cli-*/lib/ -name "$JAR_PREFIX*.jar")
# jar_version=$(echo "$jar_file" | xargs basename | sed "s/$JAR_PREFIX//; s/.jar//")
# echo "$jar_version"
# echo "signal_client_version=${jar_version}" >> $GITHUB_OUTPUT
#
# - name: Download signal-client builds
# env:
# RELEASES_URL: https://github.com/signalapp/libsignal/releases/download/
# FILE_NAMES: signal_jni.dll libsignal_jni.dylib
# SIGNAL_CLIENT_VER: ${{ steps.lib_ver.outputs.signal_client_version }}
# run: |
# for file_name in $FILE_NAMES; do
# curl -sOL "${RELEASES_URL}/v${SIGNAL_CLIENT_VER}/${file_name}" # note: added v
# done
# tree .
- name: Compress native app
env:
SIGNAL_CLI_VER: ${{ steps.cli_ver.outputs.version }}
run: |
chmod +x signal-cli-native/signal-cli
tar -czf signal-cli-${SIGNAL_CLI_VER}-Linux-native.tar.gz -C signal-cli-native signal-cli
rm -rf signal-cli-native/
# - name: Replace Windows lib
# env:
# SIGNAL_CLI_VER: ${{ steps.cli_ver.outputs.version }}
# SIGNAL_CLIENT_VER: ${{ steps.lib_ver.outputs.signal_client_version }}
# run: |
# mv signal_jni.dll libsignal_jni.so
# zip -u ./signal-cli-*/lib/libsignal-client-${SIGNAL_CLIENT_VER}.jar ./libsignal_jni.so
# tar -czf signal-cli-${SIGNAL_CLI_VER}-Windows.tar.gz signal-cli-*/
#
# - name: Replace macOS lib
# env:
# SIGNAL_CLI_VER: ${{ steps.cli_ver.outputs.version }}
# SIGNAL_CLIENT_VER: ${{ steps.lib_ver.outputs.signal_client_version }}
# run: |
# jar_file=./signal-cli-*/lib/libsignal-client-${SIGNAL_CLIENT_VER}.jar
# zip -d $jar_file libsignal_jni.so
# zip $jar_file libsignal_jni.dylib
# tar -czf signal-cli-${SIGNAL_CLI_VER}-macOS.tar.gz signal-cli-*/
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.cli_ver.outputs.version }} # note: added `v`
release_name: v${{ steps.cli_ver.outputs.version }} # note: added `v`
draft: true
- name: Upload archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: signal-cli-${{ steps.cli_ver.outputs.version }}.tar.gz
asset_name: signal-cli-${{ steps.cli_ver.outputs.version }}.tar.gz
asset_content_type: application/x-compressed-tar # .tar.gz
# - name: Upload Linux archive
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: signal-cli-${{ steps.cli_ver.outputs.version }}-Linux.tar.gz
# asset_name: signal-cli-${{ steps.cli_ver.outputs.version }}-Linux.tar.gz
# asset_content_type: application/x-compressed-tar # .tar.gz
- name: Upload Linux native archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: signal-cli-${{ steps.cli_ver.outputs.version }}-Linux-native.tar.gz
asset_name: signal-cli-${{ steps.cli_ver.outputs.version }}-Linux-native.tar.gz
asset_content_type: application/x-compressed-tar # .tar.gz
# - name: Upload windows archive
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: signal-cli-${{ steps.cli_ver.outputs.version }}-Windows.tar.gz
# asset_name: signal-cli-${{ steps.cli_ver.outputs.version }}-Windows.tar.gz
# asset_content_type: application/x-compressed-tar # .tar.gz
#
# - name: Upload macos archive
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: signal-cli-${{ steps.cli_ver.outputs.version }}-macOS.tar.gz
# asset_name: signal-cli-${{ steps.cli_ver.outputs.version }}-macOS.tar.gz
# asset_content_type: application/x-compressed-tar # .tar.gz
build-container:
needs: ci_wf
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Download signal-cli build from CI workflow
uses: actions/download-artifact@v4
- name: Get signal-cli version
id: cli_ver
run: |
ver="${GITHUB_REF_NAME#v}"
echo "version=${ver}" >> $GITHUB_OUTPUT
- name: Move archive file
run: |
ARCHIVE_DIR=$(ls signal-cli-archive-*/ -d | tail -n1)
tar xf ./"${ARCHIVE_DIR}"/*.tar.gz
rm -r signal-cli-archive-* signal-cli-native
mkdir -p build/install/
mv ./signal-cli-"${GITHUB_REF_NAME#v}"/ build/install/signal-cli
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.sha }} ${{ steps.cli_ver.outputs.version }}
containerfiles:
./Containerfile
oci: true
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "${{ toJSON(steps.push.outputs) }}"
build-container-native:
needs: ci_wf
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Download signal-cli build from CI workflow
uses: actions/download-artifact@v4
- name: Get signal-cli version
id: cli_ver
run: |
ver="${GITHUB_REF_NAME#v}"
echo "version=${ver}" >> $GITHUB_OUTPUT
- name: Move archive file
run: |
mkdir -p build/native/nativeCompile/
chmod +x ./signal-cli-native/signal-cli
mv ./signal-cli-native/signal-cli build/native/nativeCompile/
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest-native ${{ github.sha }}-native ${{ steps.cli_ver.outputs.version }}-native
containerfiles:
./native.Containerfile
oci: true
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "${{ toJSON(steps.push.outputs) }}"

10
.gitignore vendored
View file

@ -1,7 +1,15 @@
.gradle/
.idea/
.idea/*
!.idea/codeStyles/
build/
*~
*.swp
*.iml
local.properties
.classpath
.project
.settings/
out/
.DS_Store
/bin/
/test-config/

71
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,71 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="LINE_SEPARATOR" value="&#10;" />
<JavaCodeStyleSettings>
<option name="GENERATE_FINAL_LOCALS" value="true" />
<option name="GENERATE_FINAL_PARAMETERS" value="true" />
<option name="ALIGN_MULTILINE_TEXT_BLOCKS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
<package name="junit" withSubpackages="true" static="false" />
<emptyLine />
<package name="net" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
</value>
</option>
<option name="RECORD_COMPONENTS_WRAP" value="5" />
<option name="NEW_LINE_AFTER_LPAREN_IN_RECORD_HEADER" value="true" />
<option name="RPAREN_ON_NEW_LINE_IN_RECORD_HEADER" value="true" />
<option name="JD_P_AT_EMPTY_LINES" value="false" />
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="PARENTHESES_EXPRESSION_LPAREN_WRAP" value="true" />
<option name="PARENTHESES_EXPRESSION_RPAREN_WRAP" value="true" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<arrangement>
<rules />
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

1192
CHANGELOG.md Normal file

File diff suppressed because it is too large Load diff

18
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,18 @@
# Question
If you have a question you can ask it in the [GitHub discussions page](https://github.com/AsamK/signal-cli/discussions)
# Report a bug
- Search [existing issues](https://github.com/AsamK/signal-cli/issues?q=is%3Aissue) if it has been reported already
- If you're unable to find an open issue addressing the
problem, [open a new one](https://github.com/AsamK/signal-cli/issues/new).
- Be sure to include a **title and clear description**, as much relevant information as possible.
- Specify the versions of signal-cli, libsignal-client (if self-compiled), JDK and OS you're using
- Specify if it's the normal java or the graalvm native version.
- Run the failing command with `--verbose` flag to get a more detailed log output and include that in the bug report
# Pull request
- Code style should match the existing code, IntelliJ users can use the auto formatter
- Separate PRs should be opened for each implemented feature or bug fix

11
Containerfile Normal file
View file

@ -0,0 +1,11 @@
FROM docker.io/azul/zulu-openjdk:21-jre-headless
LABEL org.opencontainers.image.source=https://github.com/AsamK/signal-cli
LABEL org.opencontainers.image.description="signal-cli provides an unofficial commandline, dbus and JSON-RPC interface for the Signal messenger."
LABEL org.opencontainers.image.licenses=GPL-3.0-only
RUN useradd signal-cli --system --create-home --home-dir /var/lib/signal-cli
ADD build/install/signal-cli /opt/signal-cli
USER signal-cli
ENTRYPOINT ["/opt/signal-cli/bin/signal-cli", "--config=/var/lib/signal-cli"]

4
FUNDING.yml Normal file
View file

@ -0,0 +1,4 @@
github: AsamK
liberapay: asamk
ko_fi: asamk
#bitcoin: bc1qykae53fry8a8ycgdzgv0rlxfc959hmmllvz698

153
README.md
View file

@ -1,63 +1,164 @@
# 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. However receiving messages currently doesn't work, 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 intented to be used on servers to notify admins of important events.
signal-cli is a commandline interface for the [Signal messenger](https://signal.org/).
It supports registering, verifying, sending and receiving messages.
signal-cli uses a [patched libsignal-service-java](https://github.com/Turasa/libsignal-service-java),
extracted from the [Signal-Android source code](https://github.com/signalapp/Signal-Android/tree/main/libsignal-service).
For registering you need a phone number where you can receive SMS or incoming calls.
signal-cli is primarily intended to be used on servers to notify admins of important events.
For this use-case, it has a daemon mode with JSON-RPC interface ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-jsonrpc.5.adoc))
and D-BUS interface ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-dbus.5.adoc)) .
For the JSON-RPC interface there's also a simple [example client](https://github.com/AsamK/signal-cli/tree/master/client), written in Rust.
signal-cli needs to be kept up-to-date to keep up with Signal-Server changes.
The official Signal clients expire after three months and then the Signal-Server can make incompatible changes.
So signal-cli releases older than three months may not work correctly.
## 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. There's also a [docker image and some Linux packages](https://github.com/AsamK/signal-cli/wiki/Binary-distributions) provided by the community.
System requirements:
- at least Java Runtime Environment (JRE) 21
- native library: libsignal-client
The native libs are bundled for x86_64 Linux (with recent enough glibc), Windows and MacOS. 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).
```sh
export VERSION=<latest version, format "x.y.z">
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/
```
You can find further instructions on the Wiki:
- [Quickstart](https://github.com/AsamK/signal-cli/wiki/Quickstart)
## Usage
usage: textsecure-cli [-h] -u USERNAME {register,verify,send,receive} ...
For a complete usage overview please read
the [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) and
the [wiki](https://github.com/AsamK/signal-cli/wiki).
* Register a number
Important: The ACCOUNT is your phone number in international format and must include the country calling code. Hence it
should start with a "+" sign. (See [Wikipedia](https://en.wikipedia.org/wiki/List_of_country_calling_codes) for a list
of all country codes.)
textsecure-cli -u USERNAME register
* Register a number (with SMS verification)
* Register a number with voice verification
signal-cli -a ACCOUNT register
textsecure-cli -u USERNAME register -v
You can register Signal using a landline number. In this case, you need to follow the procedure below:
* Attempt a SMS verification process first (`signal-cli -a ACCOUNT register`)
* You will get an error `400 (InvalidTransportModeException)`, this is normal
* Wait 60 seconds
* Attempt a voice call verification by adding the `--voice` switch and wait for the call:
* Verify the number using the code received via SMS
```sh
signal-cli -a ACCOUNT register --voice
```
textsecure-cli -u USERNAME verify CODE
Registering may require solving a CAPTCHA
challenge: [Registration with captcha](https://github.com/AsamK/signal-cli/wiki/Registration-with-captcha)
* Send a message to one or more recipients
* Verify the number using the code received via SMS or voice, optionally add `--pin PIN_CODE` if you've added a pin code
to your account
textsecure-cli -u USERNAME send -m "This is a message" [RECIPIENT [RECIPIENT ...]]
signal-cli -a ACCOUNT verify CODE
* Send a message
```sh
signal-cli -a ACCOUNT send -m "This is a message" RECIPIENT
```
* Send a message to a username, usernames need to be prefixed with `u:`
```sh
signal-cli -a ACCOUNT send -m "This is a message" u:USERNAME.000
```
* Pipe the message content from another process.
uname -a | textsecure-cli -u USERNAME send [RECIPIENT [RECIPIENT ...]]
uname -a | signal-cli -a ACCOUNT send --message-from-stdin RECIPIENT
* Receive messages
signal-cli -a ACCOUNT receive
**Hint**: The Signal protocol expects that incoming messages are regularly received (using `daemon` or `receive`
command). This is required for the encryption to work efficiently and for getting updates to groups, expiration timer
and other features.
## Storage
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/
$XDG_DATA_HOME/signal-cli/data/
$HOME/.local/share/signal-cli/data/
## Building
This project uses [Gradle](http://gradle.org) for building and maintaining
dependencies.
This project uses [Gradle](http://gradle.org) for building and maintaining dependencies. If you have a recent gradle
version installed, you can replace `./gradlew` with `gradle` in the following steps.
1. Checkout the source somewhere on your filesystem wit
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:
./gradlew build
./gradlew build
3. Create shell wrapper in *build/install/textsecure-cli/bin*:
2a. Create shell wrapper in *build/install/signal-cli/bin*:
./gradlew installApp
./gradlew installDist
4. Create tar file in *build/distributions*:
2b. Create tar file in *build/distributions*:
./gradlew distTar
./gradlew distTar
2c. Create a fat tar file in *build/libs/signal-cli-fat*:
./gradlew fatJar
2d. Compile and run signal-cli:
```sh
./gradlew run --args="--help"
```
### Building a native binary with GraalVM (EXPERIMENTAL)
It is possible to build a native binary with [GraalVM](https://www.graalvm.org). This is still experimental and will not
work in all situations.
1. [Install GraalVM and setup the environment](https://www.graalvm.org/docs/getting-started/#install-graalvm)
2. Execute Gradle:
./gradlew nativeCompile
The binary is available at *build/native/nativeCompile/signal-cli*
## FAQ and Troubleshooting
For frequently asked questions and issues have a look at the [wiki](https://github.com/AsamK/signal-cli/wiki/FAQ).
## License
This project uses libtextsecure-java from Open Whisper Systems:
This project uses libsignal-service-java from Open Whisper Systems:
https://github.com/WhisperSystems/libtextsecure-java
https://github.com/WhisperSystems/libsignal-service-java
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

View file

@ -1,26 +0,0 @@
apply plugin: 'java'
apply plugin: 'application'
sourceCompatibility = "1.8";
mainClassName = 'cli.Main'
repositories {
mavenCentral()
}
dependencies {
compile 'org.whispersystems:textsecure-java:1.6.1'
compile 'com.madgag.spongycastle:prov:1.52.0.0'
compile 'org.json:json:20141113'
compile 'commons-io:commons-io:2.4'
compile 'net.sourceforge.argparse4j:argparse4j:0.5.0'
}
jar {
baseName = 'textsecure-cli'
version = '0.0.2'
manifest {
attributes 'Main-Class': 'cli.Main'
}
}

139
build.gradle.kts Normal file
View file

@ -0,0 +1,139 @@
plugins {
java
application
eclipse
`check-lib-versions`
id("org.graalvm.buildtools.native") version "0.10.6"
}
allprojects {
group = "org.asamk"
version = "0.13.19-SNAPSHOT"
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
if (!JavaVersion.current().isCompatibleWith(targetCompatibility)) {
toolchain {
languageVersion.set(JavaLanguageVersion.of(targetCompatibility.majorVersion))
}
}
}
application {
mainClass.set("org.asamk.signal.Main")
applicationDefaultJvmArgs = listOf("--enable-native-access=ALL-UNNAMED")
}
graalvmNative {
binaries {
this["main"].run {
buildArgs.add("--install-exit-handlers")
buildArgs.add("-Dfile.encoding=UTF-8")
buildArgs.add("-J-Dfile.encoding=UTF-8")
buildArgs.add("-march=compatibility")
resources.autodetect()
configurationFileDirectories.from(file("graalvm-config-dir"))
if (System.getenv("GRAALVM_HOME") == null) {
toolchainDetection.set(true)
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(21))
})
} else {
toolchainDetection.set(false)
}
}
}
}
val artifactType = Attribute.of("artifactType", String::class.java)
val minified = Attribute.of("minified", Boolean::class.javaObjectType)
dependencies {
attributesSchema {
attribute(minified)
}
artifactTypes.getByName("jar") {
attributes.attribute(minified, false)
}
}
configurations.runtimeClasspath.configure {
attributes {
attribute(minified, true)
}
}
val excludePatterns = mapOf(
"libsignal-client" to setOf(
"libsignal_jni_testing_amd64.so",
"signal_jni_testing_amd64.dll",
"libsignal_jni_testing_amd64.dylib",
"libsignal_jni_testing_aarch64.dylib",
)
)
dependencies {
registerTransform(JarFileExcluder::class) {
from.attribute(minified, false).attribute(artifactType, "jar")
to.attribute(minified, true).attribute(artifactType, "jar")
parameters {
excludeFilesByArtifact = excludePatterns
}
}
implementation(libs.bouncycastle)
implementation(libs.jackson.databind)
implementation(libs.argparse4j)
implementation(libs.dbusjava)
implementation(libs.slf4j.api)
implementation(libs.slf4j.jul)
implementation(libs.logback)
implementation(project(":libsignal-cli"))
}
configurations {
implementation {
resolutionStrategy.failOnVersionConflict()
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Jar> {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Main-Class" to application.mainClass.get(),
"Enable-Native-Access" to "ALL-UNNAMED",
)
}
}
tasks.register("fatJar", type = Jar::class) {
archiveBaseName.set("${project.name}-fat")
exclude(
"META-INF/*.SF",
"META-INF/*.DSA",
"META-INF/*.RSA",
"META-INF/NOTICE*",
"META-INF/LICENSE*",
"META-INF/INDEX.LIST",
"**/module-info.class",
)
duplicatesStrategy = DuplicatesStrategy.WARN
doFirst {
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
}
with(tasks.jar.get())
}

28
buildSrc/build.gradle.kts Normal file
View file

@ -0,0 +1,28 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
`kotlin-dsl`
}
tasks.named<KotlinCompilationTask<KotlinJvmCompilerOptions>>("compileKotlin").configure {
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
}
java {
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
gradlePlugin {
plugins {
register("check-lib-versions") {
id = "check-lib-versions"
implementationClass = "CheckLibVersionsPlugin"
}
}
}

View file

@ -0,0 +1,40 @@
@file:Suppress("DEPRECATION")
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Dependency
import javax.xml.parsers.DocumentBuilderFactory
class CheckLibVersionsPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.task("checkLibVersions") {
description =
"Find any 3rd party libraries which have released new versions to the central Maven repo since we last upgraded."
doLast {
project.configurations.flatMap { it.allDependencies }
.toSet()
.forEach { checkDependency(it) }
}
}
}
private fun Task.checkDependency(dependency: Dependency) {
val version = dependency.version
val group = dependency.group
val path = group?.replace(".", "/") ?: ""
val name = dependency.name
val metaDataUrl = "https://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
try {
val dbf = DocumentBuilderFactory.newInstance()
val db = dbf.newDocumentBuilder()
val doc = db.parse(metaDataUrl);
val newest = doc.getElementsByTagName("latest").item(0).textContent
if (version != newest.toString()) {
println("UPGRADE {\"group\": \"$group\", \"name\": \"$name\", \"current\": \"$version\", \"latest\": \"$newest\"}")
}
} catch (e: Throwable) {
logger.debug("Unable to download or parse {}: {}", metaDataUrl, e.message)
}
}
}

View file

@ -0,0 +1,53 @@
import org.gradle.api.artifacts.transform.*
import org.gradle.api.file.FileSystemLocation
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream
@CacheableTransform
abstract class JarFileExcluder : TransformAction<JarFileExcluder.Parameters> {
interface Parameters : TransformParameters {
@get:Input
var excludeFilesByArtifact: Map<String, Set<String>>
}
@get:PathSensitive(PathSensitivity.NAME_ONLY)
@get:InputArtifact
abstract val inputArtifact: Provider<FileSystemLocation>
override
fun transform(outputs: TransformOutputs) {
val fileName = inputArtifact.get().asFile.name
for (entry in parameters.excludeFilesByArtifact) {
if (fileName.startsWith(entry.key)) {
val nameWithoutExtension = fileName.substring(0, fileName.lastIndexOf("."))
excludeFiles(inputArtifact.get().asFile, entry.value, outputs.file("${nameWithoutExtension}.jar"))
return
}
}
outputs.file(inputArtifact)
}
private fun excludeFiles(artifact: File, excludeFiles: Set<String>, jarFile: File) {
ZipInputStream(FileInputStream(artifact)).use { input ->
ZipOutputStream(FileOutputStream(jarFile)).use { output ->
var entry = input.nextEntry
while (entry != null) {
if (!excludeFiles.contains(entry.name)) {
output.putNextEntry(entry)
input.copyTo(output)
output.closeEntry()
}
entry = input.nextEntry
}
}
}
}
}

1
client/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target/

1756
client/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

22
client/Cargo.toml Normal file
View file

@ -0,0 +1,22 @@
[package]
name = "signal-cli-client"
version = "0.0.1"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1"
clap = { version = "4", features = ["cargo", "derive", "wrap_help"] }
serde = "1"
serde_json = "1"
tokio = { version = "1", features = ["rt", "macros", "net", "rt-multi-thread"] }
jsonrpsee = { version = "0.25", features = [
"macros",
"async-client",
"http-client",
] }
bytes = "1"
tokio-util = "0.7"
futures-util = "0.3"
thiserror = "2"

470
client/src/cli.rs Normal file
View file

@ -0,0 +1,470 @@
use std::{ffi::OsString, net::SocketAddr};
use clap::{crate_version, Parser, Subcommand, ValueEnum};
/// JSON-RPC client for signal-cli
#[derive(Parser, Debug)]
#[command(rename_all = "kebab-case", version = crate_version!())]
pub struct Cli {
/// Account to use (for daemon in multi-account mode)
#[arg(short = 'a', long)]
pub account: Option<String>,
/// TCP host and port of signal-cli daemon
#[arg(long, conflicts_with = "json_rpc_http")]
pub json_rpc_tcp: Option<Option<SocketAddr>>,
/// UNIX socket address and port of signal-cli daemon
#[cfg(unix)]
#[arg(long, conflicts_with = "json_rpc_tcp")]
pub json_rpc_socket: Option<Option<OsString>>,
/// HTTP URL of signal-cli daemon
#[arg(long, conflicts_with = "json_rpc_socket")]
pub json_rpc_http: Option<Option<String>>,
#[arg(long)]
pub verbose: bool,
#[command(subcommand)]
pub command: CliCommands,
}
#[allow(clippy::large_enum_variant)]
#[derive(Subcommand, Debug)]
#[command(rename_all = "camelCase", version = crate_version!())]
pub enum CliCommands {
AddDevice {
#[arg(long)]
uri: String,
},
AddStickerPack {
#[arg(long)]
uri: String,
},
#[command(rename_all = "kebab-case")]
Block {
recipient: Vec<String>,
#[arg(short = 'g', long)]
group_id: Vec<String>,
},
DeleteLocalAccountData {
#[arg(long = "ignore-registered")]
ignore_registered: Option<bool>,
},
FinishChangeNumber {
number: String,
#[arg(short = 'v', long = "verification-code")]
verification_code: String,
#[arg(short = 'p', long)]
pin: Option<String>,
},
GetAttachment {
#[arg(long)]
id: String,
#[arg(long)]
recipient: Option<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Option<String>,
},
GetAvatar {
#[arg(long)]
contact: Option<String>,
#[arg(long)]
profile: Option<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Option<String>,
},
GetSticker {
#[arg(long = "pack-id")]
pack_id: String,
#[arg(long = "sticker-id")]
sticker_id: u32,
},
GetUserStatus {
recipient: Vec<String>,
#[arg(long)]
username: Vec<String>,
},
JoinGroup {
#[arg(long)]
uri: String,
},
Link {
#[arg(short = 'n', long)]
name: String,
},
ListAccounts,
ListContacts {
recipient: Vec<String>,
#[arg(short = 'a', long = "all-recipients")]
all_recipients: bool,
#[arg(long)]
blocked: Option<bool>,
#[arg(long)]
name: Option<String>,
},
ListDevices,
ListGroups {
#[arg(short = 'd', long)]
detailed: bool,
#[arg(short = 'g', long = "group-id")]
group_id: Vec<String>,
},
ListIdentities {
#[arg(short = 'n', long)]
number: Option<String>,
},
ListStickerPacks,
QuitGroup {
#[arg(short = 'g', long = "group-id")]
group_id: String,
#[arg(long)]
delete: bool,
#[arg(long)]
admin: Vec<String>,
},
Receive {
#[arg(short = 't', long, default_value_t = 3.0)]
timeout: f64,
},
Register {
#[arg(short = 'v', long)]
voice: bool,
#[arg(long)]
captcha: Option<String>,
},
RemoveContact {
recipient: String,
#[arg(long)]
forget: bool,
#[arg(long)]
hide: bool,
},
RemoveDevice {
#[arg(short = 'd', long = "device-id")]
device_id: u32,
},
RemovePin,
RemoteDelete {
#[arg(short = 't', long = "target-timestamp")]
target_timestamp: u64,
recipient: Vec<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Vec<String>,
#[arg(long = "note-to-self")]
note_to_self: bool,
},
#[command(rename_all = "kebab-case")]
Send {
recipient: Vec<String>,
#[arg(short = 'g', long)]
group_id: Vec<String>,
#[arg(long)]
note_to_self: bool,
#[arg(short = 'e', long)]
end_session: bool,
#[arg(short = 'm', long)]
message: Option<String>,
#[arg(short = 'a', long)]
attachment: Vec<String>,
#[arg(long)]
view_once: bool,
#[arg(long)]
mention: Vec<String>,
#[arg(long)]
text_style: Vec<String>,
#[arg(long)]
quote_timestamp: Option<u64>,
#[arg(long)]
quote_author: Option<String>,
#[arg(long)]
quote_message: Option<String>,
#[arg(long)]
quote_mention: Vec<String>,
#[arg(long)]
quote_text_style: Vec<String>,
#[arg(long)]
quote_attachment: Vec<String>,
#[arg(long)]
preview_url: Option<String>,
#[arg(long)]
preview_title: Option<String>,
#[arg(long)]
preview_description: Option<String>,
#[arg(long)]
preview_image: Option<String>,
#[arg(long)]
sticker: Option<String>,
#[arg(long)]
story_timestamp: Option<u64>,
#[arg(long)]
story_author: Option<String>,
#[arg(long)]
edit_timestamp: Option<u64>,
},
SendContacts,
SendPaymentNotification {
recipient: String,
#[arg(long)]
receipt: String,
#[arg(long)]
note: String,
},
SendReaction {
recipient: Vec<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Vec<String>,
#[arg(long = "note-to-self")]
note_to_self: bool,
#[arg(short = 'e', long)]
emoji: String,
#[arg(short = 'a', long = "target-author")]
target_author: String,
#[arg(short = 't', long = "target-timestamp")]
target_timestamp: u64,
#[arg(short = 'r', long)]
remove: bool,
#[arg(long)]
story: bool,
},
SendReceipt {
recipient: String,
#[arg(short = 't', long = "target-timestamp")]
target_timestamp: Vec<u64>,
#[arg(value_enum, long)]
r#type: ReceiptType,
},
SendSyncRequest,
SendTyping {
recipient: Vec<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Vec<String>,
#[arg(short = 's', long)]
stop: bool,
},
SendMessageRequestResponse {
recipient: Vec<String>,
#[arg(short = 'g', long = "group-id")]
group_id: Vec<String>,
r#type: MessageRequestResponseType,
},
SetPin {
pin: String,
},
StartChangeNumber {
number: String,
#[arg(short = 'v', long)]
voice: bool,
#[arg(long)]
captcha: Option<String>,
},
SubmitRateLimitChallenge {
challenge: String,
captcha: String,
},
Trust {
recipient: String,
#[arg(short = 'a', long = "trust-all-known-keys")]
trust_all_known_keys: bool,
#[arg(short = 'v', long = "verified-safety-number")]
verified_safety_number: Option<String>,
},
#[command(rename_all = "kebab-case")]
Unblock {
recipient: Vec<String>,
#[arg(short = 'g', long)]
group_id: Vec<String>,
},
Unregister {
#[arg(long = "delete-account")]
delete_account: bool,
},
UpdateAccount {
#[arg(short = 'n', long = "device-name")]
device_name: Option<String>,
#[arg(long = "unrestricted-unidentified-sender")]
unrestricted_unidentified_sender: Option<bool>,
#[arg(long = "discoverable-by-number")]
discoverable_by_number: Option<bool>,
#[arg(long = "number-sharing")]
number_sharing: Option<bool>,
},
UpdateConfiguration {
#[arg(long = "read-receipts")]
read_receipts: Option<bool>,
#[arg(long = "unidentified-delivery-indicators")]
unidentified_delivery_indicators: Option<bool>,
#[arg(long = "typing-indicators")]
typing_indicators: Option<bool>,
#[arg(long = "link-previews")]
link_previews: Option<bool>,
},
UpdateContact {
recipient: String,
#[arg(short = 'e', long)]
expiration: Option<u32>,
#[arg(short = 'n', long)]
name: Option<String>,
},
UpdateGroup {
#[arg(short = 'g', long = "group-id")]
group_id: Option<String>,
#[arg(short = 'n', long)]
name: Option<String>,
#[arg(short = 'd', long)]
description: Option<String>,
#[arg(short = 'a', long)]
avatar: Option<String>,
#[arg(short = 'm', long)]
member: Vec<String>,
#[arg(short = 'r', long = "remove-member")]
remove_member: Vec<String>,
#[arg(long)]
admin: Vec<String>,
#[arg(long = "remove-admin")]
remove_admin: Vec<String>,
#[arg(long)]
ban: Vec<String>,
#[arg(long)]
unban: Vec<String>,
#[arg(long = "reset-link")]
reset_link: bool,
#[arg(value_enum, long)]
link: Option<LinkState>,
#[arg(value_enum, long = "set-permission-add-member")]
set_permission_add_member: Option<GroupPermission>,
#[arg(value_enum, long = "set-permission-edit-details")]
set_permission_edit_details: Option<GroupPermission>,
#[arg(value_enum, long = "set-permission-send-messages")]
set_permission_send_messages: Option<GroupPermission>,
#[arg(short = 'e', long)]
expiration: Option<u32>,
},
UpdateProfile {
#[arg(long = "given-name")]
given_name: Option<String>,
#[arg(long = "family-name")]
family_name: Option<String>,
#[arg(long)]
about: Option<String>,
#[arg(long = "about-emoji")]
about_emoji: Option<String>,
#[arg(long = "mobile-coin-address", visible_alias = "mobilecoin-address")]
mobile_coin_address: Option<String>,
#[arg(long)]
avatar: Option<String>,
#[arg(long = "remove-avatar")]
remove_avatar: bool,
},
UploadStickerPack {
path: String,
},
Verify {
verification_code: String,
#[arg(short = 'p', long)]
pin: Option<String>,
},
Version,
}
#[derive(ValueEnum, Clone, Debug)]
#[value(rename_all = "kebab-case")]
pub enum ReceiptType {
Read,
Viewed,
}
#[derive(ValueEnum, Clone, Debug)]
#[value(rename_all = "kebab-case")]
pub enum LinkState {
Enabled,
EnabledWithApproval,
Disabled,
}
#[derive(ValueEnum, Clone, Debug)]
#[value(rename_all = "kebab-case")]
pub enum GroupPermission {
EveryMember,
OnlyAdmins,
}
#[derive(ValueEnum, Clone, Debug)]
#[value(rename_all = "kebab-case")]
pub enum MessageRequestResponseType {
Accept,
Delete,
}

425
client/src/jsonrpc.rs Normal file
View file

@ -0,0 +1,425 @@
use std::path::Path;
use jsonrpsee::async_client::ClientBuilder;
use jsonrpsee::core::client::{Error, SubscriptionClientT};
use jsonrpsee::http_client::HttpClientBuilder;
use jsonrpsee::proc_macros::rpc;
use serde::Deserialize;
use serde_json::Value;
use tokio::net::ToSocketAddrs;
#[rpc(client)]
pub trait Rpc {
#[method(name = "addDevice", param_kind = map)]
async fn add_device(
&self,
account: Option<String>,
uri: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "addStickerPack", param_kind = map)]
async fn add_sticker_pack(
&self,
account: Option<String>,
uri: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "block", param_kind = map)]
fn block(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "deleteLocalAccountData", param_kind = map)]
fn delete_local_account_data(
&self,
account: Option<String>,
#[allow(non_snake_case)] ignoreRegistered: Option<bool>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "getAttachment", param_kind = map)]
fn get_attachment(
&self,
account: Option<String>,
id: String,
recipient: Option<String>,
#[allow(non_snake_case)] groupId: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "getAvatar", param_kind = map)]
fn get_avatar(
&self,
account: Option<String>,
contact: Option<String>,
profile: Option<String>,
#[allow(non_snake_case)] groupId: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "getSticker", param_kind = map)]
fn get_sticker(
&self,
account: Option<String>,
#[allow(non_snake_case)] packId: String,
#[allow(non_snake_case)] stickerId: u32,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "getUserStatus", param_kind = map)]
fn get_user_status(
&self,
account: Option<String>,
recipients: Vec<String>,
usernames: Vec<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "joinGroup", param_kind = map)]
fn join_group(&self, account: Option<String>, uri: String) -> Result<Value, ErrorObjectOwned>;
#[allow(non_snake_case)]
#[method(name = "finishChangeNumber", param_kind = map)]
fn finish_change_number(
&self,
account: Option<String>,
number: String,
verificationCode: String,
pin: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "finishLink", param_kind = map)]
fn finish_link(
&self,
#[allow(non_snake_case)] deviceLinkUri: String,
#[allow(non_snake_case)] deviceName: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listAccounts", param_kind = map)]
fn list_accounts(&self) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listContacts", param_kind = map)]
fn list_contacts(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] allRecipients: bool,
blocked: Option<bool>,
name: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listDevices", param_kind = map)]
fn list_devices(&self, account: Option<String>) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listGroups", param_kind = map)]
fn list_groups(
&self,
account: Option<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listIdentities", param_kind = map)]
fn list_identities(
&self,
account: Option<String>,
number: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "listStickerPacks", param_kind = map)]
fn list_sticker_packs(&self, account: Option<String>) -> Result<Value, ErrorObjectOwned>;
#[method(name = "quitGroup", param_kind = map)]
fn quit_group(
&self,
account: Option<String>,
#[allow(non_snake_case)] groupId: String,
delete: bool,
admins: Vec<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "register", param_kind = map)]
fn register(
&self,
account: Option<String>,
voice: bool,
captcha: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "removeContact", param_kind = map)]
fn remove_contact(
&self,
account: Option<String>,
recipient: String,
forget: bool,
hide: bool,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "removeDevice", param_kind = map)]
fn remove_device(
&self,
account: Option<String>,
#[allow(non_snake_case)] deviceId: u32,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "removePin", param_kind = map)]
fn remove_pin(&self, account: Option<String>) -> Result<Value, ErrorObjectOwned>;
#[method(name = "remoteDelete", param_kind = map)]
fn remote_delete(
&self,
account: Option<String>,
#[allow(non_snake_case)] targetTimestamp: u64,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
#[allow(non_snake_case)] noteToSelf: bool,
) -> Result<Value, ErrorObjectOwned>;
#[allow(non_snake_case)]
#[method(name = "send", param_kind = map)]
fn send(
&self,
account: Option<String>,
recipients: Vec<String>,
groupIds: Vec<String>,
noteToSelf: bool,
endSession: bool,
message: String,
attachments: Vec<String>,
viewOnce: bool,
mentions: Vec<String>,
textStyle: Vec<String>,
quoteTimestamp: Option<u64>,
quoteAuthor: Option<String>,
quoteMessage: Option<String>,
quoteMention: Vec<String>,
quoteTextStyle: Vec<String>,
quoteAttachment: Vec<String>,
previewUrl: Option<String>,
previewTitle: Option<String>,
previewDescription: Option<String>,
previewImage: Option<String>,
sticker: Option<String>,
storyTimestamp: Option<u64>,
storyAuthor: Option<String>,
editTimestamp: Option<u64>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendContacts", param_kind = map)]
fn send_contacts(&self, account: Option<String>) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendPaymentNotification", param_kind = map)]
fn send_payment_notification(
&self,
account: Option<String>,
recipient: String,
receipt: String,
note: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendReaction", param_kind = map)]
fn send_reaction(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
#[allow(non_snake_case)] noteToSelf: bool,
emoji: String,
#[allow(non_snake_case)] targetAuthor: String,
#[allow(non_snake_case)] targetTimestamp: u64,
remove: bool,
story: bool,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendReceipt", param_kind = map)]
fn send_receipt(
&self,
account: Option<String>,
recipient: String,
#[allow(non_snake_case)] targetTimestamps: Vec<u64>,
r#type: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendSyncRequest", param_kind = map)]
fn send_sync_request(&self, account: Option<String>) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendTyping", param_kind = map)]
fn send_typing(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
stop: bool,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "sendMessageRequestResponse", param_kind = map)]
fn send_message_request_response(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
r#type: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "setPin", param_kind = map)]
fn set_pin(&self, account: Option<String>, pin: String) -> Result<Value, ErrorObjectOwned>;
#[method(name = "submitRateLimitChallenge", param_kind = map)]
fn submit_rate_limit_challenge(
&self,
account: Option<String>,
challenge: String,
captcha: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "startChangeNumber", param_kind = map)]
fn start_change_number(
&self,
account: Option<String>,
number: String,
voice: bool,
captcha: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "startLink", param_kind = map)]
fn start_link(&self, account: Option<String>) -> Result<JsonLink, ErrorObjectOwned>;
#[method(name = "trust", param_kind = map)]
fn trust(
&self,
account: Option<String>,
recipient: String,
#[allow(non_snake_case)] trustAllKnownKeys: bool,
#[allow(non_snake_case)] verifiedSafetyNumber: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "unblock", param_kind = map)]
fn unblock(
&self,
account: Option<String>,
recipients: Vec<String>,
#[allow(non_snake_case)] groupIds: Vec<String>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "unregister", param_kind = map)]
fn unregister(
&self,
account: Option<String>,
#[allow(non_snake_case)] deleteAccount: bool,
) -> Result<Value, ErrorObjectOwned>;
#[allow(non_snake_case)]
#[method(name = "updateAccount", param_kind = map)]
fn update_account(
&self,
account: Option<String>,
deviceName: Option<String>,
unrestrictedUnidentifiedSender: Option<bool>,
discoverableByNumber: Option<bool>,
numberSharing: Option<bool>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "updateConfiguration", param_kind = map)]
fn update_configuration(
&self,
account: Option<String>,
#[allow(non_snake_case)] readReceipts: Option<bool>,
#[allow(non_snake_case)] unidentifiedDeliveryIndicators: Option<bool>,
#[allow(non_snake_case)] typingIndicators: Option<bool>,
#[allow(non_snake_case)] linkPreviews: Option<bool>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "updateContact", param_kind = map)]
fn update_contact(
&self,
account: Option<String>,
recipient: String,
name: Option<String>,
expiration: Option<u32>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "updateGroup", param_kind = map)]
fn update_group(
&self,
account: Option<String>,
#[allow(non_snake_case)] groupId: Option<String>,
name: Option<String>,
description: Option<String>,
avatar: Option<String>,
member: Vec<String>,
#[allow(non_snake_case)] removeMember: Vec<String>,
admin: Vec<String>,
#[allow(non_snake_case)] removeAdmin: Vec<String>,
ban: Vec<String>,
unban: Vec<String>,
#[allow(non_snake_case)] resetLink: bool,
#[allow(non_snake_case)] link: Option<String>,
#[allow(non_snake_case)] setPermissionAddMember: Option<String>,
#[allow(non_snake_case)] setPermissionEditDetails: Option<String>,
#[allow(non_snake_case)] setPermissionSendMessages: Option<String>,
expiration: Option<u32>,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "updateProfile", param_kind = map)]
fn update_profile(
&self,
account: Option<String>,
#[allow(non_snake_case)] givenName: Option<String>,
#[allow(non_snake_case)] familyName: Option<String>,
about: Option<String>,
#[allow(non_snake_case)] aboutEmoji: Option<String>,
#[allow(non_snake_case)] mobileCoinAddress: Option<String>,
avatar: Option<String>,
#[allow(non_snake_case)] removeAvatar: bool,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "uploadStickerPack", param_kind = map)]
fn upload_sticker_pack(
&self,
account: Option<String>,
path: String,
) -> Result<Value, ErrorObjectOwned>;
#[method(name = "verify", param_kind = map)]
fn verify(
&self,
account: Option<String>,
#[allow(non_snake_case)] verificationCode: String,
pin: Option<String>,
) -> Result<Value, ErrorObjectOwned>;
#[subscription(
name = "subscribeReceive" => "receive",
unsubscribe = "unsubscribeReceive",
item = Value,
param_kind = map
)]
async fn subscribe_receive(&self, account: Option<String>) -> SubscriptionResult;
#[method(name = "version")]
fn version(&self) -> Result<Value, ErrorObjectOwned>;
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct JsonLink {
pub device_link_uri: String,
}
pub async fn connect_tcp(
tcp: impl ToSocketAddrs,
) -> Result<impl SubscriptionClientT, std::io::Error> {
let (sender, receiver) = super::transports::tcp::connect(tcp).await?;
Ok(ClientBuilder::default().build_with_tokio(sender, receiver))
}
#[cfg(unix)]
pub async fn connect_unix(
socket_path: impl AsRef<Path>,
) -> Result<impl SubscriptionClientT, std::io::Error> {
let (sender, receiver) = super::transports::ipc::connect(socket_path).await?;
Ok(ClientBuilder::default().build_with_tokio(sender, receiver))
}
pub async fn connect_http(uri: &str) -> Result<impl SubscriptionClientT + use<>, Error> {
HttpClientBuilder::default().build(uri)
}

526
client/src/main.rs Normal file
View file

@ -0,0 +1,526 @@
use std::{path::PathBuf, time::Duration};
use clap::Parser;
use jsonrpsee::core::client::{Error as RpcError, Subscription, SubscriptionClientT};
use serde_json::{Error, Value};
use tokio::{select, time::sleep};
use cli::Cli;
use crate::cli::{CliCommands, GroupPermission, LinkState};
use crate::jsonrpc::RpcClient;
mod cli;
#[allow(non_snake_case, clippy::too_many_arguments)]
mod jsonrpc;
mod transports;
const DEFAULT_TCP: &str = "127.0.0.1:7583";
const DEFAULT_SOCKET_SUFFIX: &str = "signal-cli/socket";
const DEFAULT_HTTP: &str = "http://localhost:8080/api/v1/rpc";
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let cli = cli::Cli::parse();
let result = connect(cli).await;
match result {
Ok(Value::Null) => {}
Ok(v) => println!("{v}"),
Err(e) => return Err(anyhow::anyhow!("JSON-RPC command failed: {e:?}")),
}
Ok(())
}
async fn handle_command(
cli: Cli,
client: impl SubscriptionClientT + Sync,
) -> Result<Value, RpcError> {
match cli.command {
CliCommands::Receive { timeout } => {
let mut stream = client.subscribe_receive(cli.account).await?;
{
while let Some(v) = stream_next(timeout, &mut stream).await {
let v = v?;
println!("{v}");
}
}
stream.unsubscribe().await?;
Ok(Value::Null)
}
CliCommands::AddDevice { uri } => client.add_device(cli.account, uri).await,
CliCommands::Block {
recipient,
group_id,
} => client.block(cli.account, recipient, group_id).await,
CliCommands::DeleteLocalAccountData { ignore_registered } => {
client
.delete_local_account_data(cli.account, ignore_registered)
.await
}
CliCommands::GetUserStatus {
recipient,
username,
} => {
client
.get_user_status(cli.account, recipient, username)
.await
}
CliCommands::JoinGroup { uri } => client.join_group(cli.account, uri).await,
CliCommands::Link { name } => {
let url = client
.start_link(cli.account)
.await
.map_err(|e| RpcError::Custom(format!("JSON-RPC command startLink failed: {e:?}")))?
.device_link_uri;
println!("{url}");
client.finish_link(url, name).await
}
CliCommands::ListAccounts => client.list_accounts().await,
CliCommands::ListContacts {
recipient,
all_recipients,
blocked,
name,
} => {
client
.list_contacts(cli.account, recipient, all_recipients, blocked, name)
.await
}
CliCommands::ListDevices => client.list_devices(cli.account).await,
CliCommands::ListGroups {
detailed: _,
group_id,
} => client.list_groups(cli.account, group_id).await,
CliCommands::ListIdentities { number } => client.list_identities(cli.account, number).await,
CliCommands::ListStickerPacks => client.list_sticker_packs(cli.account).await,
CliCommands::QuitGroup {
group_id,
delete,
admin,
} => {
client
.quit_group(cli.account, group_id, delete, admin)
.await
}
CliCommands::Register { voice, captcha } => {
client.register(cli.account, voice, captcha).await
}
CliCommands::RemoveContact {
recipient,
forget,
hide,
} => {
client
.remove_contact(cli.account, recipient, forget, hide)
.await
}
CliCommands::RemoveDevice { device_id } => {
client.remove_device(cli.account, device_id).await
}
CliCommands::RemovePin => client.remove_pin(cli.account).await,
CliCommands::RemoteDelete {
target_timestamp,
recipient,
group_id,
note_to_self,
} => {
client
.remote_delete(
cli.account,
target_timestamp,
recipient,
group_id,
note_to_self,
)
.await
}
CliCommands::Send {
recipient,
group_id,
note_to_self,
end_session,
message,
attachment,
view_once,
mention,
text_style,
quote_timestamp,
quote_author,
quote_message,
quote_mention,
quote_text_style,
quote_attachment,
preview_url,
preview_title,
preview_description,
preview_image,
sticker,
story_timestamp,
story_author,
edit_timestamp,
} => {
client
.send(
cli.account,
recipient,
group_id,
note_to_self,
end_session,
message.unwrap_or_default(),
attachment,
view_once,
mention,
text_style,
quote_timestamp,
quote_author,
quote_message,
quote_mention,
quote_text_style,
quote_attachment,
preview_url,
preview_title,
preview_description,
preview_image,
sticker,
story_timestamp,
story_author,
edit_timestamp,
)
.await
}
CliCommands::SendContacts => client.send_contacts(cli.account).await,
CliCommands::SendPaymentNotification {
recipient,
receipt,
note,
} => {
client
.send_payment_notification(cli.account, recipient, receipt, note)
.await
}
CliCommands::SendReaction {
recipient,
group_id,
note_to_self,
emoji,
target_author,
target_timestamp,
remove,
story,
} => {
client
.send_reaction(
cli.account,
recipient,
group_id,
note_to_self,
emoji,
target_author,
target_timestamp,
remove,
story,
)
.await
}
CliCommands::SendReceipt {
recipient,
target_timestamp,
r#type,
} => {
client
.send_receipt(
cli.account,
recipient,
target_timestamp,
match r#type {
cli::ReceiptType::Read => "read".to_owned(),
cli::ReceiptType::Viewed => "viewed".to_owned(),
},
)
.await
}
CliCommands::SendSyncRequest => client.send_sync_request(cli.account).await,
CliCommands::SendTyping {
recipient,
group_id,
stop,
} => {
client
.send_typing(cli.account, recipient, group_id, stop)
.await
}
CliCommands::SetPin { pin } => client.set_pin(cli.account, pin).await,
CliCommands::SubmitRateLimitChallenge { challenge, captcha } => {
client
.submit_rate_limit_challenge(cli.account, challenge, captcha)
.await
}
CliCommands::Trust {
recipient,
trust_all_known_keys,
verified_safety_number,
} => {
client
.trust(
cli.account,
recipient,
trust_all_known_keys,
verified_safety_number,
)
.await
}
CliCommands::Unblock {
recipient,
group_id,
} => client.unblock(cli.account, recipient, group_id).await,
CliCommands::Unregister { delete_account } => {
client.unregister(cli.account, delete_account).await
}
CliCommands::UpdateAccount {
device_name,
unrestricted_unidentified_sender,
discoverable_by_number,
number_sharing,
} => {
client
.update_account(
cli.account,
device_name,
unrestricted_unidentified_sender,
discoverable_by_number,
number_sharing,
)
.await
}
CliCommands::UpdateConfiguration {
read_receipts,
unidentified_delivery_indicators,
typing_indicators,
link_previews,
} => {
client
.update_configuration(
cli.account,
read_receipts,
unidentified_delivery_indicators,
typing_indicators,
link_previews,
)
.await
}
CliCommands::UpdateContact {
recipient,
expiration,
name,
} => {
client
.update_contact(cli.account, recipient, name, expiration)
.await
}
CliCommands::UpdateGroup {
group_id,
name,
description,
avatar,
member,
remove_member,
admin,
remove_admin,
ban,
unban,
reset_link,
link,
set_permission_add_member,
set_permission_edit_details,
set_permission_send_messages,
expiration,
} => {
client
.update_group(
cli.account,
group_id,
name,
description,
avatar,
member,
remove_member,
admin,
remove_admin,
ban,
unban,
reset_link,
link.map(|link| match link {
LinkState::Enabled => "enabled".to_owned(),
LinkState::EnabledWithApproval => "enabledWithApproval".to_owned(),
LinkState::Disabled => "disabled".to_owned(),
}),
set_permission_add_member.map(|p| match p {
GroupPermission::EveryMember => "everyMember".to_owned(),
GroupPermission::OnlyAdmins => "onlyAdmins".to_owned(),
}),
set_permission_edit_details.map(|p| match p {
GroupPermission::EveryMember => "everyMember".to_owned(),
GroupPermission::OnlyAdmins => "onlyAdmins".to_owned(),
}),
set_permission_send_messages.map(|p| match p {
GroupPermission::EveryMember => "everyMember".to_owned(),
GroupPermission::OnlyAdmins => "onlyAdmins".to_owned(),
}),
expiration,
)
.await
}
CliCommands::UpdateProfile {
given_name,
family_name,
about,
about_emoji,
mobile_coin_address,
avatar,
remove_avatar,
} => {
client
.update_profile(
cli.account,
given_name,
family_name,
about,
about_emoji,
mobile_coin_address,
avatar,
remove_avatar,
)
.await
}
CliCommands::UploadStickerPack { path } => {
client.upload_sticker_pack(cli.account, path).await
}
CliCommands::Verify {
verification_code,
pin,
} => client.verify(cli.account, verification_code, pin).await,
CliCommands::Version => client.version().await,
CliCommands::AddStickerPack { uri } => client.add_sticker_pack(cli.account, uri).await,
CliCommands::FinishChangeNumber {
number,
verification_code,
pin,
} => {
client
.finish_change_number(cli.account, number, verification_code, pin)
.await
}
CliCommands::GetAttachment {
id,
recipient,
group_id,
} => {
client
.get_attachment(cli.account, id, recipient, group_id)
.await
}
CliCommands::GetAvatar {
contact,
profile,
group_id,
} => {
client
.get_avatar(cli.account, contact, profile, group_id)
.await
}
CliCommands::GetSticker {
pack_id,
sticker_id,
} => client.get_sticker(cli.account, pack_id, sticker_id).await,
CliCommands::StartChangeNumber {
number,
voice,
captcha,
} => {
client
.start_change_number(cli.account, number, voice, captcha)
.await
}
CliCommands::SendMessageRequestResponse {
recipient,
group_id,
r#type,
} => {
client
.send_message_request_response(
cli.account,
recipient,
group_id,
match r#type {
cli::MessageRequestResponseType::Accept => "accept".to_owned(),
cli::MessageRequestResponseType::Delete => "delete".to_owned(),
},
)
.await
}
}
}
async fn connect(cli: Cli) -> Result<Value, RpcError> {
if let Some(http) = &cli.json_rpc_http {
let uri = if let Some(uri) = http {
uri
} else {
DEFAULT_HTTP
};
let client = jsonrpc::connect_http(uri)
.await
.map_err(|e| RpcError::Custom(format!("Failed to connect to socket: {e}")))?;
handle_command(cli, client).await
} else if let Some(tcp) = cli.json_rpc_tcp {
let socket_addr = tcp.unwrap_or_else(|| DEFAULT_TCP.parse().unwrap());
let client = jsonrpc::connect_tcp(socket_addr)
.await
.map_err(|e| RpcError::Custom(format!("Failed to connect to socket: {e}")))?;
handle_command(cli, client).await
} else {
#[cfg(windows)]
{
Err(RpcError::Custom("Invalid socket".into()))
}
#[cfg(unix)]
{
let socket_path = cli
.json_rpc_socket
.clone()
.unwrap_or(None)
.or_else(|| {
std::env::var_os("XDG_RUNTIME_DIR").map(|runtime_dir| {
PathBuf::from(runtime_dir)
.join(DEFAULT_SOCKET_SUFFIX)
.into()
})
})
.unwrap_or_else(|| ("/run".to_owned() + DEFAULT_SOCKET_SUFFIX).into());
let client = jsonrpc::connect_unix(socket_path)
.await
.map_err(|e| RpcError::Custom(format!("Failed to connect to socket: {e}")))?;
handle_command(cli, client).await
}
}
}
async fn stream_next(
timeout: f64,
stream: &mut Subscription<Value>,
) -> Option<Result<Value, Error>> {
if timeout < 0.0 {
stream.next().await
} else {
select! {
v = stream.next() => v,
_= sleep(Duration::from_millis((timeout * 1000.0) as u64)) => None,
}
}
}

View file

@ -0,0 +1,23 @@
use std::io::Error;
use std::path::Path;
use futures_util::stream::StreamExt;
use jsonrpsee::core::client::{TransportReceiverT, TransportSenderT};
use tokio::net::UnixStream;
use tokio_util::codec::Decoder;
use super::stream_codec::StreamCodec;
use super::{Receiver, Sender};
/// Connect to a JSON-RPC Unix Socket server.
pub async fn connect(
socket: impl AsRef<Path>,
) -> Result<(impl TransportSenderT + Send, impl TransportReceiverT + Send), Error> {
let connection = UnixStream::connect(socket).await?;
let (sink, stream) = StreamCodec::stream_incoming().framed(connection).split();
let sender = Sender { inner: sink };
let receiver = Receiver { inner: stream };
Ok((sender, receiver))
}

View file

@ -0,0 +1,60 @@
use futures_util::{stream::StreamExt, Sink, SinkExt, Stream};
use jsonrpsee::core::client::{ReceivedMessage, TransportReceiverT, TransportSenderT};
use thiserror::Error;
#[cfg(unix)]
pub mod ipc;
mod stream_codec;
pub mod tcp;
#[derive(Debug, Error)]
enum Errors {
#[error("Other: {0}")]
Other(String),
#[error("Closed")]
Closed,
}
struct Sender<T: Send + Sink<String>> {
inner: T,
}
impl<T: Send + Sink<String, Error = impl std::error::Error> + Unpin + 'static> TransportSenderT
for Sender<T>
{
type Error = Errors;
async fn send(&mut self, body: String) -> Result<(), Self::Error> {
self.inner
.send(body)
.await
.map_err(|e| Errors::Other(format!("{e:?}")))?;
Ok(())
}
async fn close(&mut self) -> Result<(), Self::Error> {
self.inner
.close()
.await
.map_err(|e| Errors::Other(format!("{e:?}")))?;
Ok(())
}
}
struct Receiver<T: Send + Stream> {
inner: T,
}
impl<T: Send + Stream<Item = Result<String, std::io::Error>> + Unpin + 'static> TransportReceiverT
for Receiver<T>
{
type Error = Errors;
async fn receive(&mut self) -> Result<ReceivedMessage, Self::Error> {
match self.inner.next().await {
None => Err(Errors::Closed),
Some(Ok(msg)) => Ok(ReceivedMessage::Text(msg)),
Some(Err(e)) => Err(Errors::Other(format!("{e:?}"))),
}
}
}

View file

@ -0,0 +1,61 @@
use bytes::BytesMut;
use std::{io, str};
use tokio_util::codec::{Decoder, Encoder};
type Separator = u8;
/// Stream codec for streaming protocols (ipc, tcp)
#[derive(Debug, Default)]
pub struct StreamCodec {
incoming_separator: Separator,
outgoing_separator: Separator,
}
impl StreamCodec {
/// Default codec with streaming input data. Input can be both enveloped and not.
pub fn stream_incoming() -> Self {
StreamCodec::new(b'\n', b'\n')
}
/// New custom stream codec
pub fn new(incoming_separator: Separator, outgoing_separator: Separator) -> Self {
StreamCodec {
incoming_separator,
outgoing_separator,
}
}
}
impl Decoder for StreamCodec {
type Item = String;
type Error = io::Error;
fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<Self::Item>> {
if let Some(i) = buf
.as_ref()
.iter()
.position(|&b| b == self.incoming_separator)
{
let line = buf.split_to(i);
let _ = buf.split_to(1);
match str::from_utf8(line.as_ref()) {
Ok(s) => Ok(Some(s.to_string())),
Err(_) => Err(io::Error::other("invalid UTF-8")),
}
} else {
Ok(None)
}
}
}
impl Encoder<String> for StreamCodec {
type Error = io::Error;
fn encode(&mut self, msg: String, buf: &mut BytesMut) -> io::Result<()> {
let mut payload = msg.into_bytes();
payload.push(self.outgoing_separator);
buf.extend_from_slice(&payload);
Ok(())
}
}

View file

@ -0,0 +1,22 @@
use std::io::Error;
use futures_util::stream::StreamExt;
use jsonrpsee::core::client::{TransportReceiverT, TransportSenderT};
use tokio::net::{TcpStream, ToSocketAddrs};
use tokio_util::codec::Decoder;
use super::stream_codec::StreamCodec;
use super::{Receiver, Sender};
/// Connect to a JSON-RPC TCP server.
pub async fn connect(
socket: impl ToSocketAddrs,
) -> Result<(impl TransportSenderT + Send, impl TransportReceiverT + Send), Error> {
let connection = TcpStream::connect(socket).await?;
let (sink, stream) = StreamCodec::stream_incoming().framed(connection).split();
let sender = Sender { inner: sink };
let receiver = Receiver { inner: stream };
Ok((sender, receiver))
}

View 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>

View file

@ -0,0 +1,4 @@
[D-BUS Service]
Name=org.asamk.Signal
Exec=/bin/false
SystemdService=dbus-org.asamk.Signal.service

View file

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="console-application">
<id>org.asamk.SignalCli</id>
<name>signal-cli</name>
<summary>Use Signal messenger in terminal</summary>
<developer id="org.asamk">
<name>AsamK</name>
</developer>
<icon type="stock">org.asamk.SignalCli</icon>
<keywords>
<keyword>signal</keyword>
<keyword>signal-cli</keyword>
<keyword>messenger</keyword>
<keyword>messaging</keyword>
</keywords>
<url type="bugtracker">https://github.com/AsamK/signal-cli/issues</url>
<url type="homepage">https://github.com/AsamK/signal-cli</url>
<url type="donation">https://github.com/sponsors/AsamK</url>
<url type="faq">https://github.com/AsamK/signal-cli/discussions</url>
<url type="vcs-browser">https://github.com/AsamK/signal-cli</url>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-only</project_license>
<description>
<p>
signal-cli is an unofficial commandline interface for the Signal Messenger.
It supports many Signal functions, including registering, verifying, sending and receiving messages.
For registering you need a phone number where you can receive SMS or incoming calls.
Alternatively signal-cli can be linked to an existing App account.
</p>
</description>
<categories>
<category>Utility</category>
<category>Java</category>
</categories>
<provides>
<binary>signal-cli</binary>
</provides>
<content_rating type="oars-1.1">
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<releases>
<release version="0.13.18" date="2025-07-16">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.18</url>
</release>
<release version="0.13.17" date="2025-06-28">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.17</url>
</release>
<release version="0.13.16" date="2025-06-07">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.16</url>
</release>
<release version="0.13.15" date="2025-05-08">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.15</url>
</release>
<release version="0.13.14" date="2025-04-06">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.14</url>
</release>
<release version="0.13.13" date="2025-02-28">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.13</url>
</release>
<release version="0.13.12" date="2025-01-18">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.12</url>
</release>
<release version="0.13.11" date="2024-12-26">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.11</url>
</release>
<release version="0.13.10" date="2024-11-30">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.10</url>
</release>
<release version="0.13.9" date="2024-10-28">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.9</url>
</release>
<release version="0.13.8" date="2024-10-26">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.8</url>
</release>
<release version="0.13.7" date="2024-09-28">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.7</url>
</release>
<release version="0.13.6" date="2024-09-08">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.6</url>
</release>
<release version="0.13.5" date="2024-07-25">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.5</url>
</release>
<release version="0.13.4" date="2024-06-06">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.4</url>
</release>
<release version="0.13.3" date="2024-04-19">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.3</url>
</release>
<release version="0.13.2" date="2024-03-23">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.2</url>
</release>
<release version="0.13.1" date="2024-02-27">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.1</url>
</release>
<release version="0.13.0" date="2024-02-18">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.13.0</url>
</release>
<release version="0.12.8" date="2024-02-08">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.12.8</url>
</release>
<release version="0.12.7" date="2023-12-15">
<url type="details">https://github.com/AsamK/signal-cli/releases/tag/v0.12.7</url>
</release>
</releases>
</component>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="128" height="128" version="1.1" viewBox="0 0 33.867 33.867" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-32.279 -138.64)">
<g transform="matrix(.45526 0 0 .45526 33.984 140.17)">
<path d="m33.468 66.938c-18.454 0-33.468-15.014-33.468-33.469s15.014-33.469 33.468-33.469c18.455 0 33.469 15.014 33.469 33.469 0 5.621-1.421 11.161-4.116 16.076l4.608 17.2-16.849-4.516c-5.172 3.084-11.069 4.709-17.112 4.709z" fill="#fff"/>
<path d="m33.468 67.184c-18.454 0-33.468-15.014-33.468-33.469s15.014-33.469 33.468-33.469c18.455 0 33.469 15.014 33.469 33.469 0 5.621-1.421 11.161-4.116 16.076l4.608 17.2-16.849-4.516c-5.172 3.084-11.069 4.709-17.112 4.709zm0-62.938c-16.249 0-29.468 13.22-29.468 29.469s13.219 29.469 29.468 29.469c5.582 0 11.021-1.574 15.729-4.554l0.74-0.468 11.835 3.171-3.243-12.1 0.419-0.72c2.609-4.484 3.988-9.602 3.988-14.799 0-16.248-13.219-29.468-29.468-29.468z"/>
<path d="m25.515 45.296q-2.3937 0-4.2817-0.97772-1.8543-0.97772-2.9332-3.0343-1.0451-2.0566-1.0451-5.2595 0-3.3377 1.1126-5.428 1.1126-2.0903 3.0006-3.068 1.9217-0.97772 4.3492-0.97772 1.3823 0 2.6634 0.30343 1.2812 0.26972 2.0903 0.67429l-0.91029 2.4612q-0.80915-0.30343-1.888-0.57315t-2.0229-0.26972q-5.3269 0-5.3269 6.844 0 3.2703 1.2812 5.0235 1.3149 1.7194 3.8772 1.7194 1.4834 0 2.596-0.30343 1.1463-0.30343 2.0903-0.74172v2.6297q-0.91029 0.472-2.0229 0.708-1.0789 0.26972-2.6297 0.26972zm11.901-0.33714h-2.9669v-25.623h2.9669zm7.2486-24.848q0.67429 0 1.18 0.472 0.53943 0.43829 0.53943 1.416 0 0.94401-0.53943 1.416-0.50572 0.472-1.18 0.472-0.74172 0-1.2474-0.472-0.50572-0.472-0.50572-1.416 0-0.97772 0.50572-1.416 0.50572-0.472 1.2474-0.472zm1.4497 6.7766v18.071h-2.9669v-18.071z" aria-label="cli"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,46 @@
[Unit]
Description=Send secure messages to Signal clients
Wants=network-online.target
After=network-online.target
Requires=signal-cli-socket.socket
[Service]
CapabilityBoundingSet=
Environment="SIGNAL_CLI_OPTS=-Xms2m"
# Update 'ReadWritePaths' if you change the config path here
ExecStart=%dir%/bin/signal-cli --config /var/lib/signal-cli daemon
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateIPC=true
PrivateTmp=true
PrivateUsers=true
ProcSubset=pid
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=strict
# Profile pictures and attachments to upload must be located here for the service to access them
ReadWritePaths=/var/lib/signal-cli
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
StandardInput=socket
StandardOutput=journal
StandardError=journal
SystemCallArchitectures=native
SystemCallFilter=~@debug @mount @obsolete @privileged @resources
UMask=0077
# Create the user and home directory with 'useradd -r -U -s /usr/sbin/nologin -m -b /var/lib signal-cli'
User=signal-cli
[Install]
Also=signal-cli-socket.socket
WantedBy=default.target

View file

@ -0,0 +1,13 @@
[Unit]
Description=Send secure messages to Signal clients
[Socket]
ListenStream=%t/signal-cli/socket
SocketUser=root
# Add yourself to the signal-cli group to talk with the service
# Run 'usermod -aG signal-cli yourusername'
SocketGroup=signal-cli
SocketMode=0660
[Install]
WantedBy=sockets.target

16
data/signal-cli.service Normal file
View file

@ -0,0 +1,16 @@
[Unit]
Description=Send secure messages to Signal clients
Requires=dbus.socket
After=dbus.socket
Wants=network-online.target
After=network-online.target
[Service]
Type=dbus
Environment="SIGNAL_CLI_OPTS=-Xms2m"
ExecStart=%dir%/bin/signal-cli --config /var/lib/signal-cli daemon --dbus-system
User=signal-cli
BusName=org.asamk.Signal
[Install]
Alias=dbus-org.asamk.Signal.service

View file

@ -0,0 +1 @@
u signal-cli - "Signal messaging service" /var/lib/signal-cli

View file

@ -0,0 +1,5 @@
d /var/lib/signal-cli 0755 signal-cli signal-cli -
d /var/lib/signal-cli/data 0700 signal-cli signal-cli -
d /var/lib/signal-cli/attachments 0750 signal-cli signal-cli -
d /var/lib/signal-cli/avatars 0750 signal-cli signal-cli -
d /var/lib/signal-cli/stickers 0750 signal-cli signal-cli -

16
data/signal-cli@.service Normal file
View file

@ -0,0 +1,16 @@
[Unit]
Description=Send secure messages to Signal clients
Requires=dbus.socket
After=dbus.socket
Wants=network-online.target
After=network-online.target
[Service]
Type=dbus
Environment="SIGNAL_CLI_OPTS=-Xms2m"
ExecStart=%dir%/bin/signal-cli -a %I --config /var/lib/signal-cli daemon --dbus-system
User=signal-cli
BusName=org.asamk.Signal
[Install]
Alias=dbus-org.asamk.Signal.service

View file

@ -0,0 +1,312 @@
[
{
"name":"[B"
},
{
"name":"[Z"
},
{
"name":"[[B"
},
{
"name":"com.sun.security.auth.module.UnixSystem",
"fields":[{"name":"gid"}, {"name":"groups"}, {"name":"uid"}, {"name":"username"}]
},
{
"name":"java.lang.Boolean",
"methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.Class",
"methods":[{"name":"getCanonicalName","parameterTypes":[] }, {"name":"getClassLoader","parameterTypes":[] }]
},
{
"name":"java.lang.ClassLoader",
"methods":[{"name":"getPlatformClassLoader","parameterTypes":[] }, {"name":"loadClass","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.ClassNotFoundException"
},
{
"name":"java.lang.Enum",
"methods":[{"name":"ordinal","parameterTypes":[] }]
},
{
"name":"java.lang.IllegalArgumentException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.IllegalStateException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.Long",
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"java.lang.NoClassDefFoundError"
},
{
"name":"java.lang.NoSuchMethodError"
},
{
"name":"java.lang.String"
},
{
"name":"java.lang.Thread",
"methods":[{"name":"currentThread","parameterTypes":[] }, {"name":"getStackTrace","parameterTypes":[] }]
},
{
"name":"java.lang.Throwable",
"methods":[{"name":"getMessage","parameterTypes":[] }, {"name":"setStackTrace","parameterTypes":["java.lang.StackTraceElement[]"] }, {"name":"toString","parameterTypes":[] }]
},
{
"name":"java.lang.UnsatisfiedLinkError",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.util.HashMap",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"java.util.Map",
"methods":[{"name":"get","parameterTypes":["java.lang.Object"] }, {"name":"put","parameterTypes":["java.lang.Object","java.lang.Object"] }, {"name":"remove","parameterTypes":["java.lang.Object"] }]
},
{
"name":"java.util.UUID",
"methods":[{"name":"<init>","parameterTypes":["long","long"] }, {"name":"getLeastSignificantBits","parameterTypes":[] }, {"name":"getMostSignificantBits","parameterTypes":[] }]
},
{
"name":"jdk.internal.loader.ClassLoaders$AppClassLoader"
},
{
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"
},
{
"name":"org.asamk.signal.manager.storage.protocol.SignalProtocolStore",
"methods":[{"name":"getIdentity","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress"] }, {"name":"getIdentityKeyPair","parameterTypes":[] }, {"name":"getLocalRegistrationId","parameterTypes":[] }, {"name":"isTrustedIdentity","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","org.signal.libsignal.protocol.IdentityKey","org.signal.libsignal.protocol.state.IdentityKeyStore$Direction"] }, {"name":"loadKyberPreKey","parameterTypes":["int"] }, {"name":"loadPreKey","parameterTypes":["int"] }, {"name":"loadSenderKey","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","java.util.UUID"] }, {"name":"loadSession","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress"] }, {"name":"loadSignedPreKey","parameterTypes":["int"] }, {"name":"markKyberPreKeyUsed","parameterTypes":["int"] }, {"name":"removePreKey","parameterTypes":["int"] }, {"name":"saveIdentity","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","org.signal.libsignal.protocol.IdentityKey"] }, {"name":"storeSenderKey","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","java.util.UUID","org.signal.libsignal.protocol.groups.state.SenderKeyRecord"] }, {"name":"storeSession","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","org.signal.libsignal.protocol.state.SessionRecord"] }]
},
{
"name":"org.asamk.signal.manager.storage.senderKeys.SenderKeyStore",
"methods":[{"name":"loadSenderKey","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","java.util.UUID"] }, {"name":"storeSenderKey","parameterTypes":["org.signal.libsignal.protocol.SignalProtocolAddress","java.util.UUID","org.signal.libsignal.protocol.groups.state.SenderKeyRecord"] }]
},
{
"name":"org.graalvm.jniutils.JNIExceptionWrapperEntryPoints",
"methods":[{"name":"getClassName","parameterTypes":["java.lang.Class"] }]
},
{
"name":"org.signal.libsignal.internal.CompletableFuture",
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"complete","parameterTypes":["java.lang.Object"] }, {"name":"completeExceptionally","parameterTypes":["java.lang.Throwable"] }, {"name":"setCancellationId","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.internal.NativeHandleGuard$SimpleOwner",
"methods":[{"name":"unsafeNativeHandleWithoutGuard","parameterTypes":[] }]
},
{
"name":"org.signal.libsignal.net.CdsiLookupResponse",
"methods":[{"name":"<init>","parameterTypes":["java.util.Map","int"] }]
},
{
"name":"org.signal.libsignal.net.CdsiLookupResponse$Entry",
"methods":[{"name":"<init>","parameterTypes":["byte[]","byte[]"] }]
},
{
"name":"org.signal.libsignal.net.ChatService"
},
{
"name":"org.signal.libsignal.net.ChatService$DebugInfo"
},
{
"name":"org.signal.libsignal.net.ChatService$Response"
},
{
"name":"org.signal.libsignal.net.ChatService$ResponseAndDebugInfo"
},
{
"name":"org.signal.libsignal.net.NetworkException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.net.RetryLaterException",
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.protocol.DuplicateMessageException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.IdentityKey",
"methods":[{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["byte[]"] }, {"name":"serialize","parameterTypes":[] }]
},
{
"name":"org.signal.libsignal.protocol.IdentityKeyPair",
"methods":[{"name":"serialize","parameterTypes":[] }]
},
{
"name":"org.signal.libsignal.protocol.InvalidKeyException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.InvalidKeyIdException"
},
{
"name":"org.signal.libsignal.protocol.InvalidMessageException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.NoSessionException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.SignalProtocolAddress",
"methods":[{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["java.lang.String","int"] }]
},
{
"name":"org.signal.libsignal.protocol.UntrustedIdentityException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.fingerprint.FingerprintParsingException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.groups.state.SenderKeyRecord",
"fields":[{"name":"unsafeHandle"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.protocol.groups.state.SenderKeyStore"
},
{
"name":"org.signal.libsignal.protocol.logging.Log",
"methods":[{"name":"log","parameterTypes":["int","java.lang.String","java.lang.String"] }]
},
{
"name":"org.signal.libsignal.protocol.message.PlaintextContent",
"fields":[{"name":"unsafeHandle"}]
},
{
"name":"org.signal.libsignal.protocol.message.PreKeySignalMessage",
"fields":[{"name":"unsafeHandle"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.protocol.message.SenderKeyMessage",
"fields":[{"name":"unsafeHandle"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.protocol.message.SignalMessage",
"fields":[{"name":"unsafeHandle"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"org.signal.libsignal.protocol.state.IdentityKeyStore"
},
{
"name":"org.signal.libsignal.protocol.state.IdentityKeyStore$Direction",
"fields":[{"name":"RECEIVING"}, {"name":"SENDING"}]
},
{
"name":"org.signal.libsignal.protocol.state.IdentityKeyStore$IdentityChange"
},
{
"name":"org.signal.libsignal.protocol.state.KyberPreKeyRecord",
"fields":[{"name":"unsafeHandle"}]
},
{
"name":"org.signal.libsignal.protocol.state.KyberPreKeyStore"
},
{
"name":"org.signal.libsignal.protocol.state.PreKeyRecord",
"fields":[{"name":"unsafeHandle"}]
},
{
"name":"org.signal.libsignal.protocol.state.PreKeyStore"
},
{
"name":"org.signal.libsignal.protocol.state.SessionRecord",
"fields":[{"name":"unsafeHandle"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["byte[]"] }]
},
{
"name":"org.signal.libsignal.protocol.state.SessionStore"
},
{
"name":"org.signal.libsignal.protocol.state.SignedPreKeyRecord",
"fields":[{"name":"unsafeHandle"}]
},
{
"name":"org.signal.libsignal.protocol.state.SignedPreKeyStore"
},
{
"name":"org.signal.libsignal.usernames.BadDiscriminatorCharacterException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.BadNicknameCharacterException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.CannotBeEmptyException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.DiscriminatorCannotBeZeroException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.MissingSeparatorException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.NicknameTooLongException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.usernames.NicknameTooShortException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.signal.libsignal.zkgroup.InvalidInputException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]
},
{
"name":"org.sqlite.BusyHandler",
"methods":[{"name":"callback","parameterTypes":["int"] }]
},
{
"name":"org.sqlite.Collation",
"methods":[{"name":"xCompare","parameterTypes":["java.lang.String","java.lang.String"] }]
},
{
"name":"org.sqlite.Function",
"fields":[{"name":"args"}, {"name":"context"}, {"name":"value"}],
"methods":[{"name":"xFunc","parameterTypes":[] }]
},
{
"name":"org.sqlite.Function$Aggregate",
"methods":[{"name":"clone","parameterTypes":[] }, {"name":"xFinal","parameterTypes":[] }, {"name":"xStep","parameterTypes":[] }]
},
{
"name":"org.sqlite.Function$Window",
"methods":[{"name":"xInverse","parameterTypes":[] }, {"name":"xValue","parameterTypes":[] }]
},
{
"name":"org.sqlite.ProgressHandler",
"methods":[{"name":"progress","parameterTypes":[] }]
},
{
"name":"org.sqlite.core.DB",
"methods":[{"name":"onCommit","parameterTypes":["boolean"] }, {"name":"onUpdate","parameterTypes":["int","java.lang.String","java.lang.String","long"] }, {"name":"throwex","parameterTypes":[] }, {"name":"throwex","parameterTypes":["int"] }]
},
{
"name":"org.sqlite.core.DB$ProgressObserver",
"methods":[{"name":"progress","parameterTypes":["int","int"] }]
},
{
"name":"org.sqlite.core.NativeDB",
"fields":[{"name":"busyHandler"}, {"name":"commitListener"}, {"name":"pointer"}, {"name":"progressHandler"}, {"name":"updateListener"}],
"methods":[{"name":"stringToUtf8ByteArray","parameterTypes":["java.lang.String"] }, {"name":"throwex","parameterTypes":["java.lang.String"] }]
}
]

View file

@ -0,0 +1,8 @@
[
{
"type":"agent-extracted",
"classes":[
]
}
]

View file

@ -0,0 +1,26 @@
[
{
"interfaces":["java.sql.Connection"]
},
{
"interfaces":["org.asamk.Signal"]
},
{
"interfaces":["org.asamk.Signal$Configuration"]
},
{
"interfaces":["org.asamk.Signal$Device"]
},
{
"interfaces":["org.asamk.Signal$Group"]
},
{
"interfaces":["org.asamk.Signal$Identity"]
},
{
"interfaces":["org.asamk.SignalControl"]
},
{
"interfaces":["org.freedesktop.dbus.interfaces.DBus"]
}
]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,226 @@
{
"resources":{
"includes":[{
"pattern":"\\QMETA-INF/maven/org.xerial/sqlite-jdbc/pom.properties\\E"
}, {
"pattern":"\\QMETA-INF/services/ch.qos.logback.classic.spi.Configurator\\E"
}, {
"pattern":"\\QMETA-INF/services/com.sun.net.httpserver.spi.HttpServerProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.lang.System$LoggerFinder\\E"
}, {
"pattern":"\\QMETA-INF/services/java.net.spi.InetAddressResolverProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.net.spi.URLStreamHandlerProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.nio.channels.spi.SelectorProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.nio.file.spi.FileTypeDetector\\E"
}, {
"pattern":"\\QMETA-INF/services/java.sql.Driver\\E"
}, {
"pattern":"\\QMETA-INF/services/java.time.zone.ZoneRulesProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.util.spi.ResourceBundleControlProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader\\E"
}, {
"pattern":"\\QMETA-INF/services/kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition\\E"
}, {
"pattern":"\\QMETA-INF/services/kotlin.reflect.jvm.internal.impl.util.ModuleVisibilityHelper\\E"
}, {
"pattern":"\\QMETA-INF/services/org.freedesktop.dbus.spi.message.ISocketProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/org.freedesktop.dbus.spi.transport.ITransportProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AG\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AI\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AS\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AT\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AU\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AZ\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BB\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BD\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BE\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BM\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BO\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BS\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CA\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CH\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CI\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CL\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CO\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DK\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EC\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HK\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ID\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IN\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IT\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JP\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LV\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MM\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MO\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MX\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MY\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NG\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NL\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NZ\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PE\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PH\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RO\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RU\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SA\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SI\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SK\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TH\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TR\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UA\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UG\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VE\\E"
}, {
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_XK\\E"
}, {
"pattern":"\\Qjni/x86_64-Linux/libjffi-1.2.so\\E"
}, {
"pattern":"\\Qkotlin/annotation/annotation.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/collections/collections.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/coroutines/coroutines.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/internal/internal.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/jvm/jvm.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/kotlin.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/ranges/ranges.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/reflect/reflect.kotlin_builtins\\E"
}, {
"pattern":"\\Qlibsignal_jni.so\\E"
}, {
"pattern":"\\Qlibsignal_jni_aarch64.dylib\\E"
}, {
"pattern":"\\Qlibsignal_jni_amd64.dylib\\E"
}, {
"pattern":"\\Qlibsignal_jni_amd64.so\\E"
}, {
"pattern":"\\Qorg/asamk/signal/manager/config/ias.store\\E"
}, {
"pattern":"\\Qorg/asamk/signal/manager/config/whisper.store\\E"
}, {
"pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"
}, {
"pattern":"\\Qorg/sqlite/native/Linux/x86_64/libsqlitejdbc.so\\E"
}, {
"pattern":"\\Qsignal_jni.dll\\E"
}, {
"pattern":"\\Qsignal_jni_amd64.dll\\E"
}, {
"pattern":"\\Qsqlite-jdbc.properties\\E"
}, {
"pattern":"com/google/i18n/phonenumbers/data/.*"
}, {
"pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt67b/nfc.nrm\\E"
}, {
"pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt67b/uprops.icu\\E"
}, {
"pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt72b/nfc.nrm\\E"
}, {
"pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt72b/uprops.icu\\E"
}, {
"pattern":"java.base:\\Qsun/net/idn/uidna.spp\\E"
}, {
"pattern":"java.base:\\Qsun/net/www/content-types.properties\\E"
}, {
"pattern":"java.base:\\Qsun/text/resources/LineBreakIteratorData\\E"
}]},
"bundles":[{
"name":"net.sourceforge.argparse4j.internal.ArgumentParserImpl",
"locales":["", "de", "en", "und"]
}]
}

View file

@ -0,0 +1,8 @@
{
"types":[
],
"lambdaCapturingTypes":[
],
"proxies":[
]
}

17
gradle/libs.versions.toml Normal file
View file

@ -0,0 +1,17 @@
[versions]
slf4j = "2.0.17"
[libraries]
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.81"
jackson-databind = "com.fasterxml.jackson.core:jackson-databind:2.19.1"
argparse4j = "net.sourceforge.argparse4j:argparse4j:0.9.0"
dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
logback = "ch.qos.logback:logback-classic:1.5.18"
signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_127"
sqlite = "org.xerial:sqlite-jdbc:3.50.2.0"
hikari = "com.zaxxer:HikariCP:6.3.0"
junit-jupiter = "org.junit.jupiter:junit-jupiter:5.13.2"
junit-launcher = "org.junit.platform:junit-platform-launcher:1.13.2"

Binary file not shown.

View file

@ -1,6 +1,7 @@
#Tue May 05 12:29:30 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

323
gradlew vendored
View file

@ -1,79 +1,129 @@
#!/usr/bin/env bash
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn ( ) {
warn () {
echo "$*"
}
} >&2
die ( ) {
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
CLASSPATH="\\\"\\\""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -82,83 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

90
gradlew.bat vendored
View file

@ -1,4 +1,22 @@
@if "%DEBUG%" == "" @echo off
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -8,26 +26,30 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -35,54 +57,36 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

59
lib/build.gradle.kts Normal file
View file

@ -0,0 +1,59 @@
plugins {
`java-library`
`check-lib-versions`
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
val libsignalClientPath = project.findProperty("libsignal_client_path")?.toString()
dependencies {
if (libsignalClientPath == null) {
implementation(libs.signalservice)
} else {
implementation(libs.signalservice) {
exclude(group = "org.signal", module = "libsignal-client")
}
implementation(files(libsignalClientPath))
}
implementation(libs.jackson.databind)
implementation(libs.bouncycastle)
implementation(libs.slf4j.api)
implementation(libs.sqlite)
implementation(libs.hikari)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.launcher)
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
configurations {
implementation {
resolutionStrategy.failOnVersionConflict()
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.jar {
manifest {
attributes("Automatic-Module-Name" to "org.asamk.signal.manager")
}
}

View file

@ -0,0 +1,373 @@
package org.asamk.signal.manager;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import org.asamk.signal.manager.api.AlreadyReceivingException;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.CaptchaRejectedException;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.Configuration;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.DeviceLimitExceededException;
import org.asamk.signal.manager.api.DeviceLinkUrl;
import org.asamk.signal.manager.api.Group;
import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.GroupInviteLinkUrl;
import org.asamk.signal.manager.api.GroupNotFoundException;
import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.Identity;
import org.asamk.signal.manager.api.IdentityVerificationCode;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.InvalidStickerException;
import org.asamk.signal.manager.api.InvalidUsernameException;
import org.asamk.signal.manager.api.LastGroupAdminException;
import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
import org.asamk.signal.manager.api.PinLockMissingException;
import org.asamk.signal.manager.api.PinLockedException;
import org.asamk.signal.manager.api.RateLimitException;
import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.Recipient;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.SendGroupMessageResults;
import org.asamk.signal.manager.api.SendMessageResults;
import org.asamk.signal.manager.api.StickerPack;
import org.asamk.signal.manager.api.StickerPackId;
import org.asamk.signal.manager.api.StickerPackInvalidException;
import org.asamk.signal.manager.api.StickerPackUrl;
import org.asamk.signal.manager.api.TypingAction;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
import org.asamk.signal.manager.api.UsernameLinkUrl;
import org.asamk.signal.manager.api.UsernameStatus;
import org.asamk.signal.manager.api.VerificationMethodNotAvailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
public interface Manager extends Closeable {
static boolean isValidNumber(final String e164Number, final String countryCode) {
return PhoneNumberUtil.getInstance().isPossibleNumber(e164Number, countryCode);
}
static boolean isSignalClientAvailable() {
final Logger logger = LoggerFactory.getLogger(Manager.class);
try {
try {
org.signal.libsignal.internal.Native.UuidCiphertext_CheckValidContents(new byte[0]);
} catch (Exception e) {
logger.trace("Expected exception when checking libsignal-client: {}", e.getMessage());
}
return true;
} catch (UnsatisfiedLinkError e) {
logger.warn("Failed to call libsignal-client: {}", e.getMessage());
return false;
}
}
String getSelfNumber();
/**
* This is used for checking a set of phone numbers for registration on Signal
*
* @param numbers The set of phone number in question
* @return A map of numbers to canonicalized number and uuid. If a number is not registered the uuid is null.
* @throws IOException if it's unable to get the contacts to check if they're registered
*/
Map<String, UserStatus> getUserStatus(Set<String> numbers) throws IOException, RateLimitException;
Map<String, UsernameStatus> getUsernameStatus(Set<String> usernames) throws IOException;
void updateAccountAttributes(
String deviceName,
Boolean unrestrictedUnidentifiedSender,
final Boolean discoverableByNumber,
final Boolean numberSharing
) throws IOException;
Configuration getConfiguration();
void updateConfiguration(Configuration configuration) throws NotPrimaryDeviceException;
/**
* Update the user's profile.
* If a field is null, the previous value will be kept.
*/
void updateProfile(UpdateProfile updateProfile) throws IOException;
String getUsername();
UsernameLinkUrl getUsernameLink();
/**
* Set a username for the account.
* If the username is null, it will be deleted.
*/
void setUsername(String username) throws IOException, InvalidUsernameException;
/**
* Set a username for the account.
* If the username is null, it will be deleted.
*/
void deleteUsername() throws IOException;
void startChangeNumber(
String newNumber,
boolean voiceVerification,
String captcha
) throws RateLimitException, IOException, CaptchaRequiredException, NonNormalizedPhoneNumberException, NotPrimaryDeviceException, VerificationMethodNotAvailableException;
void finishChangeNumber(
String newNumber,
String verificationCode,
String pin
) throws IncorrectPinException, PinLockedException, IOException, NotPrimaryDeviceException, PinLockMissingException;
void unregister() throws IOException;
void deleteAccount() throws IOException;
void submitRateLimitRecaptchaChallenge(
String challenge,
String captcha
) throws IOException, CaptchaRejectedException;
List<Device> getLinkedDevices() throws IOException;
void removeLinkedDevices(int deviceId) throws IOException, NotPrimaryDeviceException;
void addDeviceLink(DeviceLinkUrl linkUri) throws IOException, InvalidDeviceLinkException, NotPrimaryDeviceException, DeviceLimitExceededException;
void setRegistrationLockPin(Optional<String> pin) throws IOException, NotPrimaryDeviceException;
List<Group> getGroups();
SendGroupMessageResults quitGroup(
GroupId groupId,
Set<RecipientIdentifier.Single> groupAdmins
) throws GroupNotFoundException, IOException, NotAGroupMemberException, LastGroupAdminException, UnregisteredRecipientException;
void deleteGroup(GroupId groupId) throws IOException;
Pair<GroupId, SendGroupMessageResults> createGroup(
String name,
Set<RecipientIdentifier.Single> members,
String avatarFile
) throws IOException, AttachmentInvalidException, UnregisteredRecipientException;
SendGroupMessageResults updateGroup(
final GroupId groupId,
final UpdateGroup updateGroup
) throws IOException, GroupNotFoundException, AttachmentInvalidException, NotAGroupMemberException, GroupSendingNotAllowedException, UnregisteredRecipientException;
Pair<GroupId, SendGroupMessageResults> joinGroup(
GroupInviteLinkUrl inviteLinkUrl
) throws IOException, InactiveGroupLinkException, PendingAdminApprovalException;
SendMessageResults sendTypingMessage(
TypingAction action,
Set<RecipientIdentifier> recipients
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException;
SendMessageResults sendReadReceipt(RecipientIdentifier.Single sender, List<Long> messageIds);
SendMessageResults sendViewedReceipt(RecipientIdentifier.Single sender, List<Long> messageIds);
SendMessageResults sendMessage(
Message message,
Set<RecipientIdentifier> recipients,
boolean notifySelf
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException;
SendMessageResults sendEditMessage(
Message message,
Set<RecipientIdentifier> recipients,
long editTargetTimestamp
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException;
SendMessageResults sendRemoteDeleteMessage(
long targetSentTimestamp,
Set<RecipientIdentifier> recipients
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException;
SendMessageResults sendMessageReaction(
String emoji,
boolean remove,
RecipientIdentifier.Single targetAuthor,
long targetSentTimestamp,
Set<RecipientIdentifier> recipients,
final boolean isStory
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException;
SendMessageResults sendPaymentNotificationMessage(
byte[] receipt,
String note,
RecipientIdentifier.Single recipient
) throws IOException;
SendMessageResults sendEndSessionMessage(Set<RecipientIdentifier.Single> recipients) throws IOException;
SendMessageResults sendMessageRequestResponse(
MessageEnvelope.Sync.MessageRequestResponse.Type type,
Set<RecipientIdentifier> recipientIdentifiers
);
void hideRecipient(RecipientIdentifier.Single recipient);
void deleteRecipient(RecipientIdentifier.Single recipient);
void deleteContact(RecipientIdentifier.Single recipient);
void setContactName(
final RecipientIdentifier.Single recipient,
final String givenName,
final String familyName,
final String nickGivenName,
final String nickFamilyName,
final String note
) throws NotPrimaryDeviceException, UnregisteredRecipientException;
void setContactsBlocked(
Collection<RecipientIdentifier.Single> recipient,
boolean blocked
) throws NotPrimaryDeviceException, IOException, UnregisteredRecipientException;
void setGroupsBlocked(
Collection<GroupId> groupId,
boolean blocked
) throws GroupNotFoundException, IOException, NotPrimaryDeviceException;
/**
* Change the expiration timer for a contact
*/
void setExpirationTimer(
RecipientIdentifier.Single recipient,
int messageExpirationTimer
) throws IOException, UnregisteredRecipientException;
/**
* Upload the sticker pack from path.
*
* @param path Path can be a path to a manifest.json file or to a zip file that contains a manifest.json file
* @return if successful, returns the URL to install the sticker pack in the signal app
*/
StickerPackUrl uploadStickerPack(File path) throws IOException, StickerPackInvalidException;
void installStickerPack(StickerPackUrl url) throws IOException;
List<StickerPack> getStickerPacks();
void requestAllSyncData() throws IOException;
/**
* Add a handler to receive new messages.
* Will start receiving messages from server, if not already started.
*/
default void addReceiveHandler(ReceiveMessageHandler handler) {
addReceiveHandler(handler, false);
}
void addReceiveHandler(ReceiveMessageHandler handler, final boolean isWeakListener);
/**
* Remove a handler to receive new messages.
* Will stop receiving messages from server, if this was the last registered receiver.
*/
void removeReceiveHandler(ReceiveMessageHandler handler);
boolean isReceiving();
/**
* Receive new messages from server, returns if no new message arrive in a timespan of timeout.
*/
void receiveMessages(
Optional<Duration> timeout,
Optional<Integer> maxMessages,
ReceiveMessageHandler handler
) throws IOException, AlreadyReceivingException;
void stopReceiveMessages();
void setReceiveConfig(ReceiveConfig receiveConfig);
boolean isContactBlocked(RecipientIdentifier.Single recipient);
void sendContacts() throws IOException;
List<Recipient> getRecipients(
boolean onlyContacts,
Optional<Boolean> blocked,
Collection<RecipientIdentifier.Single> address,
Optional<String> name
);
String getContactOrProfileName(RecipientIdentifier.Single recipient);
Group getGroup(GroupId groupId);
List<Identity> getIdentities();
List<Identity> getIdentities(RecipientIdentifier.Single recipient);
/**
* Trust this the identity with this fingerprint/safetyNumber
*
* @param recipient account of the identity
*/
boolean trustIdentityVerified(
RecipientIdentifier.Single recipient,
IdentityVerificationCode verificationCode
) throws UnregisteredRecipientException;
/**
* Trust all keys of this identity without verification
*
* @param recipient account of the identity
*/
boolean trustIdentityAllKeys(RecipientIdentifier.Single recipient) throws UnregisteredRecipientException;
void addAddressChangedListener(Runnable listener);
void addClosedListener(Runnable listener);
InputStream retrieveAttachment(final String id) throws IOException;
InputStream retrieveContactAvatar(final RecipientIdentifier.Single recipient) throws IOException, UnregisteredRecipientException;
InputStream retrieveProfileAvatar(final RecipientIdentifier.Single recipient) throws IOException, UnregisteredRecipientException;
InputStream retrieveGroupAvatar(final GroupId groupId) throws IOException;
InputStream retrieveSticker(final StickerPackId stickerPackId, final int stickerId) throws IOException;
@Override
void close();
interface ReceiveMessageHandler {
ReceiveMessageHandler EMPTY = (envelope, e) -> {
};
void handleMessage(MessageEnvelope envelope, Throwable e);
}
}

View file

@ -0,0 +1,10 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.internal.LibSignalLogger;
public class ManagerLogger {
public static void initLogger() {
LibSignalLogger.initLogger();
}
}

View file

@ -0,0 +1,29 @@
package org.asamk.signal.manager;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
public interface MultiAccountManager extends AutoCloseable {
List<String> getAccountNumbers();
List<Manager> getManagers();
void addOnManagerAddedHandler(Consumer<Manager> handler);
void addOnManagerRemovedHandler(Consumer<Manager> handler);
Manager getManager(String phoneNumber);
URI getNewProvisioningDeviceLinkUri() throws TimeoutException, IOException;
ProvisioningManager getProvisioningManagerFor(URI deviceLinkUri);
RegistrationManager getNewRegistrationManager(String account) throws IOException;
@Override
void close();
}

View file

@ -0,0 +1,14 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.api.UserAlreadyExistsException;
import java.io.IOException;
import java.net.URI;
import java.util.concurrent.TimeoutException;
public interface ProvisioningManager {
URI getDeviceLinkUri() throws TimeoutException, IOException;
String finishDeviceLink(String deviceName) throws IOException, TimeoutException, UserAlreadyExistsException;
}

View file

@ -0,0 +1,30 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
import org.asamk.signal.manager.api.PinLockMissingException;
import org.asamk.signal.manager.api.PinLockedException;
import org.asamk.signal.manager.api.RateLimitException;
import org.asamk.signal.manager.api.VerificationMethodNotAvailableException;
import java.io.Closeable;
import java.io.IOException;
public interface RegistrationManager extends Closeable {
void register(
boolean voiceVerification,
String captcha,
final boolean forceRegister
) throws IOException, CaptchaRequiredException, NonNormalizedPhoneNumberException, RateLimitException, VerificationMethodNotAvailableException;
void verifyAccount(
String verificationCode,
String pin
) throws IOException, PinLockedException, IncorrectPinException, PinLockMissingException;
void deleteLocalAccountData() throws IOException;
boolean isRegistered();
}

View file

@ -0,0 +1,8 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.api.TrustNewIdentity;
public record Settings(TrustNewIdentity trustNewIdentity, boolean disableMessageSendLog) {
public static final Settings DEFAULT = new Settings(TrustNewIdentity.ON_FIRST_USE, false);
}

View file

@ -0,0 +1,208 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.api.AccountCheckException;
import org.asamk.signal.manager.api.NotRegisteredException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.ServiceEnvironment;
import org.asamk.signal.manager.config.ServiceConfig;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
import org.asamk.signal.manager.internal.AccountFileUpdaterImpl;
import org.asamk.signal.manager.internal.ManagerImpl;
import org.asamk.signal.manager.internal.MultiAccountManagerImpl;
import org.asamk.signal.manager.internal.PathConfig;
import org.asamk.signal.manager.internal.ProvisioningManagerImpl;
import org.asamk.signal.manager.internal.RegistrationManagerImpl;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.accounts.AccountsStore;
import org.asamk.signal.manager.util.KeyUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
import java.io.File;
import java.io.IOException;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
public class SignalAccountFiles {
private static final Logger logger = LoggerFactory.getLogger(MultiAccountManager.class);
private final PathConfig pathConfig;
private final ServiceEnvironment serviceEnvironment;
private final ServiceEnvironmentConfig serviceEnvironmentConfig;
private final String userAgent;
private final Settings settings;
private final AccountsStore accountsStore;
public SignalAccountFiles(
final File settingsPath,
final ServiceEnvironment serviceEnvironment,
final String userAgent,
final Settings settings
) throws IOException {
this.pathConfig = PathConfig.createDefault(settingsPath);
this.serviceEnvironment = serviceEnvironment;
this.serviceEnvironmentConfig = ServiceConfig.getServiceEnvironmentConfig(this.serviceEnvironment, userAgent);
this.userAgent = userAgent;
this.settings = settings;
this.accountsStore = new AccountsStore(pathConfig.dataPath(), serviceEnvironment, accountPath -> {
if (accountPath == null || !SignalAccount.accountFileExists(pathConfig.dataPath(), accountPath)) {
return null;
}
try {
return SignalAccount.load(pathConfig.dataPath(), accountPath, false, settings);
} catch (Exception e) {
return null;
}
});
}
public Set<String> getAllLocalAccountNumbers() throws IOException {
return accountsStore.getAllNumbers();
}
public MultiAccountManager initMultiAccountManager() throws IOException, AccountCheckException {
final var managerPairs = accountsStore.getAllAccounts().parallelStream().map(a -> {
try {
return new Pair<Manager, Throwable>(initManager(a.number(), a.path()), null);
} catch (NotRegisteredException e) {
logger.warn("Ignoring {}: {} ({})", a.number(), e.getMessage(), e.getClass().getSimpleName());
return null;
} catch (AccountCheckException | IOException e) {
logger.error("Failed to load {}: {} ({})", a.number(), e.getMessage(), e.getClass().getSimpleName());
return new Pair<Manager, Throwable>(null, e);
}
}).filter(Objects::nonNull).toList();
for (final var pair : managerPairs) {
if (pair.second() instanceof IOException e) {
throw e;
} else if (pair.second() instanceof AccountCheckException e) {
throw e;
}
}
final var managers = managerPairs.stream().map(Pair::first).toList();
return new MultiAccountManagerImpl(managers, this);
}
public Manager initManager(String number) throws IOException, NotRegisteredException, AccountCheckException {
final var accountPath = accountsStore.getPathByNumber(number);
return this.initManager(number, accountPath);
}
private Manager initManager(
String number,
String accountPath
) throws IOException, NotRegisteredException, AccountCheckException {
if (accountPath == null) {
throw new NotRegisteredException();
}
if (!SignalAccount.accountFileExists(pathConfig.dataPath(), accountPath)) {
throw new NotRegisteredException();
}
var account = SignalAccount.load(pathConfig.dataPath(), accountPath, true, settings);
if (!number.equals(account.getNumber())) {
account.close();
throw new IOException("Number in account file doesn't match expected number: " + account.getNumber());
}
if (!account.isRegistered()) {
account.close();
throw new NotRegisteredException();
}
if (account.getServiceEnvironment() != null && account.getServiceEnvironment() != serviceEnvironment) {
throw new IOException("Account is registered in another environment: " + account.getServiceEnvironment());
}
account.initDatabase();
final var manager = new ManagerImpl(account,
pathConfig,
new AccountFileUpdaterImpl(accountsStore, accountPath),
serviceEnvironmentConfig,
userAgent);
try {
manager.checkAccountState();
} catch (DeprecatedVersionException e) {
manager.close();
throw new AccountCheckException("signal-cli version is too old for the Signal-Server, please update.");
} catch (IOException e) {
manager.close();
throw new AccountCheckException("Error while checking account " + number + ": " + e.getMessage(), e);
}
if (account.getServiceEnvironment() == null) {
account.setServiceEnvironment(serviceEnvironment);
accountsStore.updateAccount(accountPath, account.getNumber(), account.getAci());
}
return manager;
}
public ProvisioningManager initProvisioningManager() {
return initProvisioningManager(null);
}
public ProvisioningManager initProvisioningManager(Consumer<Manager> newManagerListener) {
return new ProvisioningManagerImpl(pathConfig,
serviceEnvironmentConfig,
userAgent,
newManagerListener,
accountsStore);
}
public RegistrationManager initRegistrationManager(String number) throws IOException {
return initRegistrationManager(number, null);
}
public RegistrationManager initRegistrationManager(
String number,
Consumer<Manager> newManagerListener
) throws IOException {
final var accountPath = accountsStore.getPathByNumber(number);
if (accountPath == null || !SignalAccount.accountFileExists(pathConfig.dataPath(), accountPath)) {
final var newAccountPath = accountPath == null ? accountsStore.addAccount(number, null) : accountPath;
var aciIdentityKey = KeyUtils.generateIdentityKeyPair();
var pniIdentityKey = KeyUtils.generateIdentityKeyPair();
var profileKey = KeyUtils.createProfileKey();
var account = SignalAccount.create(pathConfig.dataPath(),
newAccountPath,
number,
serviceEnvironment,
aciIdentityKey,
pniIdentityKey,
profileKey,
settings);
account.initDatabase();
return new RegistrationManagerImpl(account,
pathConfig,
serviceEnvironmentConfig,
userAgent,
newManagerListener,
new AccountFileUpdaterImpl(accountsStore, newAccountPath));
}
var account = SignalAccount.load(pathConfig.dataPath(), accountPath, true, settings);
if (!number.equals(account.getNumber())) {
account.close();
throw new IOException("Number in account file doesn't match expected number: " + account.getNumber());
}
account.initDatabase();
return new RegistrationManagerImpl(account,
pathConfig,
serviceEnvironmentConfig,
userAgent,
newManagerListener,
new AccountFileUpdaterImpl(accountsStore, accountPath));
}
}

View file

@ -0,0 +1,11 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public interface HandleAction {
void execute(Context context) throws Throwable;
default void mergeOther(HandleAction action) {
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class RefreshPreKeysAction implements HandleAction {
private static final RefreshPreKeysAction INSTANCE = new RefreshPreKeysAction();
private RefreshPreKeysAction() {
}
public static RefreshPreKeysAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getPreKeyHelper().refreshPreKeysIfNecessary();
}
}

View file

@ -0,0 +1,39 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.whispersystems.signalservice.api.push.ServiceId;
public class RenewSessionAction implements HandleAction {
private final RecipientId recipientId;
private final ServiceId serviceId;
private final ServiceId accountId;
public RenewSessionAction(final RecipientId recipientId, final ServiceId serviceId, final ServiceId accountId) {
this.recipientId = recipientId;
this.serviceId = serviceId;
this.accountId = accountId;
}
@Override
public void execute(Context context) throws Throwable {
context.getAccount().getAccountData(accountId).getSessionStore().archiveSessions(serviceId);
context.getSendHelper().sendNullMessage(recipientId);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final RenewSessionAction that = (RenewSessionAction) o;
return recipientId.equals(that.recipientId);
}
@Override
public int hashCode() {
return recipientId.hashCode();
}
}

View file

@ -0,0 +1,44 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.sendLog.MessageSendLogEntry;
import java.util.Objects;
public class ResendMessageAction implements HandleAction {
private final RecipientId recipientId;
private final long timestamp;
private final MessageSendLogEntry messageSendLogEntry;
public ResendMessageAction(
final RecipientId recipientId,
final long timestamp,
final MessageSendLogEntry messageSendLogEntry
) {
this.recipientId = recipientId;
this.timestamp = timestamp;
this.messageSendLogEntry = messageSendLogEntry;
}
@Override
public void execute(Context context) throws Throwable {
context.getSendHelper().resendMessage(recipientId, timestamp, messageSendLogEntry);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final ResendMessageAction that = (ResendMessageAction) o;
return timestamp == that.timestamp
&& recipientId.equals(that.recipientId)
&& messageSendLogEntry.equals(that.messageSendLogEntry);
}
@Override
public int hashCode() {
return Objects.hash(recipientId, timestamp, messageSendLogEntry);
}
}

View file

@ -0,0 +1,33 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
public class RetrieveProfileAction implements HandleAction {
private final RecipientId recipientId;
public RetrieveProfileAction(final RecipientId recipientId) {
this.recipientId = recipientId;
}
@Override
public void execute(Context context) throws Throwable {
context.getProfileHelper().refreshRecipientProfile(recipientId);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final RetrieveProfileAction that = (RetrieveProfileAction) o;
return recipientId.equals(that.recipientId);
}
@Override
public int hashCode() {
return recipientId.hashCode();
}
}

View file

@ -0,0 +1,39 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.api.GroupIdV1;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
public class SendGroupInfoAction implements HandleAction {
private final RecipientId recipientId;
private final GroupIdV1 groupId;
public SendGroupInfoAction(final RecipientId recipientId, final GroupIdV1 groupId) {
this.recipientId = recipientId;
this.groupId = groupId;
}
@Override
public void execute(Context context) throws Throwable {
context.getGroupHelper().sendGroupInfoMessage(groupId, recipientId);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final var that = (SendGroupInfoAction) o;
if (!recipientId.equals(that.recipientId)) return false;
return groupId.equals(that.groupId);
}
@Override
public int hashCode() {
var result = recipientId.hashCode();
result = 31 * result + groupId.hashCode();
return result;
}
}

View file

@ -0,0 +1,39 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.api.GroupIdV1;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
public class SendGroupInfoRequestAction implements HandleAction {
private final RecipientId recipientId;
private final GroupIdV1 groupId;
public SendGroupInfoRequestAction(final RecipientId recipientId, final GroupIdV1 groupId) {
this.recipientId = recipientId;
this.groupId = groupId;
}
@Override
public void execute(Context context) throws Throwable {
context.getGroupHelper().sendGroupInfoRequest(groupId, recipientId);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final var that = (SendGroupInfoRequestAction) o;
if (!recipientId.equals(that.recipientId)) return false;
return groupId.equals(that.groupId);
}
@Override
public int hashCode() {
var result = recipientId.hashCode();
result = 31 * result + groupId.hashCode();
return result;
}
}

View file

@ -0,0 +1,33 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import java.util.Objects;
public class SendProfileKeyAction implements HandleAction {
private final RecipientId recipientId;
public SendProfileKeyAction(final RecipientId recipientId) {
this.recipientId = recipientId;
}
@Override
public void execute(Context context) throws Throwable {
context.getSendHelper().sendProfileKey(recipientId);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final SendProfileKeyAction that = (SendProfileKeyAction) o;
return recipientId.equals(that.recipientId);
}
@Override
public int hashCode() {
return Objects.hash(recipientId);
}
}

View file

@ -0,0 +1,55 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class SendReceiptAction implements HandleAction {
private final RecipientId recipientId;
private final SignalServiceReceiptMessage.Type type;
private final List<Long> timestamps = new ArrayList<>();
public SendReceiptAction(
final RecipientId recipientId,
final SignalServiceReceiptMessage.Type type,
final long timestamp
) {
this.recipientId = recipientId;
this.type = type;
this.timestamps.add(timestamp);
}
@Override
public void execute(Context context) throws Throwable {
final var receiptMessage = new SignalServiceReceiptMessage(type, timestamps, System.currentTimeMillis());
context.getSendHelper().sendReceiptMessage(receiptMessage, recipientId);
}
@Override
public void mergeOther(final HandleAction action) {
if (action instanceof SendReceiptAction sendReceiptAction) {
this.timestamps.addAll(sendReceiptAction.timestamps);
}
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final SendReceiptAction that = (SendReceiptAction) o;
// Using only recipientId and type here on purpose
return recipientId.equals(that.recipientId) && type == that.type;
}
@Override
public int hashCode() {
// Using only recipientId and type here on purpose
return Objects.hash(recipientId, type);
}
}

View file

@ -0,0 +1,89 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.metadata.ProtocolException;
import org.signal.libsignal.protocol.message.CiphertextMessage;
import org.signal.libsignal.protocol.message.DecryptionErrorMessage;
import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope;
import org.whispersystems.signalservice.internal.push.Envelope;
import java.util.Optional;
public class SendRetryMessageRequestAction implements HandleAction {
private final RecipientId recipientId;
private final ProtocolException protocolException;
private final SignalServiceEnvelope envelope;
public SendRetryMessageRequestAction(
final RecipientId recipientId,
final ProtocolException protocolException,
final SignalServiceEnvelope envelope
) {
this.recipientId = recipientId;
this.protocolException = protocolException;
this.envelope = envelope;
}
@Override
public void execute(Context context) throws Throwable {
int senderDevice = protocolException.getSenderDevice();
Optional<GroupId> groupId = protocolException.getGroupId().isPresent() ? Optional.of(GroupId.unknownVersion(
protocolException.getGroupId().get())) : Optional.empty();
byte[] originalContent;
int envelopeType;
if (protocolException.getUnidentifiedSenderMessageContent().isPresent()) {
final var messageContent = protocolException.getUnidentifiedSenderMessageContent().get();
originalContent = messageContent.getContent();
envelopeType = messageContent.getType();
} else {
originalContent = envelope.getContent();
envelopeType = envelope.getType() == null
? CiphertextMessage.WHISPER_TYPE
: envelopeTypeToCiphertextMessageType(envelope.getType());
}
DecryptionErrorMessage decryptionErrorMessage = DecryptionErrorMessage.forOriginalMessage(originalContent,
envelopeType,
envelope.getTimestamp(),
senderDevice);
context.getSendHelper().sendRetryReceipt(decryptionErrorMessage, recipientId, groupId);
}
private static int envelopeTypeToCiphertextMessageType(int envelopeType) {
final var type = Envelope.Type.fromValue(envelopeType);
if (type == null) {
return CiphertextMessage.WHISPER_TYPE;
}
return switch (type) {
case PREKEY_BUNDLE -> CiphertextMessage.PREKEY_TYPE;
case UNIDENTIFIED_SENDER -> CiphertextMessage.SENDERKEY_TYPE;
case PLAINTEXT_CONTENT -> CiphertextMessage.PLAINTEXT_CONTENT_TYPE;
default -> CiphertextMessage.WHISPER_TYPE;
};
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final SendRetryMessageRequestAction that = (SendRetryMessageRequestAction) o;
if (!recipientId.equals(that.recipientId)) return false;
if (!protocolException.equals(that.protocolException)) return false;
return envelope.equals(that.envelope);
}
@Override
public int hashCode() {
int result = recipientId.hashCode();
result = 31 * result + protocolException.hashCode();
result = 31 * result + envelope.hashCode();
return result;
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class SendSyncBlockedListAction implements HandleAction {
private static final SendSyncBlockedListAction INSTANCE = new SendSyncBlockedListAction();
private SendSyncBlockedListAction() {
}
public static SendSyncBlockedListAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getSyncHelper().sendBlockedList();
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class SendSyncConfigurationAction implements HandleAction {
private static final SendSyncConfigurationAction INSTANCE = new SendSyncConfigurationAction();
private SendSyncConfigurationAction() {
}
public static SendSyncConfigurationAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getSyncHelper().sendConfigurationMessage();
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class SendSyncContactsAction implements HandleAction {
private static final SendSyncContactsAction INSTANCE = new SendSyncContactsAction();
private SendSyncContactsAction() {
}
public static SendSyncContactsAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getSyncHelper().sendContacts();
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class SendSyncGroupsAction implements HandleAction {
private static final SendSyncGroupsAction INSTANCE = new SendSyncGroupsAction();
private SendSyncGroupsAction() {
}
public static SendSyncGroupsAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getSyncHelper().sendGroups();
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class SendSyncKeysAction implements HandleAction {
private static final SendSyncKeysAction INSTANCE = new SendSyncKeysAction();
private SendSyncKeysAction() {
}
public static SendSyncKeysAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getSyncHelper().sendKeysMessage();
}
}

View file

@ -0,0 +1,21 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.jobs.SyncStorageJob;
public class SyncStorageDataAction implements HandleAction {
private static final SyncStorageDataAction INSTANCE = new SyncStorageDataAction();
private SyncStorageDataAction() {
}
public static SyncStorageDataAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getJobExecutor().enqueueJob(new SyncStorageJob());
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.actions;
import org.asamk.signal.manager.helper.Context;
public class UpdateAccountAttributesAction implements HandleAction {
private static final UpdateAccountAttributesAction INSTANCE = new UpdateAccountAttributesAction();
private UpdateAccountAttributesAction() {
}
public static UpdateAccountAttributesAction create() {
return INSTANCE;
}
@Override
public void execute(Context context) throws Throwable {
context.getAccountHelper().updateAccountAttributes();
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class AccountCheckException extends Exception {
public AccountCheckException(String message) {
super(message);
}
public AccountCheckException(String message, Exception e) {
super(message, e);
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class AlreadyReceivingException extends Exception {
public AlreadyReceivingException(String message) {
super(message);
}
public AlreadyReceivingException(String message, Exception e) {
super(message, e);
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class AttachmentInvalidException extends Exception {
public AttachmentInvalidException(String message) {
super(message);
}
public AttachmentInvalidException(String attachment, Exception e) {
super(attachment + ": " + e.getMessage());
}
}

View file

@ -0,0 +1,16 @@
package org.asamk.signal.manager.api;
public class CaptchaRejectedException extends Exception {
public CaptchaRejectedException() {
super("Captcha rejected");
}
public CaptchaRejectedException(final String message) {
super(message);
}
public CaptchaRejectedException(final String message, final Throwable cause) {
super(message, cause);
}
}

View file

@ -0,0 +1,23 @@
package org.asamk.signal.manager.api;
public class CaptchaRequiredException extends Exception {
private long nextAttemptTimestamp;
public CaptchaRequiredException(final long nextAttemptTimestamp) {
super("Captcha required");
this.nextAttemptTimestamp = nextAttemptTimestamp;
}
public CaptchaRequiredException(final String message) {
super(message);
}
public CaptchaRequiredException(final String message, final Throwable cause) {
super(message, cause);
}
public long getNextAttemptTimestamp() {
return nextAttemptTimestamp;
}
}

View file

@ -0,0 +1,24 @@
package org.asamk.signal.manager.api;
public record Color(int color) {
public int alpha() {
return color >>> 24;
}
public int red() {
return (color >> 16) & 0xFF;
}
public int green() {
return (color >> 8) & 0xFF;
}
public int blue() {
return color & 0xFF;
}
public String toHexColor() {
return String.format("#%08x", color);
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.api;
import org.asamk.signal.manager.storage.configuration.ConfigurationStore;
import java.util.Optional;
public record Configuration(
Optional<Boolean> readReceipts,
Optional<Boolean> unidentifiedDeliveryIndicators,
Optional<Boolean> typingIndicators,
Optional<Boolean> linkPreviews
) {
public static Configuration from(final ConfigurationStore configurationStore) {
return new Configuration(Optional.ofNullable(configurationStore.getReadReceipts()),
Optional.ofNullable(configurationStore.getUnidentifiedDeliveryIndicators()),
Optional.ofNullable(configurationStore.getTypingIndicators()),
Optional.ofNullable(configurationStore.getLinkPreviews()));
}
}

View file

@ -0,0 +1,193 @@
package org.asamk.signal.manager.api;
import org.whispersystems.signalservice.internal.util.Util;
public record Contact(
String givenName,
String familyName,
String nickName,
String nickNameGivenName,
String nickNameFamilyName,
String note,
String color,
int messageExpirationTime,
int messageExpirationTimeVersion,
long muteUntil,
boolean hideStory,
boolean isBlocked,
boolean isArchived,
boolean isProfileSharingEnabled,
boolean isHidden,
Long unregisteredTimestamp
) {
private Contact(final Builder builder) {
this(builder.givenName,
builder.familyName,
builder.nickName,
builder.nickNameGivenName,
builder.nickNameFamilyName,
builder.note,
builder.color,
builder.messageExpirationTime,
builder.messageExpirationTimeVersion,
builder.muteUntil,
builder.hideStory,
builder.isBlocked,
builder.isArchived,
builder.isProfileSharingEnabled,
builder.isHidden,
builder.unregisteredTimestamp);
}
public static Builder newBuilder() {
return new Builder();
}
public static Builder newBuilder(final Contact copy) {
Builder builder = new Builder();
builder.givenName = copy.givenName();
builder.familyName = copy.familyName();
builder.nickName = copy.nickName();
builder.nickNameGivenName = copy.nickNameGivenName();
builder.nickNameFamilyName = copy.nickNameFamilyName();
builder.note = copy.note();
builder.color = copy.color();
builder.messageExpirationTime = copy.messageExpirationTime();
builder.messageExpirationTimeVersion = copy.messageExpirationTimeVersion();
builder.muteUntil = copy.muteUntil();
builder.hideStory = copy.hideStory();
builder.isBlocked = copy.isBlocked();
builder.isArchived = copy.isArchived();
builder.isProfileSharingEnabled = copy.isProfileSharingEnabled();
builder.isHidden = copy.isHidden();
builder.unregisteredTimestamp = copy.unregisteredTimestamp();
return builder;
}
public String getName() {
final var noGivenName = Util.isEmpty(givenName);
final var noFamilyName = Util.isEmpty(familyName);
if (noGivenName && noFamilyName) {
return "";
} else if (noGivenName) {
return familyName;
} else if (noFamilyName) {
return givenName;
}
return givenName + " " + familyName;
}
public static final class Builder {
private String givenName;
private String familyName;
private String nickName;
private String nickNameGivenName;
private String nickNameFamilyName;
private String note;
private String color;
private int messageExpirationTime;
private int messageExpirationTimeVersion = 1;
private long muteUntil;
private boolean hideStory;
private boolean isBlocked;
private boolean isArchived;
private boolean isProfileSharingEnabled;
private boolean isHidden;
private Long unregisteredTimestamp;
private Builder() {
}
public static Builder newBuilder() {
return new Builder();
}
public Builder withGivenName(final String val) {
givenName = val;
return this;
}
public Builder withFamilyName(final String val) {
familyName = val;
return this;
}
public Builder withNickName(final String val) {
nickName = val;
return this;
}
public Builder withNickNameGivenName(final String val) {
nickNameGivenName = val;
return this;
}
public Builder withNickNameFamilyName(final String val) {
nickNameFamilyName = val;
return this;
}
public Builder withNote(final String val) {
note = val;
return this;
}
public Builder withColor(final String val) {
color = val;
return this;
}
public Builder withMessageExpirationTime(final int val) {
messageExpirationTime = val;
return this;
}
public Builder withMessageExpirationTimeVersion(final int val) {
messageExpirationTimeVersion = val;
return this;
}
public Builder withMuteUntil(final long val) {
muteUntil = val;
return this;
}
public Builder withHideStory(final boolean val) {
hideStory = val;
return this;
}
public Builder withIsBlocked(final boolean val) {
isBlocked = val;
return this;
}
public Builder withIsArchived(final boolean val) {
isArchived = val;
return this;
}
public Builder withIsProfileSharingEnabled(final boolean val) {
isProfileSharingEnabled = val;
return this;
}
public Builder withIsHidden(final boolean val) {
isHidden = val;
return this;
}
public Builder withUnregisteredTimestamp(final Long val) {
unregisteredTimestamp = val;
return this;
}
public Contact build() {
return new Contact(this);
}
}
}

View file

@ -0,0 +1,3 @@
package org.asamk.signal.manager.api;
public record Device(int id, String name, long created, long lastSeen, boolean isThisDevice) {}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class DeviceLimitExceededException extends Exception {
public DeviceLimitExceededException(final String message) {
super(message);
}
public DeviceLimitExceededException(final String message, final Throwable cause) {
super(message, cause);
}
}

View file

@ -0,0 +1,58 @@
package org.asamk.signal.manager.api;
import org.asamk.signal.manager.util.Utils;
import org.signal.libsignal.protocol.InvalidKeyException;
import org.signal.libsignal.protocol.ecc.ECPublicKey;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import static org.whispersystems.signalservice.internal.util.Util.isEmpty;
public record DeviceLinkUrl(String deviceIdentifier, ECPublicKey deviceKey) {
public static DeviceLinkUrl parseDeviceLinkUri(URI linkUri) throws InvalidDeviceLinkException {
final var rawQuery = linkUri.getRawQuery();
if (isEmpty(rawQuery)) {
throw new RuntimeException("Invalid device link uri");
}
var query = Utils.getQueryMap(rawQuery);
var deviceIdentifier = query.get("uuid");
var publicKeyEncoded = query.get("pub_key");
if (isEmpty(deviceIdentifier) || isEmpty(publicKeyEncoded)) {
throw new InvalidDeviceLinkException("Invalid device link uri");
}
final byte[] publicKeyBytes;
try {
publicKeyBytes = Base64.getDecoder().decode(publicKeyEncoded);
} catch (IllegalArgumentException e) {
throw new InvalidDeviceLinkException("Invalid device link uri", e);
}
ECPublicKey deviceKey;
try {
deviceKey = new ECPublicKey(publicKeyBytes);
} catch (InvalidKeyException e) {
throw new InvalidDeviceLinkException("Invalid device link", e);
}
return new DeviceLinkUrl(deviceIdentifier, deviceKey);
}
public URI createDeviceLinkUri() {
final var deviceKeyString = Base64.getEncoder().encodeToString(deviceKey.serialize()).replace("=", "");
try {
return new URI("sgnl://linkdevice?uuid="
+ URLEncoder.encode(deviceIdentifier, StandardCharsets.UTF_8)
+ "&pub_key="
+ URLEncoder.encode(deviceKeyString, StandardCharsets.UTF_8));
} catch (URISyntaxException e) {
throw new AssertionError(e);
}
}
}

View file

@ -0,0 +1,71 @@
package org.asamk.signal.manager.api;
import org.asamk.signal.manager.helper.RecipientAddressResolver;
import org.asamk.signal.manager.storage.groups.GroupInfo;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import java.util.Set;
import java.util.stream.Collectors;
public record Group(
GroupId groupId,
String title,
String description,
GroupInviteLinkUrl groupInviteLinkUrl,
Set<RecipientAddress> members,
Set<RecipientAddress> pendingMembers,
Set<RecipientAddress> requestingMembers,
Set<RecipientAddress> adminMembers,
Set<RecipientAddress> bannedMembers,
boolean isBlocked,
int messageExpirationTimer,
GroupPermission permissionAddMember,
GroupPermission permissionEditDetails,
GroupPermission permissionSendMessage,
boolean isMember,
boolean isAdmin
) {
public static Group from(
final GroupInfo groupInfo,
final RecipientAddressResolver recipientStore,
final RecipientId selfRecipientId
) {
return new Group(groupInfo.getGroupId(),
groupInfo.getTitle(),
groupInfo.getDescription(),
groupInfo.getGroupInviteLink(),
groupInfo.getMembers()
.stream()
.map(recipientStore::resolveRecipientAddress)
.map(org.asamk.signal.manager.storage.recipients.RecipientAddress::toApiRecipientAddress)
.collect(Collectors.toSet()),
groupInfo.getPendingMembers()
.stream()
.map(recipientStore::resolveRecipientAddress)
.map(org.asamk.signal.manager.storage.recipients.RecipientAddress::toApiRecipientAddress)
.collect(Collectors.toSet()),
groupInfo.getRequestingMembers()
.stream()
.map(recipientStore::resolveRecipientAddress)
.map(org.asamk.signal.manager.storage.recipients.RecipientAddress::toApiRecipientAddress)
.collect(Collectors.toSet()),
groupInfo.getAdminMembers()
.stream()
.map(recipientStore::resolveRecipientAddress)
.map(org.asamk.signal.manager.storage.recipients.RecipientAddress::toApiRecipientAddress)
.collect(Collectors.toSet()),
groupInfo.getBannedMembers()
.stream()
.map(recipientStore::resolveRecipientAddress)
.map(org.asamk.signal.manager.storage.recipients.RecipientAddress::toApiRecipientAddress)
.collect(Collectors.toSet()),
groupInfo.isBlocked(),
groupInfo.getMessageExpirationTimer(),
groupInfo.getPermissionAddMember(),
groupInfo.getPermissionEditDetails(),
groupInfo.getPermissionSendMessage(),
groupInfo.isMember(selfRecipientId),
groupInfo.isAdmin(selfRecipientId));
}
}

View file

@ -0,0 +1,62 @@
package org.asamk.signal.manager.api;
import java.util.Arrays;
import java.util.Base64;
public abstract sealed class GroupId permits GroupIdV1, GroupIdV2 {
private final byte[] id;
public static GroupIdV1 v1(byte[] id) {
return new GroupIdV1(id);
}
public static GroupIdV2 v2(byte[] id) {
return new GroupIdV2(id);
}
public static GroupId unknownVersion(byte[] id) {
if (id.length == 16) {
return new GroupIdV1(id);
} else if (id.length == 32) {
return new GroupIdV2(id);
}
throw new AssertionError("Invalid group id of size " + id.length);
}
public static GroupId fromBase64(String id) throws GroupIdFormatException {
try {
return unknownVersion(java.util.Base64.getDecoder().decode(id));
} catch (Throwable e) {
throw new GroupIdFormatException(id, e);
}
}
protected GroupId(final byte[] id) {
this.id = id;
}
public byte[] serialize() {
return id;
}
public String toBase64() {
return Base64.getEncoder().encodeToString(id);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final var groupId = (GroupId) o;
return Arrays.equals(id, groupId.id);
}
@Override
public int hashCode() {
return Arrays.hashCode(id);
}
}

View file

@ -0,0 +1,8 @@
package org.asamk.signal.manager.api;
public class GroupIdFormatException extends Exception {
public GroupIdFormatException(String groupId, Throwable e) {
super("Failed to decode groupId (must be base64) \"" + groupId + "\": " + e.getMessage(), e);
}
}

View file

@ -0,0 +1,20 @@
package org.asamk.signal.manager.api;
import java.util.Base64;
import static org.asamk.signal.manager.util.KeyUtils.getSecretBytes;
public final class GroupIdV1 extends GroupId {
public static GroupIdV1 createRandom() {
return new GroupIdV1(getSecretBytes(16));
}
public static GroupIdV1 fromBase64(String groupId) {
return new GroupIdV1(Base64.getDecoder().decode(groupId));
}
public GroupIdV1(final byte[] id) {
super(id);
}
}

View file

@ -0,0 +1,14 @@
package org.asamk.signal.manager.api;
import java.util.Base64;
public final class GroupIdV2 extends GroupId {
public static GroupIdV2 fromBase64(String groupId) {
return new GroupIdV2(Base64.getDecoder().decode(groupId));
}
public GroupIdV2(final byte[] id) {
super(id);
}
}

View file

@ -0,0 +1,132 @@
package org.asamk.signal.manager.api;
import org.asamk.signal.manager.groups.GroupLinkPassword;
import org.signal.core.util.Base64;
import org.signal.libsignal.zkgroup.InvalidInputException;
import org.signal.libsignal.zkgroup.groups.GroupMasterKey;
import org.signal.storageservice.protos.groups.GroupInviteLink;
import org.signal.storageservice.protos.groups.local.DecryptedGroup;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import okio.ByteString;
public final class GroupInviteLinkUrl {
private static final String GROUP_URL_HOST = "signal.group";
private static final String GROUP_URL_PREFIX = "https://" + GROUP_URL_HOST + "/#";
private final GroupMasterKey groupMasterKey;
private final GroupLinkPassword password;
private final String url;
public static GroupInviteLinkUrl forGroup(GroupMasterKey groupMasterKey, DecryptedGroup group) {
return new GroupInviteLinkUrl(groupMasterKey,
GroupLinkPassword.fromBytes(group.inviteLinkPassword.toByteArray()));
}
/**
* @return null iff not a group url.
* @throws InvalidGroupLinkException If group url, but cannot be parsed.
*/
public static GroupInviteLinkUrl fromUri(String urlString) throws InvalidGroupLinkException, UnknownGroupLinkVersionException {
var uri = getGroupUrl(urlString);
if (uri == null) {
return null;
}
try {
if (!"/".equals(uri.getPath()) && !uri.getPath().isEmpty()) {
throw new InvalidGroupLinkException("No path was expected in uri");
}
var encoding = uri.getFragment();
if (encoding == null || encoding.isEmpty()) {
throw new InvalidGroupLinkException("No reference was in the uri");
}
var bytes = Base64.decode(encoding);
GroupInviteLink groupInviteLink = GroupInviteLink.ADAPTER.decode(bytes);
if (groupInviteLink.v1Contents != null) {
var groupInviteLinkContentsV1 = groupInviteLink.v1Contents;
var groupMasterKey = new GroupMasterKey(groupInviteLinkContentsV1.groupMasterKey.toByteArray());
var password = GroupLinkPassword.fromBytes(groupInviteLinkContentsV1.inviteLinkPassword.toByteArray());
return new GroupInviteLinkUrl(groupMasterKey, password);
} else {
throw new UnknownGroupLinkVersionException("Url contains no known group link content");
}
} catch (InvalidInputException | IOException e) {
throw new InvalidGroupLinkException(e);
}
}
/**
* @return {@link URI} if the host name matches.
*/
private static URI getGroupUrl(String urlString) {
try {
var url = new URI(urlString);
if (!"https".equalsIgnoreCase(url.getScheme()) && !"sgnl".equalsIgnoreCase(url.getScheme())) {
return null;
}
return GROUP_URL_HOST.equalsIgnoreCase(url.getHost()) ? url : null;
} catch (URISyntaxException e) {
return null;
}
}
private GroupInviteLinkUrl(GroupMasterKey groupMasterKey, GroupLinkPassword password) {
this.groupMasterKey = groupMasterKey;
this.password = password;
this.url = createUrl(groupMasterKey, password);
}
private static String createUrl(GroupMasterKey groupMasterKey, GroupLinkPassword password) {
var groupInviteLink = new GroupInviteLink.Builder().v1Contents(new GroupInviteLink.GroupInviteLinkContentsV1.Builder().groupMasterKey(
ByteString.of(groupMasterKey.serialize()))
.inviteLinkPassword(ByteString.of(password.serialize()))
.build()).build();
var encoding = Base64.encodeUrlSafeWithoutPadding(groupInviteLink.encode());
return GROUP_URL_PREFIX + encoding;
}
public String getUrl() {
return url;
}
public GroupMasterKey getGroupMasterKey() {
return groupMasterKey;
}
public GroupLinkPassword getPassword() {
return password;
}
public static final class InvalidGroupLinkException extends Exception {
public InvalidGroupLinkException(String message) {
super(message);
}
public InvalidGroupLinkException(Throwable cause) {
super(cause);
}
}
public static final class UnknownGroupLinkVersionException extends Exception {
public UnknownGroupLinkVersionException(String message) {
super(message);
}
}
}

View file

@ -0,0 +1,7 @@
package org.asamk.signal.manager.api;
public enum GroupLinkState {
ENABLED,
ENABLED_WITH_APPROVAL,
DISABLED,
}

View file

@ -0,0 +1,8 @@
package org.asamk.signal.manager.api;
public class GroupNotFoundException extends Exception {
public GroupNotFoundException(GroupId groupId) {
super("Group not found: " + groupId.toBase64());
}
}

View file

@ -0,0 +1,6 @@
package org.asamk.signal.manager.api;
public enum GroupPermission {
EVERY_MEMBER,
ONLY_ADMINS,
}

View file

@ -0,0 +1,8 @@
package org.asamk.signal.manager.api;
public class GroupSendingNotAllowedException extends Exception {
public GroupSendingNotAllowedException(GroupId groupId, String groupName) {
super("User is not allowed to send message to group: " + groupName + " (" + groupId.toBase64() + ")");
}
}

View file

@ -0,0 +1,10 @@
package org.asamk.signal.manager.api;
public record Identity(
RecipientAddress recipient,
byte[] fingerprint,
String safetyNumber,
byte[] scannableSafetyNumber,
TrustLevel trustLevel,
long dateAddedTimestamp
) {}

View file

@ -0,0 +1,28 @@
package org.asamk.signal.manager.api;
import org.signal.libsignal.protocol.util.Hex;
import java.util.Base64;
import java.util.Locale;
public sealed interface IdentityVerificationCode {
record Fingerprint(byte[] fingerprint) implements IdentityVerificationCode {}
record SafetyNumber(String safetyNumber) implements IdentityVerificationCode {}
record ScannableSafetyNumber(byte[] safetyNumber) implements IdentityVerificationCode {}
static IdentityVerificationCode parse(String code) throws Exception {
code = code.replaceAll(" ", "");
if (code.length() == 66) {
final var fingerprintBytes = Hex.fromStringCondensed(code.toLowerCase(Locale.ROOT));
return new Fingerprint(fingerprintBytes);
} else if (code.length() == 60) {
return new SafetyNumber(code);
} else {
final var scannableSafetyNumber = Base64.getDecoder().decode(code);
return new ScannableSafetyNumber(scannableSafetyNumber);
}
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class InactiveGroupLinkException extends Exception {
public InactiveGroupLinkException(final String message) {
super(message);
}
public InactiveGroupLinkException(final String message, final Throwable cause) {
super(message, cause);
}
}

View file

@ -0,0 +1,14 @@
package org.asamk.signal.manager.api;
public class IncorrectPinException extends Exception {
private final int triesRemaining;
public IncorrectPinException(int triesRemaining) {
this.triesRemaining = triesRemaining;
}
public int getTriesRemaining() {
return triesRemaining;
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class InvalidDeviceLinkException extends Exception {
public InvalidDeviceLinkException(final String message) {
super(message);
}
public InvalidDeviceLinkException(final String message, final Throwable cause) {
super(message, cause);
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class InvalidNumberException extends Exception {
public InvalidNumberException(String message) {
super(message);
}
InvalidNumberException(String message, Throwable e) {
super(message, e);
}
}

View file

@ -0,0 +1,12 @@
package org.asamk.signal.manager.api;
public class InvalidStickerException extends Exception {
public InvalidStickerException(final String message) {
super(message);
}
public InvalidStickerException(final String message, final Throwable cause) {
super(message, cause);
}
}

Some files were not shown because too many files have changed in this diff Show more