mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-05-24 14:14:31 +00:00
Compare commits
35 Commits
6b6151188c
...
f285a8516d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f285a8516d | ||
|
|
a03d17a9e4 | ||
|
|
364f89f1d0 | ||
|
|
7773a3fd83 | ||
|
|
30f1464092 | ||
|
|
52543fbc5e | ||
|
|
c633f478c2 | ||
|
|
dd1d41c798 | ||
|
|
ed6f41c691 | ||
|
|
b4d5da7bf0 | ||
|
|
1702266b75 | ||
|
|
da0d67a2db | ||
|
|
14b48e4784 | ||
|
|
cafced7a67 | ||
|
|
11ee28a2e1 | ||
|
|
6810877b4d | ||
|
|
afc3c458a9 | ||
|
|
b6e895b47e | ||
|
|
0f83b784e9 | ||
|
|
8376d1f477 | ||
|
|
d7c0c7000f | ||
|
|
c6ac4b2692 | ||
|
|
6135dae301 | ||
|
|
1b3c898415 | ||
|
|
a215294c68 | ||
|
|
5f9fb1da88 | ||
|
|
b6b8276fd6 | ||
|
|
cde6fff336 | ||
|
|
3f15de0946 | ||
|
|
a38b7edbdf | ||
|
|
04b7b1e47d | ||
|
|
9580ab0777 | ||
|
|
cab77e0c08 | ||
|
|
a65c228c9b | ||
|
|
d271a2db3d |
@ -1,5 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.14.2] - 2026-04-04
|
||||
|
||||
### Added
|
||||
|
||||
10
README.md
10
README.md
@ -148,6 +148,16 @@ version installed, you can replace `./gradlew` with `gradle` in the following st
|
||||
./gradlew run --args="--help"
|
||||
```
|
||||
|
||||
### JSON Schemas for the JSON-RPC mode
|
||||
|
||||
1. Generate [JSON Schema](https://json-schema.org/) files for all the JSON-RPC data classes (`src/main/java/org/asamk/signal/json`):
|
||||
|
||||
```sh
|
||||
./gradlew jsonSchemas
|
||||
```
|
||||
|
||||
2. The generated files can be found in the `build/generated/META-INF/schemas` folder.
|
||||
|
||||
### 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
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
@ -8,7 +10,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group = "org.asamk"
|
||||
version = "0.14.2"
|
||||
version = "0.14.3-SNAPSHOT"
|
||||
}
|
||||
|
||||
java {
|
||||
@ -72,6 +74,11 @@ val excludePatterns = mapOf(
|
||||
)
|
||||
)
|
||||
|
||||
val schemaAnnotationProcessor by configurations.creating {
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
registerTransform(JarFileExcluder::class) {
|
||||
from.attribute(minified, false).attribute(artifactType, "jar")
|
||||
@ -82,6 +89,8 @@ dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
schemaAnnotationProcessor(libs.micronaut.json.schema.processor)
|
||||
schemaAnnotationProcessor(libs.micronaut.inject.java)
|
||||
implementation(libs.bouncycastle)
|
||||
implementation(libs.jackson.databind)
|
||||
implementation(libs.argparse4j)
|
||||
@ -90,6 +99,10 @@ dependencies {
|
||||
implementation(libs.slf4j.jul)
|
||||
implementation(libs.logback)
|
||||
implementation(libs.zxing)
|
||||
implementation(libs.micronaut.json.schema.annotations)
|
||||
if (gradle.startParameter.taskNames.any { it.contains("jsonSchemas") }) {
|
||||
implementation(libs.micronaut.json.schema.generator)
|
||||
}
|
||||
implementation(project(":libsignal-cli"))
|
||||
|
||||
testImplementation(libs.junit.jupiter)
|
||||
@ -160,3 +173,30 @@ tasks.register("writeLibsignalVersion") {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JavaCompile>("jsonSchemas") {
|
||||
dependsOn(tasks.compileJava)
|
||||
val schemaBaseUri = "http://localhost:8080/schemas/"
|
||||
source = sourceSets.main.get().java
|
||||
include("org/asamk/signal/json/**/*.java")
|
||||
classpath = sourceSets.main.get().compileClasspath + files(sourceSets.main.get().java.destinationDirectory)
|
||||
destinationDirectory.set(layout.buildDirectory.dir("generated"))
|
||||
options.annotationProcessorPath = schemaAnnotationProcessor
|
||||
options.compilerArgs.addAll(
|
||||
listOf(
|
||||
"-Amicronaut.processing.group=org.asamk",
|
||||
"-Amicronaut.processing.module=signal-cli",
|
||||
"-Amicronaut.processing.annotations=org.asamk.signal.json.*",
|
||||
"-Amicronaut.jsonschema.baseUri=$schemaBaseUri",
|
||||
)
|
||||
)
|
||||
doLast {
|
||||
fileTree(destinationDirectory.get().dir("META-INF/schemas").asFile) {
|
||||
include("*.schema.json")
|
||||
}.forEach { schemaFile ->
|
||||
val normalized = schemaFile.readText().replace("\"$schemaBaseUri/", "\"")
|
||||
val prettyJson = JsonOutput.prettyPrint(normalized)
|
||||
schemaFile.writeText("$prettyJson\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
[versions]
|
||||
slf4j = "2.0.17"
|
||||
junit = "6.0.2"
|
||||
micronaut-json-schema = "2.0.0-M6"
|
||||
micronaut-core = "4.9.3"
|
||||
|
||||
[libraries]
|
||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.83"
|
||||
@ -8,6 +10,10 @@ jackson-databind = "com.fasterxml.jackson.core:jackson-databind:2.20.2"
|
||||
argparse4j = "net.sourceforge.argparse4j:argparse4j:0.9.0"
|
||||
dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
|
||||
zxing = "com.google.zxing:core:3.5.4"
|
||||
micronaut-json-schema-annotations = { module = "io.micronaut.jsonschema:micronaut-json-schema-annotations", version.ref = "micronaut-json-schema" }
|
||||
micronaut-json-schema-processor = { module = "io.micronaut.jsonschema:micronaut-json-schema-processor", version.ref = "micronaut-json-schema" }
|
||||
micronaut-json-schema-generator = { module = "io.micronaut.jsonschema:micronaut-json-schema-generator", version.ref = "micronaut-json-schema" }
|
||||
micronaut-inject-java = { module = "io.micronaut:micronaut-inject-java", version.ref = "micronaut-core" }
|
||||
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.32"
|
||||
|
||||
@ -11,11 +11,14 @@ import org.signal.libsignal.protocol.InvalidMessageException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.whispersystems.signalservice.api.crypto.AttachmentCipherInputStream;
|
||||
import org.whispersystems.signalservice.api.crypto.AttachmentCipherStreamUtil;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
|
||||
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||
import org.whispersystems.signalservice.internal.crypto.PaddingInputStream;
|
||||
import org.whispersystems.signalservice.internal.push.http.ResumableUploadSpec;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -89,12 +92,12 @@ public class AttachmentHelper {
|
||||
final boolean voiceNote
|
||||
) throws AttachmentInvalidException {
|
||||
try {
|
||||
final var streamDetails = Utils.createStreamDetails(attachment);
|
||||
final var uploadSpec = dependencies.getMessageSender()
|
||||
.getResumableUploadSpec(streamDetails.first().getLength());
|
||||
final var streamDetailsAndFileName = Utils.createStreamDetails(attachment);
|
||||
final var streamDetails = streamDetailsAndFileName.first();
|
||||
final var uploadSpec = getResumableUploadSpec(streamDetails);
|
||||
|
||||
return AttachmentUtils.createAttachmentStream(streamDetails.first(),
|
||||
streamDetails.second(),
|
||||
return AttachmentUtils.createAttachmentStream(streamDetails,
|
||||
streamDetailsAndFileName.second(),
|
||||
voiceNote,
|
||||
uploadSpec);
|
||||
} catch (IOException e) {
|
||||
@ -102,6 +105,13 @@ public class AttachmentHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public ResumableUploadSpec getResumableUploadSpec(final StreamDetails streamDetails) throws IOException {
|
||||
final var streamLength = streamDetails.getLength();
|
||||
final var ciphertextLength = AttachmentCipherStreamUtil.getCiphertextLength(PaddingInputStream.getPaddedSize(
|
||||
streamLength));
|
||||
return dependencies.getMessageSender().getResumableUploadSpec(ciphertextLength);
|
||||
}
|
||||
|
||||
public SignalServiceAttachmentPointer uploadAttachment(String attachment) throws IOException, AttachmentInvalidException {
|
||||
final var attachmentStream = getAttachmentStream(attachment, false);
|
||||
return uploadAttachment(attachmentStream);
|
||||
|
||||
@ -123,7 +123,7 @@ public class GroupHelper {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec(streamDetails.getLength());
|
||||
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||
return Optional.of(AttachmentUtils.createAttachmentStream(streamDetails, Optional.empty(), uploadSpec));
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ import org.whispersystems.signalservice.api.messages.multidevice.StickerPackOper
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.ViewedMessage;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||
import org.whispersystems.signalservice.internal.push.SyncMessage;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
@ -131,13 +132,14 @@ public class SyncHelper {
|
||||
|
||||
if (groupsFile.exists() && groupsFile.length() > 0) {
|
||||
try (var groupsFileStream = new FileInputStream(groupsFile)) {
|
||||
final var uploadSpec = context.getDependencies()
|
||||
.getMessageSender()
|
||||
.getResumableUploadSpec(groupsFile.length());
|
||||
final var streamDetails = new StreamDetails(groupsFileStream,
|
||||
MimeUtils.OCTET_STREAM,
|
||||
groupsFile.length());
|
||||
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(groupsFileStream)
|
||||
.withContentType(MimeUtils.OCTET_STREAM)
|
||||
.withLength(groupsFile.length())
|
||||
.withStream(streamDetails.getStream())
|
||||
.withContentType(streamDetails.getContentType())
|
||||
.withLength(streamDetails.getLength())
|
||||
.withResumableUploadSpec(uploadSpec)
|
||||
.build();
|
||||
|
||||
@ -192,13 +194,14 @@ public class SyncHelper {
|
||||
|
||||
if (contactsFile.exists() && contactsFile.length() > 0) {
|
||||
try (var contactsFileStream = new FileInputStream(contactsFile)) {
|
||||
final var uploadSpec = context.getDependencies()
|
||||
.getMessageSender()
|
||||
.getResumableUploadSpec(contactsFile.length());
|
||||
final var streamDetails = new StreamDetails(contactsFileStream,
|
||||
MimeUtils.OCTET_STREAM,
|
||||
contactsFile.length());
|
||||
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(contactsFileStream)
|
||||
.withContentType(MimeUtils.OCTET_STREAM)
|
||||
.withLength(contactsFile.length())
|
||||
.withStream(streamDetails.getStream())
|
||||
.withContentType(streamDetails.getContentType())
|
||||
.withLength(streamDetails.getLength())
|
||||
.withResumableUploadSpec(uploadSpec)
|
||||
.build();
|
||||
|
||||
|
||||
@ -839,8 +839,7 @@ public class ManagerImpl implements Manager {
|
||||
final var streamDetails = new StreamDetails(new ByteArrayInputStream(messageBytes),
|
||||
MimeUtils.LONG_TEXT,
|
||||
messageBytes.length);
|
||||
final var uploadSpec = dependencies.getMessageSender()
|
||||
.getResumableUploadSpec(streamDetails.getLength());
|
||||
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||
final var textAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
||||
Optional.empty(),
|
||||
uploadSpec);
|
||||
@ -908,7 +907,7 @@ public class ManagerImpl implements Manager {
|
||||
if (streamDetails == null) {
|
||||
throw new InvalidStickerException("Missing local sticker file");
|
||||
}
|
||||
final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec(streamDetails.getLength());
|
||||
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||
final var stickerAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
||||
Optional.empty(),
|
||||
uploadSpec);
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "AdminDelete")
|
||||
public record JsonAdminDelete(
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
) {
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "Attachment")
|
||||
record JsonAttachment(
|
||||
String contentType,
|
||||
String filename,
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
@JsonSchema(title = "AttachmentData")
|
||||
public record JsonAttachmentData(
|
||||
String data
|
||||
) {}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@ -10,6 +11,7 @@ import java.util.List;
|
||||
|
||||
import static org.asamk.signal.manager.util.Utils.callIdUnsigned;
|
||||
|
||||
@JsonSchema(title = "CallMessage")
|
||||
record JsonCallMessage(
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) Offer offerMessage,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) Answer answerMessage,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "Contact")
|
||||
public record JsonContact(
|
||||
String number,
|
||||
String uuid,
|
||||
@ -26,6 +28,7 @@ public record JsonContact(
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonInternal internal
|
||||
) {
|
||||
|
||||
@JsonSchema(title = "Profile")
|
||||
public record JsonProfile(
|
||||
long lastUpdateTimestamp,
|
||||
String givenName,
|
||||
@ -36,6 +39,7 @@ public record JsonContact(
|
||||
String mobileCoinAddress
|
||||
) {}
|
||||
|
||||
@JsonSchema(title = "Internal")
|
||||
public record JsonInternal(
|
||||
List<String> capabilities,
|
||||
String unidentifiedAccessMode,
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactAddress")
|
||||
public record JsonContactAddress(
|
||||
String type,
|
||||
String label,
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "ContactAvatar")
|
||||
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
||||
|
||||
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactEmail")
|
||||
public record JsonContactEmail(String value, String type, String label) {
|
||||
|
||||
static JsonContactEmail from(MessageEnvelope.Data.SharedContact.Email email) {
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactName")
|
||||
public record JsonContactName(
|
||||
String nickname, String given, String family, String prefix, String suffix, String middle
|
||||
) {
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactPhone")
|
||||
public record JsonContactPhone(String value, String type, String label) {
|
||||
|
||||
static JsonContactPhone from(MessageEnvelope.Data.SharedContact.Phone phone) {
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "DataMessage")
|
||||
record JsonDataMessage(
|
||||
long timestamp,
|
||||
String message,
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "EditMessage")
|
||||
record JsonEditMessage(long targetSentTimestamp, JsonDataMessage dataMessage) {
|
||||
|
||||
static JsonEditMessage from(MessageEnvelope.Edit editMessage, Manager m) {
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
@JsonSchema(title = "Error")
|
||||
public record JsonError(String message, String type) {
|
||||
|
||||
public static JsonError from(Throwable exception) {
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "GroupInfo")
|
||||
record JsonGroupInfo(String groupId, String groupName, int revision, String type) {
|
||||
|
||||
static JsonGroupInfo from(MessageEnvelope.Data.GroupContext groupContext, Manager m) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "Mention")
|
||||
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
||||
|
||||
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
@ -10,6 +11,7 @@ import org.asamk.signal.manager.api.UntrustedIdentityException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "MessageEnvelope")
|
||||
public record JsonMessageEnvelope(
|
||||
@Deprecated String source,
|
||||
String sourceNumber,
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "Payment")
|
||||
public record JsonPayment(String note, byte[] receipt) {
|
||||
|
||||
static JsonPayment from(MessageEnvelope.Data.Payment payment) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "PinMessage")
|
||||
public record JsonPinMessage(
|
||||
@Deprecated String targetAuthor,
|
||||
String targetAuthorNumber,
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "PollCreate")
|
||||
public record JsonPollCreate(
|
||||
String question, boolean allowMultiple, List<String> options
|
||||
) {
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "PollTerminate")
|
||||
public record JsonPollTerminate(long targetSentTimestamp) {
|
||||
|
||||
static JsonPollTerminate from(MessageEnvelope.Data.PollTerminate pollTerminate) {
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "PollVote")
|
||||
public record JsonPollVote(
|
||||
@Deprecated String author,
|
||||
String authorNumber,
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "Preview")
|
||||
public record JsonPreview(String url, String title, String description, JsonAttachment image) {
|
||||
|
||||
static JsonPreview from(MessageEnvelope.Data.Preview preview) {
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "Quote")
|
||||
public record JsonQuote(
|
||||
long id,
|
||||
@Deprecated String author,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "QuotedAttachment")
|
||||
public record JsonQuotedAttachment(
|
||||
String contentType, String filename, @JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||
) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "Reaction")
|
||||
public record JsonReaction(
|
||||
String emoji,
|
||||
@Deprecated String targetAuthor,
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "ReceiptMessage")
|
||||
record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
|
||||
|
||||
static JsonReceiptMessage from(MessageEnvelope.Receipt receiptMessage) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.RecipientAddress;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "RecipientAddress")
|
||||
public record JsonRecipientAddress(String uuid, String number, String username) {
|
||||
|
||||
public static JsonRecipientAddress from(RecipientAddress address) {
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
@JsonSchema(title = "RemoteDelete")
|
||||
record JsonRemoteDelete(long timestamp) {}
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.GroupId;
|
||||
import org.asamk.signal.manager.api.SendMessageResult;
|
||||
|
||||
@JsonSchema(title = "SendMessageResult")
|
||||
public record JsonSendMessageResult(
|
||||
JsonRecipientAddress recipientAddress,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "SharedContact")
|
||||
public record JsonSharedContact(
|
||||
JsonContactName name,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonContactAvatar avatar,
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Hex;
|
||||
|
||||
@JsonSchema(title = "Sticker")
|
||||
public record JsonSticker(String packId, int stickerId) {
|
||||
|
||||
static JsonSticker from(MessageEnvelope.Data.Sticker sticker) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "StoryContext")
|
||||
record JsonStoryContext(
|
||||
String authorNumber, String authorUuid, long sentTimestamp
|
||||
) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.Color;
|
||||
import org.asamk.signal.manager.api.GroupId;
|
||||
@ -8,6 +9,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "StoryMessage")
|
||||
record JsonStoryMessage(
|
||||
boolean allowsReplies,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||
|
||||
@ -2,6 +2,7 @@ package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
@ -9,6 +10,7 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "SyncDataMessage")
|
||||
record JsonSyncDataMessage(
|
||||
@Deprecated String destination,
|
||||
String destinationNumber,
|
||||
|
||||
@ -9,12 +9,15 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
enum JsonSyncMessageType {
|
||||
CONTACTS_SYNC,
|
||||
GROUPS_SYNC,
|
||||
REQUEST_SYNC
|
||||
}
|
||||
|
||||
@JsonSchema(title = "SyncMessage")
|
||||
record JsonSyncMessage(
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncDataMessage sentMessage,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncStoryMessage sentStoryMessage,
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "SyncReadMessage")
|
||||
record JsonSyncReadMessage(
|
||||
@Deprecated String sender, String senderNumber, String senderUuid, long timestamp
|
||||
) {
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "SyncStoryMessage")
|
||||
record JsonSyncStoryMessage(
|
||||
String destinationNumber, String destinationUuid, @JsonUnwrapped JsonStoryMessage dataMessage
|
||||
) {
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.TextStyle;
|
||||
|
||||
@JsonSchema(title = "TextStyle")
|
||||
public record JsonTextStyle(String style, int start, int length) {
|
||||
|
||||
static JsonTextStyle from(TextStyle textStyle) {
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.GroupId;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "TypingMessage")
|
||||
record JsonTypingMessage(
|
||||
String action, long timestamp, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId
|
||||
) {
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import io.micronaut.jsonschema.JsonSchema;
|
||||
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "UnpinMessage")
|
||||
public record JsonUnpinMessage(
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
) {
|
||||
|
||||
@ -1486,6 +1486,13 @@
|
||||
"type": "kotlin.Pair",
|
||||
"jniAccessible": true,
|
||||
"methods": [
|
||||
{
|
||||
"name": "<init>",
|
||||
"parameterTypes": [
|
||||
"java.lang.Object",
|
||||
"java.lang.Object"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getFirst",
|
||||
"parameterTypes": []
|
||||
@ -1496,6 +1503,9 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "kotlin.Pair[]"
|
||||
},
|
||||
{
|
||||
"type": "kotlin.SafePublicationLazyImpl",
|
||||
"fields": [
|
||||
@ -5821,6 +5831,21 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.signal.libsignal.net.UploadForm",
|
||||
"jniAccessible": true,
|
||||
"methods": [
|
||||
{
|
||||
"name": "fromNative",
|
||||
"parameterTypes": [
|
||||
"int",
|
||||
"java.lang.String",
|
||||
"java.lang.Object[]",
|
||||
"java.lang.String"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.signal.libsignal.net.internal.BridgeChatListener",
|
||||
"jniAccessible": true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user