mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Update dependencies
This commit is contained in:
parent
3d5c440aa2
commit
aad4b53524
7 changed files with 72 additions and 11 deletions
|
@ -492,6 +492,11 @@
|
|||
"allDeclaredMethods":true,
|
||||
"allDeclaredClasses":true
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.Signal$Identity",
|
||||
"allDeclaredClasses":true,
|
||||
"queryAllDeclaredMethods":true
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.Signal$MessageReceived",
|
||||
"allDeclaredConstructors":true,
|
||||
|
@ -526,6 +531,10 @@
|
|||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":["org.freedesktop.dbus.DBusPath","byte[]","java.lang.String"] }]
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.Signal$StructIdentity",
|
||||
"allDeclaredFields":true
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.Signal$SyncMessageReceived",
|
||||
"allDeclaredConstructors":true,
|
||||
|
@ -2790,6 +2799,20 @@
|
|||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.KyberPreKeyEntity",
|
||||
"allDeclaredFields":true,
|
||||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.KyberPreKeyEntity$ByteArrayDeserializer",
|
||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.KyberPreKeyEntity$KEMPublicKeyDeserializer",
|
||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.MismatchedDevices",
|
||||
"allDeclaredFields":true,
|
||||
|
@ -2797,6 +2820,13 @@
|
|||
"allDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.OneTimePreKeyCounts",
|
||||
"allDeclaredFields":true,
|
||||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||
},
|
||||
{
|
||||
"name":"org.whispersystems.signalservice.internal.push.OutgoingPushMessage",
|
||||
"allDeclaredFields":true,
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.whispersystems.signalservice.api.push.exceptions.AlreadyVerifiedExcep
|
|||
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
|
||||
import org.whispersystems.signalservice.api.util.DeviceNameUtil;
|
||||
import org.whispersystems.signalservice.internal.push.KyberPreKeyEntity;
|
||||
import org.whispersystems.signalservice.internal.push.OutgoingPushMessage;
|
||||
import org.whispersystems.util.Base64UrlSafe;
|
||||
|
||||
|
@ -153,6 +154,7 @@ public class AccountHelper {
|
|||
// TODO create new PNI identity key
|
||||
final List<OutgoingPushMessage> deviceMessages = null;
|
||||
final Map<String, SignedPreKeyEntity> devicePniSignedPreKeys = null;
|
||||
final Map<String, KyberPreKeyEntity> devicePniLastResortKyberPrekeys = null;
|
||||
final Map<String, Integer> pniRegistrationIds = null;
|
||||
var sessionId = account.getSessionId(account.getNumber());
|
||||
final var result = NumberVerificationUtils.verifyNumber(sessionId,
|
||||
|
@ -174,6 +176,7 @@ public class AccountHelper {
|
|||
account.getPniIdentityKeyPair().getPublicKey(),
|
||||
deviceMessages,
|
||||
devicePniSignedPreKeys,
|
||||
devicePniLastResortKyberPrekeys,
|
||||
pniRegistrationIds)));
|
||||
});
|
||||
// TODO handle response
|
||||
|
@ -193,10 +196,10 @@ public class AccountHelper {
|
|||
}
|
||||
}
|
||||
|
||||
final var candidates = Username.generateCandidates(nickname, USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH);
|
||||
final var candidates = Username.candidatesFrom(nickname, USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH);
|
||||
final var candidateHashes = new ArrayList<String>();
|
||||
for (final var candidate : candidates) {
|
||||
candidateHashes.add(Base64UrlSafe.encodeBytesWithoutPadding(Username.hash(candidate)));
|
||||
candidateHashes.add(Base64UrlSafe.encodeBytesWithoutPadding(candidate.getHash()));
|
||||
}
|
||||
|
||||
final var response = dependencies.getAccountManager().reserveUsername(candidateHashes);
|
||||
|
@ -207,7 +210,7 @@ public class AccountHelper {
|
|||
}
|
||||
|
||||
logger.debug("[reserveUsername] Successfully reserved username.");
|
||||
final var username = candidates.get(hashIndex);
|
||||
final var username = candidates.get(hashIndex).getUsername();
|
||||
|
||||
dependencies.getAccountManager().confirmUsername(username, response);
|
||||
account.setUsername(username);
|
||||
|
@ -226,7 +229,7 @@ public class AccountHelper {
|
|||
final var whoAmIResponse = dependencies.getAccountManager().getWhoAmI();
|
||||
final var serverUsernameHash = whoAmIResponse.getUsernameHash();
|
||||
final var hasServerUsername = !isEmpty(serverUsernameHash);
|
||||
final var localUsernameHash = Base64UrlSafe.encodeBytesWithoutPadding(Username.hash(localUsername));
|
||||
final var localUsernameHash = Base64UrlSafe.encodeBytesWithoutPadding(new Username(localUsername).getHash());
|
||||
|
||||
if (!hasServerUsername) {
|
||||
logger.debug("No remote username is set.");
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.signal.libsignal.protocol.state.PreKeyRecord;
|
|||
import org.signal.libsignal.protocol.state.SignedPreKeyRecord;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.whispersystems.signalservice.api.account.PreKeyUpload;
|
||||
import org.whispersystems.signalservice.api.push.ServiceIdType;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -34,9 +35,11 @@ public class PreKeyHelper {
|
|||
}
|
||||
|
||||
public void refreshPreKeysIfNecessary(ServiceIdType serviceIdType) throws IOException {
|
||||
if (dependencies.getAccountManager().getPreKeysCount(serviceIdType) < ServiceConfig.PREKEY_MINIMUM_COUNT) {
|
||||
final var preKeyCounts = dependencies.getAccountManager().getPreKeyCounts(serviceIdType);
|
||||
if (preKeyCounts.getEcCount() < ServiceConfig.PREKEY_MINIMUM_COUNT) {
|
||||
refreshPreKeys(serviceIdType);
|
||||
}
|
||||
// TODO kyber pre keys
|
||||
}
|
||||
|
||||
public void refreshPreKeys() throws IOException {
|
||||
|
@ -68,8 +71,13 @@ public class PreKeyHelper {
|
|||
final var oneTimePreKeys = generatePreKeys(serviceIdType);
|
||||
final var signedPreKeyRecord = generateSignedPreKey(serviceIdType, identityKeyPair);
|
||||
|
||||
dependencies.getAccountManager()
|
||||
.setPreKeys(serviceIdType, identityKeyPair.getPublicKey(), signedPreKeyRecord, oneTimePreKeys);
|
||||
final var preKeyUpload = new PreKeyUpload(serviceIdType,
|
||||
identityKeyPair.getPublicKey(),
|
||||
signedPreKeyRecord,
|
||||
oneTimePreKeys,
|
||||
null,
|
||||
null);
|
||||
dependencies.getAccountManager().setPreKeys(preKeyUpload);
|
||||
}
|
||||
|
||||
private List<PreKeyRecord> generatePreKeys(ServiceIdType serviceIdType) {
|
||||
|
|
|
@ -152,8 +152,12 @@ public class ReceiveHelper {
|
|||
logger.trace("Storing new message from {}", recipientId);
|
||||
// store message on disk, before acknowledging receipt to the server
|
||||
cachedMessage[0] = account.getMessageCache().cacheMessage(envelope1, recipientId);
|
||||
try {
|
||||
signalWebSocket.sendAck(it);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Failed to ack envelope to server after storing it: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
isWaitingForMessage = false;
|
||||
backOffCounter = 0;
|
||||
|
|
|
@ -180,7 +180,7 @@ public class RecipientHelper {
|
|||
|
||||
private ACI getRegisteredUserByUsername(String username) throws IOException, BaseUsernameException {
|
||||
return dependencies.getAccountManager()
|
||||
.getAciByUsernameHash(Base64UrlSafe.encodeBytesWithoutPadding(Username.hash(username)));
|
||||
.getAciByUsernameHash(Base64UrlSafe.encodeBytesWithoutPadding(new Username(username).getHash()));
|
||||
}
|
||||
|
||||
public record RegisteredUser(Optional<ACI> aci, Optional<PNI> pni) {
|
||||
|
|
|
@ -226,4 +226,20 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
|||
public void markKyberPreKeyUsed(final int kyberPreKeyId) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KyberPreKeyRecord> loadLastResortKyberPreKeys() {
|
||||
// TODO
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeKyberPreKey(final int i) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeLastResortKyberPreKey(final int i, final KyberPreKeyRecord kyberPreKeyRecord) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ dependencyResolutionManagement {
|
|||
versionCatalogs {
|
||||
create("libs") {
|
||||
library("bouncycastle", "org.bouncycastle", "bcprov-jdk15on").version("1.70")
|
||||
library("jackson.databind", "com.fasterxml.jackson.core", "jackson-databind").version("2.15.1")
|
||||
library("jackson.databind", "com.fasterxml.jackson.core", "jackson-databind").version("2.15.2")
|
||||
library("argparse4j", "net.sourceforge.argparse4j", "argparse4j").version("0.9.0")
|
||||
library("dbusjava", "com.github.hypfvieh", "dbus-java-transport-native-unixsocket").version("4.3.0")
|
||||
version("slf4j", "2.0.7")
|
||||
|
@ -16,7 +16,7 @@ dependencyResolutionManagement {
|
|||
library("logback", "ch.qos.logback", "logback-classic").version("1.4.7")
|
||||
|
||||
|
||||
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_72")
|
||||
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_73")
|
||||
library("protobuf", "com.google.protobuf", "protobuf-javalite").version("3.23.0")
|
||||
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.42.0.0")
|
||||
library("hikari", "com.zaxxer", "HikariCP").version("5.0.1")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue