Update libsignal-client to 0.9.0
This commit is contained in:
parent
6e7a18ea11
commit
aec2ca1d87
12 changed files with 25 additions and 43 deletions
|
@ -19,7 +19,6 @@ import org.whispersystems.libsignal.state.SignedPreKeyRecord;
|
|||
import org.whispersystems.libsignal.state.SignedPreKeyStore;
|
||||
import org.whispersystems.signalservice.api.SignalServiceDataStore;
|
||||
import org.whispersystems.signalservice.api.SignalServiceSessionStore;
|
||||
import org.whispersystems.signalservice.api.messages.InvalidRegistrationIdException;
|
||||
import org.whispersystems.signalservice.api.push.DistributionId;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -106,7 +105,7 @@ public class SignalProtocolStoreImpl implements SignalServiceDataStore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames) throws InvalidRegistrationIdException {
|
||||
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames) {
|
||||
return sessionStore.getAllAddressesWithActiveSessions(addressNames);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.whispersystems.libsignal.SignalProtocolAddress;
|
|||
import org.whispersystems.libsignal.protocol.CiphertextMessage;
|
||||
import org.whispersystems.libsignal.state.SessionRecord;
|
||||
import org.whispersystems.signalservice.api.SignalServiceSessionStore;
|
||||
import org.whispersystems.signalservice.api.messages.InvalidRegistrationIdException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -102,24 +101,14 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames) throws InvalidRegistrationIdException {
|
||||
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames) {
|
||||
synchronized (LOCK) {
|
||||
List<SessionDatabase.SessionRow> activeRows = DatabaseFactory.getSessionDatabase(context)
|
||||
.getAllFor(addressNames)
|
||||
.stream()
|
||||
.filter(row -> isActive(row.getRecord()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
boolean hasInvalidRegistrationId = activeRows.stream()
|
||||
.map(SessionDatabase.SessionRow::getRecord)
|
||||
.anyMatch(record -> !isValidRegistrationId(record.getRemoteRegistrationId()));
|
||||
if (hasInvalidRegistrationId) {
|
||||
throw new InvalidRegistrationIdException();
|
||||
}
|
||||
|
||||
return activeRows.stream()
|
||||
.map(row -> new SignalProtocolAddress(row.getAddress(), row.getDeviceId()))
|
||||
.collect(Collectors.toSet());
|
||||
return DatabaseFactory.getSessionDatabase(context)
|
||||
.getAllFor(addressNames)
|
||||
.stream()
|
||||
.filter(row -> isActive(row.getRecord()))
|
||||
.map(row -> new SignalProtocolAddress(row.getAddress(), row.getDeviceId()))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.util.FeatureFlags;
|
|||
import org.thoughtcrime.securesms.util.RecipientAccessList;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.InvalidRegistrationIdException;
|
||||
import org.whispersystems.libsignal.NoSessionException;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.CancelationException;
|
||||
|
@ -31,7 +32,6 @@ import org.whispersystems.signalservice.api.crypto.ContentHint;
|
|||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccess;
|
||||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccessPair;
|
||||
import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
|
||||
import org.whispersystems.signalservice.api.messages.InvalidRegistrationIdException;
|
||||
import org.whispersystems.signalservice.api.messages.SendMessageResult;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
|
||||
|
|
|
@ -573,11 +573,11 @@ dependencyVerification {
|
|||
['org.threeten:threetenbp:1.3.6',
|
||||
'f4c23ffaaed717c3b99c003e0ee02d6d66377fd47d866fec7d971bd8644fc1a7'],
|
||||
|
||||
['org.whispersystems:signal-client-android:0.8.4',
|
||||
'bd64e526a32bb4da025401244a48c6b37fa7f48520446433d395d0a34d6eff5c'],
|
||||
['org.whispersystems:signal-client-android:0.9.0',
|
||||
'e58359105094103ba1b5960563d0980ce31319e0946558d722636e76ef6eb90c'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.8.4',
|
||||
'c65e4cac5a0aa40d1f0487271a72c1526f230ab7b5bb19fe2f1addcd6f0fcacc'],
|
||||
['org.whispersystems:signal-client-java:0.9.0',
|
||||
'9b40d108f783acaef0692be162f461c15fe49507204d5334770f38f90eff5b09'],
|
||||
|
||||
['pl.tajchert:waitingdots:0.1.0',
|
||||
'2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c'],
|
||||
|
|
|
@ -35,7 +35,7 @@ ext {
|
|||
|
||||
JAVA_VERSION = JavaVersion.VERSION_1_8
|
||||
|
||||
LIBSIGNAL_CLIENT_VERSION = '0.8.4'
|
||||
LIBSIGNAL_CLIENT_VERSION = '0.9.0'
|
||||
}
|
||||
|
||||
wrapper {
|
||||
|
|
|
@ -81,7 +81,7 @@ dependencyVerification {
|
|||
['org.greenrobot:eventbus:3.0.0',
|
||||
'180d4212467df06f2fbc9c8d8a2984533ac79c87769ad883bc421612f0b4e17c'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.8.4',
|
||||
'c65e4cac5a0aa40d1f0487271a72c1526f230ab7b5bb19fe2f1addcd6f0fcacc'],
|
||||
['org.whispersystems:signal-client-java:0.9.0',
|
||||
'9b40d108f783acaef0692be162f461c15fe49507204d5334770f38f90eff5b09'],
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.google.protobuf.ByteString;
|
|||
import org.signal.libsignal.metadata.certificate.SenderCertificate;
|
||||
import org.signal.zkgroup.profiles.ClientZkProfileOperations;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.InvalidRegistrationIdException;
|
||||
import org.whispersystems.libsignal.NoSessionException;
|
||||
import org.whispersystems.libsignal.SessionBuilder;
|
||||
import org.whispersystems.libsignal.SignalProtocolAddress;
|
||||
|
@ -31,7 +32,6 @@ import org.whispersystems.signalservice.api.crypto.SignalSessionBuilder;
|
|||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccess;
|
||||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccessPair;
|
||||
import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
|
||||
import org.whispersystems.signalservice.api.messages.InvalidRegistrationIdException;
|
||||
import org.whispersystems.signalservice.api.messages.SendMessageResult;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
|
||||
|
@ -1798,7 +1798,7 @@ public class SignalServiceMessageSender {
|
|||
throw new IOException("Failed to resolve conflicts after " + RETRY_COUNT + " attempts!");
|
||||
}
|
||||
|
||||
private GroupTargetInfo buildGroupTargetInfo(List<SignalServiceAddress> recipients) throws InvalidRegistrationIdException {
|
||||
private GroupTargetInfo buildGroupTargetInfo(List<SignalServiceAddress> recipients) {
|
||||
List<String> addressNames = recipients.stream().map(SignalServiceAddress::getIdentifier).collect(Collectors.toList());
|
||||
Set<SignalProtocolAddress> destinations = store.getAllAddressesWithActiveSessions(addressNames);
|
||||
Map<String, List<Integer>> devicesByAddressName = new HashMap<>();
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.whispersystems.signalservice.api;
|
|||
|
||||
import org.whispersystems.libsignal.SignalProtocolAddress;
|
||||
import org.whispersystems.libsignal.state.SessionStore;
|
||||
import org.whispersystems.signalservice.api.messages.InvalidRegistrationIdException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -13,5 +12,5 @@ import java.util.Set;
|
|||
*/
|
||||
public interface SignalServiceSessionStore extends SessionStore {
|
||||
void archiveSession(SignalProtocolAddress address);
|
||||
Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames) throws InvalidRegistrationIdException;
|
||||
Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(List<String> addressNames);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.signal.libsignal.metadata.certificate.CertificateValidator;
|
|||
import org.signal.libsignal.metadata.certificate.SenderCertificate;
|
||||
import org.signal.libsignal.metadata.protocol.UnidentifiedSenderMessageContent;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.InvalidRegistrationIdException;
|
||||
import org.whispersystems.libsignal.NoSessionException;
|
||||
import org.whispersystems.libsignal.SignalProtocolAddress;
|
||||
import org.whispersystems.libsignal.UntrustedIdentityException;
|
||||
|
@ -45,7 +46,7 @@ public class SignalSealedSessionCipher {
|
|||
}
|
||||
|
||||
public byte[] multiRecipientEncrypt(List<SignalProtocolAddress> recipients, UnidentifiedSenderMessageContent content)
|
||||
throws InvalidKeyException, UntrustedIdentityException, NoSessionException
|
||||
throws InvalidKeyException, UntrustedIdentityException, NoSessionException, InvalidRegistrationIdException
|
||||
{
|
||||
try (SignalSessionLock.Lock unused = lock.acquire()) {
|
||||
return cipher.multiRecipientEncrypt(recipients, content);
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.whispersystems.libsignal.DuplicateMessageException;
|
|||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.InvalidKeyIdException;
|
||||
import org.whispersystems.libsignal.InvalidMessageException;
|
||||
import org.whispersystems.libsignal.InvalidRegistrationIdException;
|
||||
import org.whispersystems.libsignal.InvalidVersionException;
|
||||
import org.whispersystems.libsignal.LegacyMessageException;
|
||||
import org.whispersystems.libsignal.NoSessionException;
|
||||
|
@ -88,7 +89,7 @@ public class SignalServiceCipher {
|
|||
byte[] unpaddedMessage,
|
||||
ContentHint contentHint,
|
||||
byte[] groupId)
|
||||
throws NoSessionException, UntrustedIdentityException, InvalidKeyException
|
||||
throws NoSessionException, UntrustedIdentityException, InvalidKeyException, InvalidRegistrationIdException
|
||||
{
|
||||
PushTransportDetails transport = new PushTransportDetails();
|
||||
SignalProtocolAddress localProtocolAddress = new SignalProtocolAddress(localAddress.getIdentifier(), SignalServiceAddress.DEFAULT_DEVICE_ID);
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package org.whispersystems.signalservice.api.messages;
|
||||
|
||||
/**
|
||||
* Indicates that a session has a bad registration ID.
|
||||
*/
|
||||
public class InvalidRegistrationIdException extends Exception {
|
||||
}
|
|
@ -36,7 +36,7 @@ dependencyVerification {
|
|||
['org.threeten:threetenbp:1.3.6',
|
||||
'f4c23ffaaed717c3b99c003e0ee02d6d66377fd47d866fec7d971bd8644fc1a7'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.8.4',
|
||||
'c65e4cac5a0aa40d1f0487271a72c1526f230ab7b5bb19fe2f1addcd6f0fcacc'],
|
||||
['org.whispersystems:signal-client-java:0.9.0',
|
||||
'9b40d108f783acaef0692be162f461c15fe49507204d5334770f38f90eff5b09'],
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue