Skip to content

Commit

Permalink
[signal] signal-cli 0.12.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dalgwen committed Nov 10, 2023
1 parent c1ef869 commit 4a5bd4d
Show file tree
Hide file tree
Showing 102 changed files with 3,432 additions and 2,044 deletions.
62 changes: 45 additions & 17 deletions bundles/org.openhab.binding.signal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<name>openHAB Add-ons :: Bundles :: Signal Binding</name>

<properties>
<bnd.importpackage>!android.*,!com.android.*,!dalvik.*,!javax.annotation.meta,!org.apache.harmony.xnet.provider.jsse,!org.conscrypt,!sun.security.ssl,!kotlin.*,!org.bouncycastle.jsse.*,!org.openjsse.javax.net.ssl.*,!org.openjsse.net.ssl.*,!com.codahale.metrics.health,!com.codahale.metrics,!io.prometheus.client,!org.bouncycastle.asn1.*,!org.jetbrains.kotlin.*,!org.hibernate,!org.hibernate.*,!okio,!io.micrometer.core,!io.micrometer.core.*,!javassist,!javassist.*,!okhttp3,!org.signal.libsignal.*,!com.squareup.*,org.sqlite;resolution:=optional,org.sqlite.jdbc4;resolution:=optional</bnd.importpackage>
<bnd.importpackage>!android.*,!com.android.*,!dalvik.*,!javax.annotation.meta,!org.apache.harmony.xnet.provider.jsse,!org.conscrypt,!sun.security.ssl,!kotlin.*,!org.bouncycastle.jsse.*,!org.openjsse.javax.net.ssl.*,!org.openjsse.net.ssl.*,!com.codahale.metrics.health,!com.codahale.metrics,!io.prometheus.client,!org.bouncycastle.asn1.*,!org.jetbrains.kotlin.*,!org.hibernate,!org.hibernate.*,!okio,!io.micrometer.core,!io.micrometer.core.*,!javassist,!javassist.*,!okhttp3,!org.signal.*,!com.squareup.*,org.sqlite;resolution:=optional,org.sqlite.jdbc4;resolution:=optional,!com.fasterxml.jackson.module.kotlin,!org.bouncycastle.oer.its.*,!com.google.i18n.phonenumbers</bnd.importpackage>
<dep.noembedding>sqlite-jdbc</dep.noembedding>
<slf4j.version>1.7.32</slf4j.version>
</properties>
Expand All @@ -24,13 +24,24 @@
<dependency>
<artifactId>signal-service-java</artifactId>
<groupId>com.github.turasa</groupId>
<version>2.15.3_unofficial_72</version>
<version>2.15.3_unofficial_86</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.turasa</groupId>
<artifactId>core-util-jvm</artifactId>
<version>2.15.3_unofficial_86</version>
</dependency>
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-runtime-jvm</artifactId>
<version>4.4.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.signal</groupId>
<artifactId>libsignal-client</artifactId>
<version>0.25.0</version>
<version>0.32.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -51,9 +62,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
<groupId>org.bouncycastle</groupId>
<version>1.70</version>
<version>1.76</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -71,44 +82,61 @@
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.12.54</version>
<version>8.13.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-javalite</artifactId>
<version>3.23.0</version>
<version>3.24.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
<version>4.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>2.10.0</version>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.14.1</version>
<scope>provided</scope>
<version>2.15.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.14.1</version>
<scope>provided</scope>
<version>2.15.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
<scope>provided</scope>
<version>2.15.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<version>2.15.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>1.5.32</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava3</groupId>
Expand All @@ -119,13 +147,13 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.6.20</version>
<version>1.9.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
<version>1.6.20</version>
<version>1.9.10</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.asamk.signal.manager.api.AlreadyReceivingException;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.Configuration;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.DeviceLinkUrl;
Expand All @@ -11,17 +12,22 @@
import org.asamk.signal.manager.api.GroupNotFoundException;
import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.Identity;
import org.asamk.signal.manager.api.IdentityVerificationCode;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.InvalidStickerException;
import org.asamk.signal.manager.api.InvalidUsernameException;
import org.asamk.signal.manager.api.LastGroupAdminException;
import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
import org.asamk.signal.manager.api.PinLockedException;
import org.asamk.signal.manager.api.RateLimitException;
import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.Recipient;
import org.asamk.signal.manager.api.RecipientIdentifier;
Expand Down Expand Up @@ -80,13 +86,13 @@ static boolean isSignalClientAvailable() {
* @return A map of numbers to canonicalized number and uuid. If a number is not registered the uuid is null.
* @throws IOException if it's unable to get the contacts to check if they're registered
*/
Map<String, UserStatus> getUserStatus(Set<String> numbers) throws IOException;
Map<String, UserStatus> getUserStatus(Set<String> numbers) throws IOException, RateLimitException;

void updateAccountAttributes(String deviceName) throws IOException;

Configuration getConfiguration();

void updateConfiguration(Configuration configuration) throws IOException, NotPrimaryDeviceException;
void updateConfiguration(Configuration configuration) throws NotPrimaryDeviceException;

/**
* Update the user's profile.
Expand All @@ -106,6 +112,14 @@ static boolean isSignalClientAvailable() {
*/
void deleteUsername() throws IOException;

void startChangeNumber(
String newNumber, boolean voiceVerification, String captcha
) throws RateLimitException, IOException, CaptchaRequiredException, NonNormalizedPhoneNumberException, NotPrimaryDeviceException;

void finishChangeNumber(
String newNumber, String verificationCode, String pin
) throws IncorrectPinException, PinLockedException, IOException, NotPrimaryDeviceException;

void unregister() throws IOException;

void deleteAccount() throws IOException;
Expand All @@ -116,7 +130,7 @@ static boolean isSignalClientAvailable() {

void removeLinkedDevices(int deviceId) throws IOException;

void addDeviceLink(DeviceLinkUrl linkUri) throws IOException, InvalidDeviceLinkException;
void addDeviceLink(DeviceLinkUrl linkUri) throws IOException, InvalidDeviceLinkException, NotPrimaryDeviceException;

void setRegistrationLockPin(Optional<String> pin) throws IOException, NotPrimaryDeviceException;

Expand Down Expand Up @@ -146,11 +160,11 @@ SendMessageResults sendTypingMessage(

SendMessageResults sendReadReceipt(
RecipientIdentifier.Single sender, List<Long> messageIds
) throws IOException;
);

SendMessageResults sendViewedReceipt(
RecipientIdentifier.Single sender, List<Long> messageIds
) throws IOException;
);

SendMessageResults sendMessage(
Message message, Set<RecipientIdentifier> recipients
Expand Down Expand Up @@ -185,7 +199,7 @@ SendMessageResults sendPaymentNotificationMessage(

void setContactName(
RecipientIdentifier.Single recipient, String givenName, final String familyName
) throws NotPrimaryDeviceException, IOException, UnregisteredRecipientException;
) throws NotPrimaryDeviceException, UnregisteredRecipientException;

void setContactsBlocked(
Collection<RecipientIdentifier.Single> recipient, boolean blocked
Expand All @@ -210,6 +224,8 @@ void setExpirationTimer(
*/
StickerPackUrl uploadStickerPack(File path) throws IOException, StickerPackInvalidException;

void installStickerPack(StickerPackUrl url) throws IOException;

List<StickerPack> getStickerPacks();

void requestAllSyncData() throws IOException;
Expand Down Expand Up @@ -261,33 +277,12 @@ List<Recipient> getRecipients(
List<Identity> getIdentities(RecipientIdentifier.Single recipient);

/**
* Trust this the identity with this fingerprint
* Trust this the identity with this fingerprint/safetyNumber
*
* @param recipient account of the identity
* @param fingerprint Fingerprint
* @param recipient account of the identity
*/
boolean trustIdentityVerified(
RecipientIdentifier.Single recipient, byte[] fingerprint
) throws UnregisteredRecipientException;

/**
* Trust this the identity with this safety number
*
* @param recipient account of the identity
* @param safetyNumber Safety number
*/
boolean trustIdentityVerifiedSafetyNumber(
RecipientIdentifier.Single recipient, String safetyNumber
) throws UnregisteredRecipientException;

/**
* Trust this the identity with this scannable safety number
*
* @param recipient account of the identity
* @param safetyNumber Scannable safety number
*/
boolean trustIdentityVerifiedSafetyNumber(
RecipientIdentifier.Single recipient, byte[] safetyNumber
RecipientIdentifier.Single recipient, IdentityVerificationCode verificationCode
) throws UnregisteredRecipientException;

/**
Expand All @@ -304,7 +299,7 @@ boolean trustIdentityVerifiedSafetyNumber(
InputStream retrieveAttachment(final String id) throws IOException;

@Override
void close() throws IOException;
void close();

interface ReceiveMessageHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

public record Settings(TrustNewIdentity trustNewIdentity, boolean disableMessageSendLog) {

public static Settings DEFAULT = new Settings(TrustNewIdentity.ON_FIRST_USE, false);
public static final Settings DEFAULT = new Settings(TrustNewIdentity.ON_FIRST_USE, false);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.accounts.AccountsStore;
import org.asamk.signal.manager.util.KeyUtils;
import org.signal.libsignal.protocol.util.KeyHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
Expand Down Expand Up @@ -160,8 +159,6 @@ public RegistrationManager initRegistrationManager(
final var newAccountPath = accountPath == null ? accountsStore.addAccount(number, null) : accountPath;
var aciIdentityKey = KeyUtils.generateIdentityKeyPair();
var pniIdentityKey = KeyUtils.generateIdentityKeyPair();
var registrationId = KeyHelper.generateRegistrationId(false);
var pniRegistrationId = KeyHelper.generateRegistrationId(false);

var profileKey = KeyUtils.createProfileKey();
var account = SignalAccount.create(pathConfig.dataPath(),
Expand All @@ -170,8 +167,6 @@ public RegistrationManager initRegistrationManager(
serviceEnvironment,
aciIdentityKey,
pniIdentityKey,
registrationId,
pniRegistrationId,
profileKey,
settings);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ public class RenewSessionAction implements HandleAction {

private final RecipientId recipientId;
private final ServiceId serviceId;
private final ServiceId accountId;

public RenewSessionAction(final RecipientId recipientId, final ServiceId serviceId) {
public RenewSessionAction(final RecipientId recipientId, final ServiceId serviceId, final ServiceId accountId) {
this.recipientId = recipientId;
this.serviceId = serviceId;
this.accountId = accountId;
}

@Override
public void execute(Context context) throws Throwable {
context.getAccount().getAciSessionStore().archiveSessions(serviceId);
context.getAccount().getAccountData(accountId).getSessionStore().archiveSessions(serviceId);
if (!recipientId.equals(context.getAccount().getSelfRecipientId())) {
context.getSendHelper().sendNullMessage(recipientId);
}
Expand Down
Loading

0 comments on commit 4a5bd4d

Please sign in to comment.