Skip to content

Commit

Permalink
Update libsignal-service
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Aug 20, 2024
1 parent 130cee9 commit cb129db
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 35 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

Requires libsignal-client version 0.52.5

### Fixed

- Fix issue with sending to some groups

## [0.13.5] - 2024-07-25

Requires libsignal-client version 0.52.2
Expand Down
7 changes: 4 additions & 3 deletions graalvm-config-dir/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@
"allDeclaredMethods":true
},
{
"name":"java.lang.Object"
"name":"java.lang.Object",
"methods":[{"name":"equals","parameterTypes":["java.lang.Object"] }, {"name":"hashCode","parameterTypes":[] }, {"name":"toString","parameterTypes":[] }]
},
{
"name":"java.lang.Record",
Expand Down Expand Up @@ -2236,7 +2237,7 @@
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"methods":[{"name":"<init>","parameterTypes":["org.signal.libsignal.protocol.ServiceId"] }]
"methods":[{"name":"<init>","parameterTypes":["org.signal.libsignal.protocol.ServiceId"] }, {"name":"equals","parameterTypes":["java.lang.Object"] }, {"name":"hashCode","parameterTypes":[] }, {"name":"logString","parameterTypes":[] }, {"name":"toByteArray","parameterTypes":[] }, {"name":"toByteString","parameterTypes":[] }, {"name":"toProtocolAddress","parameterTypes":["int"] }, {"name":"toString","parameterTypes":[] }]
},
{
"name":"org.whispersystems.signalservice.api.push.ServiceId$ACI"
Expand All @@ -2246,7 +2247,7 @@
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"methods":[{"name":"fromLibSignal","parameterTypes":["org.signal.libsignal.protocol.ServiceId"] }, {"name":"parseOrNull","parameterTypes":["java.lang.String"] }, {"name":"parseOrNull","parameterTypes":["okio.ByteString"] }, {"name":"parseOrNull","parameterTypes":["byte[]"] }, {"name":"parseOrThrow","parameterTypes":["java.lang.String"] }, {"name":"parseOrThrow","parameterTypes":["okio.ByteString"] }, {"name":"parseOrThrow","parameterTypes":["byte[]"] }]
"methods":[{"name":"equals","parameterTypes":["java.lang.Object"] }, {"name":"fromLibSignal","parameterTypes":["org.signal.libsignal.protocol.ServiceId"] }, {"name":"hashCode","parameterTypes":[] }, {"name":"parseOrNull","parameterTypes":["java.lang.String"] }, {"name":"parseOrNull","parameterTypes":["java.lang.String","boolean"] }, {"name":"parseOrNull","parameterTypes":["okio.ByteString"] }, {"name":"parseOrNull","parameterTypes":["byte[]"] }, {"name":"parseOrThrow","parameterTypes":["java.lang.String"] }, {"name":"parseOrThrow","parameterTypes":["okio.ByteString"] }, {"name":"parseOrThrow","parameterTypes":["byte[]"] }, {"name":"toString","parameterTypes":[] }]
},
{
"name":"org.whispersystems.signalservice.api.push.ServiceId$PNI"
Expand Down
46 changes: 16 additions & 30 deletions lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,15 @@ public SendMessageResult sendSyncMessage(SignalServiceSyncMessage message) {
}
try {
return messageSender.sendSyncMessage(message);
} catch (UnregisteredUserException e) {
} catch (Throwable e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
return SendMessageResult.unregisteredFailure(address);
} catch (ProofRequiredException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
return SendMessageResult.proofRequiredFailure(address, e);
} catch (RateLimitException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage());
return SendMessageResult.rateLimitFailure(address, e);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
return SendMessageResult.identityFailure(address, e.getIdentityKey());
} catch (IOException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
logger.warn("Failed to send message due to IO exception: {}", e.getMessage());
logger.debug("Exception", e);
return SendMessageResult.networkFailure(address);
try {
return SignalServiceMessageSender.mapSendErrorToSendResult(e, System.currentTimeMillis(), address);
} catch (IOException ex) {
logger.warn("Failed to send message due to IO exception: {}", e.getMessage());
logger.debug("Exception", e);
return SendMessageResult.networkFailure(address);
}
}
}

Expand Down Expand Up @@ -704,19 +695,14 @@ private SendMessageResult handleSendMessage(RecipientId recipientId, SenderHandl
context.getUnidentifiedAccessHelper().getSealedSenderAccessFor(newRecipientId),
includePniSignature);
}
} catch (UnregisteredUserException e) {
return SendMessageResult.unregisteredFailure(address);
} catch (ProofRequiredException e) {
return SendMessageResult.proofRequiredFailure(address, e);
} catch (RateLimitException e) {
logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage());
return SendMessageResult.rateLimitFailure(address, e);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
return SendMessageResult.identityFailure(address, e.getIdentityKey());
} catch (IOException e) {
logger.warn("Failed to send message due to IO exception: {}", e.getMessage());
logger.debug("Exception", e);
return SendMessageResult.networkFailure(address);
} catch (Throwable e) {
try {
return SignalServiceMessageSender.mapSendErrorToSendResult(e, System.currentTimeMillis(), address);
} catch (IOException ex) {
logger.warn("Failed to send message due to IO exception: {}", e.getMessage());
logger.debug("Exception", e);
return SendMessageResult.networkFailure(address);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencyResolutionManagement {
library("slf4j.jul", "org.slf4j", "jul-to-slf4j").versionRef("slf4j")
library("logback", "ch.qos.logback", "logback-classic").version("1.5.6")

library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_105")
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_106")
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.46.0.0")
library("hikari", "com.zaxxer", "HikariCP").version("5.1.0")
library("junit.jupiter", "org.junit.jupiter", "junit-jupiter").version("5.10.2")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/asamk/signal/BaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class BaseConfig {
public static final String PROJECT_VERSION = BaseConfig.class.getPackage().getImplementationVersion();

static final String USER_AGENT_SIGNAL_ANDROID = Optional.ofNullable(System.getenv("SIGNAL_CLI_USER_AGENT"))
.orElse("Signal-Android/7.12.1");
.orElse("Signal-Android/7.14.1");
static final String USER_AGENT_SIGNAL_CLI = PROJECT_NAME == null
? "signal-cli"
: PROJECT_NAME + "/" + PROJECT_VERSION;
Expand Down

0 comments on commit cb129db

Please sign in to comment.