mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-10-25 08:39:26 +00:00
Update libsignal-service
This commit is contained in:
parent
7d31b3309e
commit
49aaef000f
@ -4,7 +4,7 @@ coroutines = "1.11.0"
|
||||
junit = "6.1.3"
|
||||
micronaut-json-schema = "2.3.1"
|
||||
micronaut-core = "5.2.14"
|
||||
signal-service = "2.15.3_unofficial_155"
|
||||
signal-service = "2.15.3_unofficial_156"
|
||||
|
||||
[libraries]
|
||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.86"
|
||||
|
||||
@ -492,7 +492,7 @@ public class StorageHelper {
|
||||
final var storageId = newStickerPackStorageIds.get(stickerPack.packId());
|
||||
final var record = StorageSyncModels.localToRemoteRecord(stickerPack);
|
||||
newStorageRecords.add(new SignalStorageRecord(storageId,
|
||||
new StorageRecord.Builder().stickerPack(record).build()));
|
||||
new StorageRecord.Builder().installedStickerPack(record).build()));
|
||||
}
|
||||
|
||||
connection.commit();
|
||||
@ -680,7 +680,8 @@ public class StorageHelper {
|
||||
throw new AssertionError("Missing local sticker pack model for storage id: " + storageId);
|
||||
}
|
||||
final var record = StorageSyncModels.localToRemoteRecord(stickerPack);
|
||||
yield new SignalStorageRecord(storageId, new StorageRecord.Builder().stickerPack(record).build());
|
||||
yield new SignalStorageRecord(storageId,
|
||||
new StorageRecord.Builder().installedStickerPack(record).build());
|
||||
}
|
||||
case null, default -> {
|
||||
throw new AssertionError("Got unknown local storage record type: " + storageId);
|
||||
@ -777,9 +778,9 @@ public class StorageHelper {
|
||||
logger.debug("Reading record {} of type contact", record.getId());
|
||||
contactRecordProcessor.process(StorageRecordConvertersKt.toSignalContactRecord(record.getProto().contact,
|
||||
record.getId()));
|
||||
} else if (record.getProto().stickerPack != null) {
|
||||
} else if (record.getProto().installedStickerPack != null) {
|
||||
logger.debug("Reading record {} of type stickerPack", record.getId());
|
||||
stickerPackRecordProcessor.process(StorageRecordConvertersKt.toSignalStickerPackRecord(record.getProto().stickerPack,
|
||||
stickerPackRecordProcessor.process(StorageRecordConvertersKt.toSignalInstalledStickerPackRecord(record.getProto().installedStickerPack,
|
||||
record.getId()));
|
||||
} else {
|
||||
unknownRecords.add(record.getId());
|
||||
|
||||
@ -6,7 +6,7 @@ import org.asamk.signal.manager.storage.Utils;
|
||||
import org.asamk.signal.manager.util.KeyUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.whispersystems.signalservice.api.storage.SignalStickerPackRecord;
|
||||
import org.whispersystems.signalservice.api.storage.SignalInstalledStickerPackRecord;
|
||||
import org.whispersystems.signalservice.api.storage.StorageId;
|
||||
|
||||
import java.sql.Connection;
|
||||
@ -351,7 +351,7 @@ public class StickerStore {
|
||||
|
||||
public void upsertFromStorageSync(
|
||||
final Connection connection,
|
||||
final SignalStickerPackRecord record
|
||||
final SignalInstalledStickerPackRecord record
|
||||
) throws SQLException {
|
||||
final var remote = record.getProto();
|
||||
final var packId = StickerPackId.deserialize(remote.packId.toByteArray());
|
||||
|
||||
@ -3,14 +3,14 @@ package org.asamk.signal.manager.syncStorage;
|
||||
import org.asamk.signal.manager.api.StickerPackId;
|
||||
import org.asamk.signal.manager.storage.SignalAccount;
|
||||
import org.asamk.signal.manager.util.KeyUtils;
|
||||
import org.whispersystems.signalservice.api.storage.SignalStickerPackRecord;
|
||||
import org.whispersystems.signalservice.api.storage.SignalInstalledStickerPackRecord;
|
||||
import org.whispersystems.signalservice.api.storage.StorageId;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Optional;
|
||||
|
||||
public class StickerPackRecordProcessor extends DefaultStorageRecordProcessor<SignalStickerPackRecord> {
|
||||
public class StickerPackRecordProcessor extends DefaultStorageRecordProcessor<SignalInstalledStickerPackRecord> {
|
||||
|
||||
private static final int PACK_ID_LENGTH = 16;
|
||||
private static final int PACK_KEY_LENGTH = 32;
|
||||
@ -24,19 +24,19 @@ public class StickerPackRecordProcessor extends DefaultStorageRecordProcessor<Si
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(final SignalStickerPackRecord lhs, final SignalStickerPackRecord rhs) {
|
||||
public int compare(final SignalInstalledStickerPackRecord lhs, final SignalInstalledStickerPackRecord rhs) {
|
||||
return lhs.getProto().packId.equals(rhs.getProto().packId) ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInvalid(final SignalStickerPackRecord remote) {
|
||||
protected boolean isInvalid(final SignalInstalledStickerPackRecord remote) {
|
||||
return remote.getProto().packId.size() != PACK_ID_LENGTH || (
|
||||
remote.getProto().deletedAtTimestamp == 0 && remote.getProto().packKey.size() != PACK_KEY_LENGTH
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Optional<SignalStickerPackRecord> getMatching(final SignalStickerPackRecord remote) throws SQLException {
|
||||
protected Optional<SignalInstalledStickerPackRecord> getMatching(final SignalInstalledStickerPackRecord remote) throws SQLException {
|
||||
final var packId = StickerPackId.deserialize(remote.getProto().packId.toByteArray());
|
||||
final var local = account.getStickerStore().getStickerPack(connection, packId);
|
||||
|
||||
@ -52,13 +52,13 @@ public class StickerPackRecordProcessor extends DefaultStorageRecordProcessor<Si
|
||||
account.getStickerStore().updateStorageId(connection, packId, storageId);
|
||||
}
|
||||
|
||||
return Optional.of(new SignalStickerPackRecord(storageId, StorageSyncModels.localToRemoteRecord(local)));
|
||||
return Optional.of(new SignalInstalledStickerPackRecord(storageId, StorageSyncModels.localToRemoteRecord(local)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SignalStickerPackRecord merge(
|
||||
final SignalStickerPackRecord remoteRecord,
|
||||
final SignalStickerPackRecord localRecord
|
||||
protected SignalInstalledStickerPackRecord merge(
|
||||
final SignalInstalledStickerPackRecord remoteRecord,
|
||||
final SignalInstalledStickerPackRecord localRecord
|
||||
) {
|
||||
final var remote = remoteRecord.getProto();
|
||||
final var local = localRecord.getProto();
|
||||
@ -75,12 +75,12 @@ public class StickerPackRecordProcessor extends DefaultStorageRecordProcessor<Si
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void insertLocal(final SignalStickerPackRecord record) throws SQLException {
|
||||
protected void insertLocal(final SignalInstalledStickerPackRecord record) throws SQLException {
|
||||
account.getStickerStore().upsertFromStorageSync(connection, record);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateLocal(final StorageRecordUpdate<SignalStickerPackRecord> update) throws SQLException {
|
||||
protected void updateLocal(final StorageRecordUpdate<SignalInstalledStickerPackRecord> update) throws SQLException {
|
||||
account.getStickerStore().upsertFromStorageSync(connection, update.newRecord());
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,14 +17,14 @@ import org.whispersystems.signalservice.api.storage.SignalAccountRecord;
|
||||
import org.whispersystems.signalservice.api.storage.SignalContactRecord;
|
||||
import org.whispersystems.signalservice.api.storage.SignalGroupV1Record;
|
||||
import org.whispersystems.signalservice.api.storage.SignalGroupV2Record;
|
||||
import org.whispersystems.signalservice.api.storage.SignalStickerPackRecord;
|
||||
import org.whispersystems.signalservice.api.storage.SignalInstalledStickerPackRecord;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.AccountRecord;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.AccountRecord.UsernameLink;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.ContactRecord;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.ContactRecord.IdentityState;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.GroupV1Record;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.GroupV2Record;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.StickerPackRecord;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.InstalledStickerPackRecord;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@ -168,8 +168,8 @@ public final class StorageSyncModels {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static StickerPackRecord localToRemoteRecord(StickerPack stickerPack) {
|
||||
final var builder = SignalStickerPackRecord.Companion.newBuilder(stickerPack.storageRecord());
|
||||
public static InstalledStickerPackRecord localToRemoteRecord(StickerPack stickerPack) {
|
||||
final var builder = SignalInstalledStickerPackRecord.Companion.newBuilder(stickerPack.storageRecord());
|
||||
builder.packId(ByteString.of(stickerPack.packId().serialize()));
|
||||
|
||||
if (stickerPack.deletedTimestamp() > 0) {
|
||||
|
||||
@ -1 +1 @@
|
||||
0.105.0
|
||||
0.105.4
|
||||
|
||||
@ -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/8.31.1");
|
||||
.orElse("Signal-Android/8.33.1");
|
||||
static final String USER_AGENT_SIGNAL_CLI = PROJECT_NAME == null
|
||||
? "signal-cli"
|
||||
: PROJECT_NAME + "/" + PROJECT_VERSION;
|
||||
|
||||
@ -2455,11 +2455,11 @@
|
||||
"allDeclaredFields": true,
|
||||
"methods": [
|
||||
{
|
||||
"name": "number",
|
||||
"name": "aci",
|
||||
"parameterTypes": []
|
||||
},
|
||||
{
|
||||
"name": "aci",
|
||||
"name": "number",
|
||||
"parameterTypes": []
|
||||
}
|
||||
]
|
||||
@ -10178,6 +10178,29 @@
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.GroupV2Record$StorySendMode"
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.InstalledStickerPackRecord",
|
||||
"fields": [
|
||||
{
|
||||
"name": "deletedAtTimestamp"
|
||||
},
|
||||
{
|
||||
"name": "packId"
|
||||
},
|
||||
{
|
||||
"name": "packKey"
|
||||
},
|
||||
{
|
||||
"name": "position"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.InstalledStickerPackRecord$Builder"
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.InstalledStickerPackRecord$Companion"
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.ManifestRecord",
|
||||
"fields": [
|
||||
@ -10218,29 +10241,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.StickerPackRecord",
|
||||
"fields": [
|
||||
{
|
||||
"name": "deletedAtTimestamp"
|
||||
},
|
||||
{
|
||||
"name": "packId"
|
||||
},
|
||||
{
|
||||
"name": "packKey"
|
||||
},
|
||||
{
|
||||
"name": "position"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.StickerPackRecord$Builder"
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.StickerPackRecord$Companion"
|
||||
},
|
||||
{
|
||||
"type": "org.whispersystems.signalservice.internal.storage.protos.StorageItem",
|
||||
"fields": [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user