Merge branch 'master' into openapi-docs

This commit is contained in:
Era Dorta 2026-03-28 21:59:15 +01:00
commit dd1d41c798
17 changed files with 219 additions and 27 deletions

View File

@ -1,5 +1,7 @@
# Changelog # Changelog
## [Unreleased]
## [0.14.1] - 2026-03-08 ## [0.14.1] - 2026-03-08
### Added ### Added

View File

@ -10,7 +10,7 @@ If you have a question you can ask it in the [GitHub discussions page](https://g
- Be sure to include a **title and clear description**, as much relevant information as possible. - 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 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. - 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 - Run the failing command with `-vv --scrub-log` flags to get a more detailed log output and include that in the bug report
# Pull request # Pull request

View File

@ -10,7 +10,7 @@ plugins {
allprojects { allprojects {
group = "org.asamk" group = "org.asamk"
version = "0.14.1" version = "0.14.2-SNAPSHOT"
} }
java { java {

4
client/Cargo.lock generated
View File

@ -897,9 +897,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]] [[package]]
name = "rustls-webpki" name = "rustls-webpki"
version = "0.103.9" version = "0.103.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef"
dependencies = [ dependencies = [
"ring", "ring",
"rustls-pki-types", "rustls-pki-types",

View File

@ -18,7 +18,7 @@ slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
logback = "ch.qos.logback:logback-classic:1.5.32" logback = "ch.qos.logback:logback-classic:1.5.32"
signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_140" signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_141"
sqlite = "org.xerial:sqlite-jdbc:3.51.2.0" sqlite = "org.xerial:sqlite-jdbc:3.51.2.0"
hikari = "com.zaxxer:HikariCP:7.0.2" hikari = "com.zaxxer:HikariCP:7.0.2"
junit-jupiter-bom = { module = "org.junit:junit-bom", version.ref = "junit" } junit-jupiter-bom = { module = "org.junit:junit-bom", version.ref = "junit" }

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@ -7,6 +7,7 @@ public record Message(
String messageText, String messageText,
List<String> attachments, List<String> attachments,
boolean viewOnce, boolean viewOnce,
boolean voiceNote,
List<Mention> mentions, List<Mention> mentions,
Optional<Quote> quote, Optional<Quote> quote,
Optional<Sticker> sticker, Optional<Sticker> sticker,

View File

@ -20,6 +20,7 @@ public class ServiceConfig {
public static final int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024; public static final int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
public static final long MAX_ENVELOPE_SIZE = 0; public static final long MAX_ENVELOPE_SIZE = 0;
public static final int MAX_INCREMENTAL_MACS_PER_ENVELOPE = 10;
public static final int MAX_MESSAGE_SIZE_BYTES = 2000; public static final int MAX_MESSAGE_SIZE_BYTES = 2000;
public static final long AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE = 10 * 1024 * 1024; public static final long AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE = 10 * 1024 * 1024;
public static final boolean AUTOMATIC_NETWORK_RETRY = true; public static final boolean AUTOMATIC_NETWORK_RETRY = true;

View File

@ -44,8 +44,8 @@ public class AttachmentHelper {
return attachmentStore.retrieveAttachment(id); return attachmentStore.retrieveAttachment(id);
} }
public List<SignalServiceAttachment> uploadAttachments(final List<String> attachments) throws AttachmentInvalidException, IOException { public List<SignalServiceAttachment> uploadAttachments(final List<String> attachments, boolean voiceNote) throws AttachmentInvalidException, IOException {
final var attachmentStreams = createAttachmentStreams(attachments); final var attachmentStreams = createAttachmentStreams(attachments, voiceNote);
try { try {
// Upload attachments here, so we only upload once even for multiple recipients // Upload attachments here, so we only upload once even for multiple recipients
@ -61,14 +61,18 @@ public class AttachmentHelper {
} }
} }
private List<SignalServiceAttachmentStream> createAttachmentStreams(List<String> attachments) throws AttachmentInvalidException, IOException { public List<SignalServiceAttachment> uploadAttachments(final List<String> attachments) throws AttachmentInvalidException, IOException {
return uploadAttachments(attachments, false);
}
private List<SignalServiceAttachmentStream> createAttachmentStreams(List<String> attachments, boolean voiceNote) throws AttachmentInvalidException, IOException {
if (attachments == null) { if (attachments == null) {
return null; return null;
} }
final var signalServiceAttachments = new ArrayList<SignalServiceAttachmentStream>(attachments.size()); final var signalServiceAttachments = new ArrayList<SignalServiceAttachmentStream>(attachments.size());
for (var attachment : attachments) { for (var attachment : attachments) {
final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec(); final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec();
signalServiceAttachments.add(AttachmentUtils.createAttachmentStream(attachment, uploadSpec)); signalServiceAttachments.add(AttachmentUtils.createAttachmentStream(attachment, voiceNote, uploadSpec));
} }
return signalServiceAttachments; return signalServiceAttachments;
} }

View File

@ -843,7 +843,7 @@ public class ManagerImpl implements Manager {
messageBuilder.withBody(message.messageText()); messageBuilder.withBody(message.messageText());
} }
if (!message.attachments().isEmpty()) { if (!message.attachments().isEmpty()) {
final var uploadedAttachments = context.getAttachmentHelper().uploadAttachments(message.attachments()); final var uploadedAttachments = context.getAttachmentHelper().uploadAttachments(message.attachments(), message.voiceNote());
if (!additionalAttachments.isEmpty()) { if (!additionalAttachments.isEmpty()) {
additionalAttachments.addAll(uploadedAttachments); additionalAttachments.addAll(uploadedAttachments);
messageBuilder.withAttachments(additionalAttachments); messageBuilder.withAttachments(additionalAttachments);

View File

@ -328,6 +328,7 @@ public class SignalDependencies {
Optional.empty(), Optional.empty(),
executor, executor,
ServiceConfig.MAX_ENVELOPE_SIZE, ServiceConfig.MAX_ENVELOPE_SIZE,
ServiceConfig.MAX_INCREMENTAL_MACS_PER_ENVELOPE,
() -> true, () -> true,
true, true,
true)); true));

View File

@ -14,32 +14,49 @@ public class AttachmentUtils {
public static SignalServiceAttachmentStream createAttachmentStream( public static SignalServiceAttachmentStream createAttachmentStream(
String attachment, String attachment,
boolean voiceNote,
ResumableUploadSpec resumableUploadSpec ResumableUploadSpec resumableUploadSpec
) throws AttachmentInvalidException { ) throws AttachmentInvalidException {
try { try {
final var streamDetails = Utils.createStreamDetails(attachment); final var streamDetails = Utils.createStreamDetails(attachment);
return createAttachmentStream(streamDetails.first(), streamDetails.second(), resumableUploadSpec); return createAttachmentStream(streamDetails.first(), streamDetails.second(), voiceNote, resumableUploadSpec);
} catch (IOException e) { } catch (IOException e) {
throw new AttachmentInvalidException(attachment, e); throw new AttachmentInvalidException(attachment, e);
} }
} }
public static SignalServiceAttachmentStream createAttachmentStream(
String attachment,
ResumableUploadSpec resumableUploadSpec
) throws AttachmentInvalidException {
return createAttachmentStream(attachment, false, resumableUploadSpec);
}
public static SignalServiceAttachmentStream createAttachmentStream(
StreamDetails streamDetails,
Optional<String> name,
boolean voiceNote,
ResumableUploadSpec resumableUploadSpec
) throws ResumeLocationInvalidException {
final var uploadTimestamp = System.currentTimeMillis();
return SignalServiceAttachmentStream.newStreamBuilder()
.withStream(streamDetails.getStream())
.withContentType(streamDetails.getContentType())
.withLength(streamDetails.getLength())
.withFileName(name.orElse(null))
.withVoiceNote(voiceNote)
.withUploadTimestamp(uploadTimestamp)
.withResumableUploadSpec(resumableUploadSpec)
.withUuid(UUID.randomUUID())
.build();
}
public static SignalServiceAttachmentStream createAttachmentStream( public static SignalServiceAttachmentStream createAttachmentStream(
StreamDetails streamDetails, StreamDetails streamDetails,
Optional<String> name, Optional<String> name,
ResumableUploadSpec resumableUploadSpec ResumableUploadSpec resumableUploadSpec
) throws ResumeLocationInvalidException { ) throws ResumeLocationInvalidException {
// TODO maybe add a parameter to set the voiceNote, borderless, preview, width, height and caption option return createAttachmentStream(streamDetails, name, false, resumableUploadSpec);
final var uploadTimestamp = System.currentTimeMillis();
return SignalServiceAttachmentStream.newStreamBuilder()
.withStream(streamDetails.getStream())
.withContentType(streamDetails.getContentType())
.withLength(streamDetails.getLength())
.withFileName(name.orElse(null))
.withUploadTimestamp(uploadTimestamp)
.withResumableUploadSpec(resumableUploadSpec)
.withUuid(UUID.randomUUID())
.build();
} }
} }

View File

@ -50,9 +50,9 @@ run() {
if [ "$JSON_RPC" -eq 1 ]; then if [ "$JSON_RPC" -eq 1 ]; then
"$SIGNAL_CLI" $@ "$SIGNAL_CLI" $@
elif [ "$DBUS" -eq 1 ]; then elif [ "$DBUS" -eq 1 ]; then
"$SIGNAL_CLI" --dbus --verbose --verbose $@ | grep -v '^Warning:' | grep -v 'at org' "$SIGNAL_CLI" --dbus --verbose --verbose $@ | grep -v 'Warning:' | grep -v 'at org'
else else
"$SIGNAL_CLI" --service-environment="staging" --verbose --verbose $@ | grep -v '^Warning:' | grep -v 'at org' "$SIGNAL_CLI" --service-environment="staging" --verbose --verbose $@ | grep -v 'Warning:' | grep -v 'at org'
fi fi
set +x set +x
} }

View File

@ -109,6 +109,9 @@ public class SendCommand implements JsonRpcLocalCommand {
.action(Arguments.storeTrue()) .action(Arguments.storeTrue())
.help("Send the message without the urgent flag, so no push notification is triggered for the recipient. " .help("Send the message without the urgent flag, so no push notification is triggered for the recipient. "
+ "The message will still be delivered in real-time if the recipient's app is active."); + "The message will still be delivered in real-time if the recipient's app is active.");
subparser.addArgument("--voice-note")
.action(Arguments.storeTrue())
.help("Mark audio attachments as voice notes. Voice notes are displayed inline in Signal clients.");
} }
@Override @Override
@ -171,6 +174,7 @@ public class SendCommand implements JsonRpcLocalCommand {
attachments = List.of(); attachments = List.of();
} }
final var viewOnce = Boolean.TRUE.equals(ns.getBoolean("view-once")); final var viewOnce = Boolean.TRUE.equals(ns.getBoolean("view-once"));
final var voiceNote = Boolean.TRUE.equals(ns.getBoolean("voice-note"));
final var selfNumber = m.getSelfNumber(); final var selfNumber = m.getSelfNumber();
@ -247,6 +251,7 @@ public class SendCommand implements JsonRpcLocalCommand {
final var message = new Message(messageText, final var message = new Message(messageText,
attachments, attachments,
viewOnce, viewOnce,
voiceNote,
mentions, mentions,
Optional.ofNullable(quote), Optional.ofNullable(quote),
Optional.ofNullable(sticker), Optional.ofNullable(sticker),

View File

@ -238,6 +238,7 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
final var message = new Message(messageText, final var message = new Message(messageText,
attachments, attachments,
false, false,
false,
List.of(), List.of(),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
@ -404,6 +405,7 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
final var message = new Message(messageText, final var message = new Message(messageText,
attachments, attachments,
false, false,
false,
List.of(), List.of(),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
@ -451,6 +453,7 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
final var message = new Message(messageText, final var message = new Message(messageText,
attachments, attachments,
false, false,
false,
List.of(), List.of(),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),

View File

@ -1476,6 +1476,20 @@
} }
] ]
}, },
{
"type": "kotlin.Pair",
"jniAccessible": true,
"methods": [
{
"name": "getFirst",
"parameterTypes": []
},
{
"name": "getSecond",
"parameterTypes": []
}
]
},
{ {
"type": "kotlin.SafePublicationLazyImpl", "type": "kotlin.SafePublicationLazyImpl",
"fields": [ "fields": [
@ -5382,6 +5396,18 @@
{ {
"type": "org.signal.core.models.ServiceId$PNI" "type": "org.signal.core.models.ServiceId$PNI"
}, },
{
"type": "org.signal.libsignal.attest.AttestationDataException",
"jniAccessible": true,
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{ {
"type": "org.signal.libsignal.internal.CompletableFuture", "type": "org.signal.libsignal.internal.CompletableFuture",
"jniAccessible": true, "jniAccessible": true,
@ -5693,6 +5719,78 @@
{ {
"type": "org.signal.libsignal.protocol.SessionCipher$1", "type": "org.signal.libsignal.protocol.SessionCipher$1",
"jniAccessible": true, "jniAccessible": true,
"methods": [
{
"name": "getIdentityKey",
"parameterTypes": [
"long"
]
},
{
"name": "getLocalIdentityKeyPair",
"parameterTypes": []
},
{
"name": "getLocalRegistrationId",
"parameterTypes": []
},
{
"name": "isTrustedIdentity",
"parameterTypes": [
"long",
"long",
"int"
]
},
{
"name": "loadPreKey",
"parameterTypes": [
"int"
]
},
{
"name": "removePreKey",
"parameterTypes": [
"int"
]
},
{
"name": "saveIdentityKey",
"parameterTypes": [
"long",
"long"
]
}
]
},
{
"type": "org.signal.libsignal.protocol.SessionCipher$2",
"jniAccessible": true,
"methods": [
{
"name": "loadSession",
"parameterTypes": [
"long"
]
},
{
"name": "loadSignedPreKey",
"parameterTypes": [
"int"
]
},
{
"name": "storeSession",
"parameterTypes": [
"long",
"long"
]
}
]
},
{
"type": "org.signal.libsignal.protocol.SessionCipher$3",
"jniAccessible": true,
"methods": [ "methods": [
{ {
"name": "loadPreKey", "name": "loadPreKey",
@ -5709,7 +5807,7 @@
] ]
}, },
{ {
"type": "org.signal.libsignal.protocol.SessionCipher$2", "type": "org.signal.libsignal.protocol.SessionCipher$4",
"jniAccessible": true, "jniAccessible": true,
"methods": [ "methods": [
{ {
@ -5720,6 +5818,26 @@
} }
] ]
}, },
{
"type": "org.signal.libsignal.protocol.SessionCipher$5",
"jniAccessible": true,
"methods": [
{
"name": "loadKyberPreKey",
"parameterTypes": [
"int"
]
},
{
"name": "markKyberPreKeyUsed",
"parameterTypes": [
"int",
"int",
"long"
]
}
]
},
{ {
"type": "org.signal.libsignal.protocol.SignalProtocolAddress", "type": "org.signal.libsignal.protocol.SignalProtocolAddress",
"jniAccessible": true, "jniAccessible": true,
@ -5751,6 +5869,9 @@
} }
] ]
}, },
{
"type": "org.signal.libsignal.protocol.ecc.ECPrivateKey"
},
{ {
"type": "org.signal.libsignal.protocol.ecc.ECPublicKey", "type": "org.signal.libsignal.protocol.ecc.ECPublicKey",
"jniAccessible": true, "jniAccessible": true,
@ -5775,6 +5896,27 @@
} }
] ]
}, },
{
"type": "org.signal.libsignal.protocol.groups.GroupCipher$1",
"jniAccessible": true,
"methods": [
{
"name": "loadSenderKey",
"parameterTypes": [
"long",
"java.util.UUID"
]
},
{
"name": "storeSenderKey",
"parameterTypes": [
"long",
"java.util.UUID",
"long"
]
}
]
},
{ {
"type": "org.signal.libsignal.protocol.groups.state.SenderKeyRecord", "type": "org.signal.libsignal.protocol.groups.state.SenderKeyRecord",
"jniAccessible": true, "jniAccessible": true,
@ -5966,10 +6108,26 @@
"allDeclaredMethods": true, "allDeclaredMethods": true,
"jniAccessible": true "jniAccessible": true
}, },
{
"type": "org.signal.libsignal.protocol.state.internal.IdentityKeyStore",
"jniAccessible": true
},
{
"type": "org.signal.libsignal.protocol.state.internal.KyberPreKeyStore",
"jniAccessible": true
},
{ {
"type": "org.signal.libsignal.protocol.state.internal.PreKeyStore", "type": "org.signal.libsignal.protocol.state.internal.PreKeyStore",
"jniAccessible": true "jniAccessible": true
}, },
{
"type": "org.signal.libsignal.protocol.state.internal.SenderKeyStore",
"jniAccessible": true
},
{
"type": "org.signal.libsignal.protocol.state.internal.SessionStore",
"jniAccessible": true
},
{ {
"type": "org.signal.libsignal.protocol.state.internal.SignedPreKeyStore", "type": "org.signal.libsignal.protocol.state.internal.SignedPreKeyStore",
"jniAccessible": true "jniAccessible": true
@ -9811,4 +9969,4 @@
"bundle": "net.sourceforge.argparse4j.internal.ArgumentParserImpl" "bundle": "net.sourceforge.argparse4j.internal.ArgumentParserImpl"
} }
] ]
} }