diff --git a/lib/src/main/java/org/asamk/signal/manager/Manager.java b/lib/src/main/java/org/asamk/signal/manager/Manager.java
index 6a5e43f5..2e23564b 100644
--- a/lib/src/main/java/org/asamk/signal/manager/Manager.java
+++ b/lib/src/main/java/org/asamk/signal/manager/Manager.java
@@ -5,13 +5,19 @@ import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.Configuration;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.Group;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+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.InactiveGroupLinkException;
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.NotAGroupMemberException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
@@ -28,12 +34,8 @@ import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
import java.io.Closeable;
@@ -54,6 +56,21 @@ public interface Manager extends Closeable {
return PhoneNumberFormatter.isValidNumber(e164Number, countryCode);
}
+ static boolean isSignalClientAvailable() {
+ final Logger logger = LoggerFactory.getLogger(Manager.class);
+ try {
+ try {
+ org.signal.libsignal.internal.Native.UuidCiphertext_CheckValidContents(new byte[0]);
+ } catch (Exception e) {
+ logger.trace("Expected exception when checking libsignal-client: {}", e.getMessage());
+ }
+ return true;
+ } catch (UnsatisfiedLinkError e) {
+ logger.warn("Failed to call libsignal-client: {}", e.getMessage());
+ return false;
+ }
+ }
+
String getSelfNumber();
/**
diff --git a/lib/src/main/java/org/asamk/signal/manager/ManagerLogger.java b/lib/src/main/java/org/asamk/signal/manager/ManagerLogger.java
index e5dc2c0d..c8437882 100644
--- a/lib/src/main/java/org/asamk/signal/manager/ManagerLogger.java
+++ b/lib/src/main/java/org/asamk/signal/manager/ManagerLogger.java
@@ -1,5 +1,7 @@
package org.asamk.signal.manager;
+import org.asamk.signal.manager.internal.LibSignalLogger;
+
public class ManagerLogger {
public static void initLogger() {
diff --git a/lib/src/main/java/org/asamk/signal/manager/Settings.java b/lib/src/main/java/org/asamk/signal/manager/Settings.java
index e4f4554b..87854514 100644
--- a/lib/src/main/java/org/asamk/signal/manager/Settings.java
+++ b/lib/src/main/java/org/asamk/signal/manager/Settings.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager;
-import org.asamk.signal.manager.storage.identities.TrustNewIdentity;
+import org.asamk.signal.manager.api.TrustNewIdentity;
public record Settings(TrustNewIdentity trustNewIdentity, boolean disableMessageSendLog) {
diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java b/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java
index 12eb3d99..da8a3f3a 100644
--- a/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java
+++ b/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java
@@ -2,9 +2,15 @@ package org.asamk.signal.manager;
import org.asamk.signal.manager.api.AccountCheckException;
import org.asamk.signal.manager.api.NotRegisteredException;
+import org.asamk.signal.manager.api.ServiceEnvironment;
import org.asamk.signal.manager.config.ServiceConfig;
-import org.asamk.signal.manager.config.ServiceEnvironment;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
+import org.asamk.signal.manager.internal.AccountFileUpdaterImpl;
+import org.asamk.signal.manager.internal.ManagerImpl;
+import org.asamk.signal.manager.internal.MultiAccountManagerImpl;
+import org.asamk.signal.manager.internal.PathConfig;
+import org.asamk.signal.manager.internal.ProvisioningManagerImpl;
+import org.asamk.signal.manager.internal.RegistrationManagerImpl;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.accounts.AccountsStore;
import org.asamk.signal.manager.util.KeyUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoAction.java b/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoAction.java
index 1f76f13e..2a39a38a 100644
--- a/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoAction.java
+++ b/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoAction.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.actions;
-import org.asamk.signal.manager.groups.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV1;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
diff --git a/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoRequestAction.java b/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoRequestAction.java
index 19bf8193..e9dc2528 100644
--- a/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoRequestAction.java
+++ b/lib/src/main/java/org/asamk/signal/manager/actions/SendGroupInfoRequestAction.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.actions;
-import org.asamk.signal.manager.groups.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV1;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
diff --git a/lib/src/main/java/org/asamk/signal/manager/actions/SendRetryMessageRequestAction.java b/lib/src/main/java/org/asamk/signal/manager/actions/SendRetryMessageRequestAction.java
index 7c0562cc..2300eae9 100644
--- a/lib/src/main/java/org/asamk/signal/manager/actions/SendRetryMessageRequestAction.java
+++ b/lib/src/main/java/org/asamk/signal/manager/actions/SendRetryMessageRequestAction.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.actions;
-import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.metadata.ProtocolException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Contact.java b/lib/src/main/java/org/asamk/signal/manager/api/Contact.java
similarity index 98%
rename from lib/src/main/java/org/asamk/signal/manager/storage/recipients/Contact.java
rename to lib/src/main/java/org/asamk/signal/manager/api/Contact.java
index a1091b45..27c2d4da 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Contact.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/Contact.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.storage.recipients;
+package org.asamk.signal.manager.api;
import org.whispersystems.signalservice.internal.util.Util;
diff --git a/lib/src/main/java/org/asamk/signal/manager/api/Group.java b/lib/src/main/java/org/asamk/signal/manager/api/Group.java
index 62f39290..5e7e36f8 100644
--- a/lib/src/main/java/org/asamk/signal/manager/api/Group.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/Group.java
@@ -1,8 +1,5 @@
package org.asamk.signal.manager.api;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupPermission;
import org.asamk.signal.manager.helper.RecipientAddressResolver;
import org.asamk.signal.manager.storage.groups.GroupInfo;
import org.asamk.signal.manager.storage.recipients.RecipientId;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupId.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupId.java
similarity index 97%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupId.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupId.java
index 38ddd4b6..3095392f 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupId.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupId.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
import java.util.Arrays;
import java.util.Base64;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdFormatException.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdFormatException.java
similarity index 85%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupIdFormatException.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupIdFormatException.java
index 8050da22..c76a7ef1 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdFormatException.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdFormatException.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public class GroupIdFormatException extends Exception {
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV1.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdV1.java
similarity index 91%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV1.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupIdV1.java
index acec587b..90e5dde4 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV1.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdV1.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
import java.util.Base64;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV2.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdV2.java
similarity index 86%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV2.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupIdV2.java
index 35aac330..44cda276 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupIdV2.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupIdV2.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
import java.util.Base64;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupInviteLinkUrl.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupInviteLinkUrl.java
similarity index 98%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupInviteLinkUrl.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupInviteLinkUrl.java
index 3425d95e..b21aeb97 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupInviteLinkUrl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupInviteLinkUrl.java
@@ -1,7 +1,8 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
import com.google.protobuf.ByteString;
+import org.asamk.signal.manager.groups.GroupLinkPassword;
import org.signal.libsignal.zkgroup.InvalidInputException;
import org.signal.libsignal.zkgroup.groups.GroupMasterKey;
import org.signal.storageservice.protos.groups.GroupInviteLink;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupLinkState.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupLinkState.java
similarity index 67%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupLinkState.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupLinkState.java
index ad567fbf..899e8587 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupLinkState.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupLinkState.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public enum GroupLinkState {
ENABLED,
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupNotFoundException.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupNotFoundException.java
similarity index 81%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupNotFoundException.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupNotFoundException.java
index 0fc0c444..052354a3 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupNotFoundException.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupNotFoundException.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public class GroupNotFoundException extends Exception {
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupPermission.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupPermission.java
similarity index 62%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupPermission.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupPermission.java
index 00366497..db6f2ecd 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupPermission.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupPermission.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public enum GroupPermission {
EVERY_MEMBER,
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupSendingNotAllowedException.java b/lib/src/main/java/org/asamk/signal/manager/api/GroupSendingNotAllowedException.java
similarity index 86%
rename from lib/src/main/java/org/asamk/signal/manager/groups/GroupSendingNotAllowedException.java
rename to lib/src/main/java/org/asamk/signal/manager/api/GroupSendingNotAllowedException.java
index 1a2fa432..e328e341 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupSendingNotAllowedException.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/GroupSendingNotAllowedException.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public class GroupSendingNotAllowedException extends Exception {
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/LastGroupAdminException.java b/lib/src/main/java/org/asamk/signal/manager/api/LastGroupAdminException.java
similarity index 85%
rename from lib/src/main/java/org/asamk/signal/manager/groups/LastGroupAdminException.java
rename to lib/src/main/java/org/asamk/signal/manager/api/LastGroupAdminException.java
index 28c52fad..69d2ffb7 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/LastGroupAdminException.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/LastGroupAdminException.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public class LastGroupAdminException extends Exception {
diff --git a/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java b/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java
index aba52179..9cc34aba 100644
--- a/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java
@@ -1,6 +1,5 @@
package org.asamk.signal.manager.api;
-import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.manager.helper.RecipientAddressResolver;
import org.asamk.signal.manager.storage.recipients.RecipientResolver;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/NotAGroupMemberException.java b/lib/src/main/java/org/asamk/signal/manager/api/NotAGroupMemberException.java
similarity index 85%
rename from lib/src/main/java/org/asamk/signal/manager/groups/NotAGroupMemberException.java
rename to lib/src/main/java/org/asamk/signal/manager/api/NotAGroupMemberException.java
index 08cbcacd..6c188da3 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/NotAGroupMemberException.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/NotAGroupMemberException.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.groups;
+package org.asamk.signal.manager.api;
public class NotAGroupMemberException extends Exception {
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Profile.java b/lib/src/main/java/org/asamk/signal/manager/api/Profile.java
similarity index 97%
rename from lib/src/main/java/org/asamk/signal/manager/storage/recipients/Profile.java
rename to lib/src/main/java/org/asamk/signal/manager/api/Profile.java
index 909337b7..3eb58a55 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Profile.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/Profile.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.storage.recipients;
+package org.asamk.signal.manager.api;
import org.whispersystems.signalservice.internal.util.Util;
@@ -142,7 +142,7 @@ public class Profile {
ENABLED,
UNRESTRICTED;
- static UnidentifiedAccessMode valueOfOrUnknown(String value) {
+ public static UnidentifiedAccessMode valueOfOrUnknown(String value) {
try {
return valueOf(value);
} catch (IllegalArgumentException ignored) {
@@ -157,7 +157,7 @@ public class Profile {
senderKey,
announcementGroup;
- static Capability valueOfOrNull(String value) {
+ public static Capability valueOfOrNull(String value) {
try {
return valueOf(value);
} catch (IllegalArgumentException ignored) {
diff --git a/lib/src/main/java/org/asamk/signal/manager/api/Recipient.java b/lib/src/main/java/org/asamk/signal/manager/api/Recipient.java
index 1aea3c45..52b68e58 100644
--- a/lib/src/main/java/org/asamk/signal/manager/api/Recipient.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/Recipient.java
@@ -1,7 +1,5 @@
package org.asamk.signal.manager.api;
-import org.asamk.signal.manager.storage.recipients.Contact;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
diff --git a/lib/src/main/java/org/asamk/signal/manager/api/RecipientIdentifier.java b/lib/src/main/java/org/asamk/signal/manager/api/RecipientIdentifier.java
index d8952ec0..fc822058 100644
--- a/lib/src/main/java/org/asamk/signal/manager/api/RecipientIdentifier.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/RecipientIdentifier.java
@@ -1,6 +1,5 @@
package org.asamk.signal.manager.api;
-import org.asamk.signal.manager.groups.GroupId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
diff --git a/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironment.java b/lib/src/main/java/org/asamk/signal/manager/api/ServiceEnvironment.java
similarity index 59%
rename from lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironment.java
rename to lib/src/main/java/org/asamk/signal/manager/api/ServiceEnvironment.java
index d83bf7d2..e3499827 100644
--- a/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironment.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/ServiceEnvironment.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.config;
+package org.asamk.signal.manager.api;
public enum ServiceEnvironment {
LIVE,
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/identities/TrustNewIdentity.java b/lib/src/main/java/org/asamk/signal/manager/api/TrustNewIdentity.java
similarity index 58%
rename from lib/src/main/java/org/asamk/signal/manager/storage/identities/TrustNewIdentity.java
rename to lib/src/main/java/org/asamk/signal/manager/api/TrustNewIdentity.java
index b2db73a3..e86c11d9 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/identities/TrustNewIdentity.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/TrustNewIdentity.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager.storage.identities;
+package org.asamk.signal.manager.api;
public enum TrustNewIdentity {
ALWAYS,
diff --git a/lib/src/main/java/org/asamk/signal/manager/api/UpdateGroup.java b/lib/src/main/java/org/asamk/signal/manager/api/UpdateGroup.java
index 0a2cb5ee..c1ba4270 100644
--- a/lib/src/main/java/org/asamk/signal/manager/api/UpdateGroup.java
+++ b/lib/src/main/java/org/asamk/signal/manager/api/UpdateGroup.java
@@ -1,8 +1,5 @@
package org.asamk.signal.manager.api;
-import org.asamk.signal.manager.groups.GroupLinkState;
-import org.asamk.signal.manager.groups.GroupPermission;
-
import java.util.Set;
public class UpdateGroup {
diff --git a/lib/src/main/java/org/asamk/signal/manager/config/ServiceConfig.java b/lib/src/main/java/org/asamk/signal/manager/config/ServiceConfig.java
index 7100c326..b2b45a9c 100644
--- a/lib/src/main/java/org/asamk/signal/manager/config/ServiceConfig.java
+++ b/lib/src/main/java/org/asamk/signal/manager/config/ServiceConfig.java
@@ -1,7 +1,6 @@
package org.asamk.signal.manager.config;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.asamk.signal.manager.api.ServiceEnvironment;
import org.whispersystems.signalservice.api.account.AccountAttributes;
import org.whispersystems.signalservice.api.push.TrustStore;
@@ -16,8 +15,6 @@ import okhttp3.Interceptor;
public class ServiceConfig {
- private final static Logger logger = LoggerFactory.getLogger(ServiceConfig.class);
-
public final static int PREKEY_MINIMUM_COUNT = 20;
public final static int PREKEY_BATCH_SIZE = 100;
public final static int MAX_ATTACHMENT_SIZE = 150 * 1024 * 1024;
@@ -47,20 +44,6 @@ public class ServiceConfig {
return new AccountAttributes.Capabilities(false, true, true, true, true, giftBadges, false, false);
}
- public static boolean isSignalClientAvailable() {
- try {
- try {
- org.signal.libsignal.internal.Native.UuidCiphertext_CheckValidContents(new byte[0]);
- } catch (Exception e) {
- logger.trace("Expected exception when checking libsignal-client: {}", e.getMessage());
- }
- return true;
- } catch (UnsatisfiedLinkError e) {
- logger.warn("Failed to call libsignal-client: {}", e.getMessage());
- return false;
- }
- }
-
public static KeyStore getIasKeyStore() {
return iasKeyStore;
}
diff --git a/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironmentConfig.java b/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironmentConfig.java
index 0ca2c914..2a95f34f 100644
--- a/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironmentConfig.java
+++ b/lib/src/main/java/org/asamk/signal/manager/config/ServiceEnvironmentConfig.java
@@ -1,5 +1,6 @@
package org.asamk.signal.manager.config;
+import org.asamk.signal.manager.api.ServiceEnvironment;
import org.signal.libsignal.protocol.ecc.ECPublicKey;
import org.whispersystems.signalservice.internal.configuration.SignalServiceConfiguration;
diff --git a/lib/src/main/java/org/asamk/signal/manager/groups/GroupUtils.java b/lib/src/main/java/org/asamk/signal/manager/groups/GroupUtils.java
index 356fb984..b73be0ab 100644
--- a/lib/src/main/java/org/asamk/signal/manager/groups/GroupUtils.java
+++ b/lib/src/main/java/org/asamk/signal/manager/groups/GroupUtils.java
@@ -1,5 +1,8 @@
package org.asamk.signal.manager.groups;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV2;
import org.asamk.signal.manager.storage.groups.GroupInfo;
import org.asamk.signal.manager.storage.groups.GroupInfoV1;
import org.asamk.signal.manager.storage.groups.GroupInfoV2;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java
index 3bff549d..286e477e 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/AccountHelper.java
@@ -1,13 +1,13 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.DeviceLinkInfo;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
import org.asamk.signal.manager.api.PinLockedException;
import org.asamk.signal.manager.api.RateLimitException;
+import org.asamk.signal.manager.internal.DeviceLinkInfo;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.util.KeyUtils;
import org.asamk.signal.manager.util.NumberVerificationUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/AttachmentHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/AttachmentHelper.java
index 9250927d..7c2d9089 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/AttachmentHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/AttachmentHelper.java
@@ -1,9 +1,9 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.AttachmentStore;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.config.ServiceConfig;
+import org.asamk.signal.manager.internal.SignalDependencies;
+import org.asamk.signal.manager.storage.AttachmentStore;
import org.asamk.signal.manager.util.AttachmentUtils;
import org.asamk.signal.manager.util.IOUtils;
import org.signal.libsignal.protocol.InvalidMessageException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/ContactHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/ContactHelper.java
index f43d083c..80df9447 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/ContactHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/ContactHelper.java
@@ -1,7 +1,7 @@
package org.asamk.signal.manager.helper;
+import org.asamk.signal.manager.api.Contact;
import org.asamk.signal.manager.storage.SignalAccount;
-import org.asamk.signal.manager.storage.recipients.Contact;
import org.asamk.signal.manager.storage.recipients.RecipientId;
public class ContactHelper {
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/Context.java b/lib/src/main/java/org/asamk/signal/manager/helper/Context.java
index 7ff8bd64..2caeb0fb 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/Context.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/Context.java
@@ -1,9 +1,9 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.AttachmentStore;
-import org.asamk.signal.manager.AvatarStore;
-import org.asamk.signal.manager.JobExecutor;
-import org.asamk.signal.manager.SignalDependencies;
+import org.asamk.signal.manager.internal.JobExecutor;
+import org.asamk.signal.manager.internal.SignalDependencies;
+import org.asamk.signal.manager.storage.AttachmentStore;
+import org.asamk.signal.manager.storage.AvatarStore;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.stickerPacks.StickerPackStore;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java
index 5658dc25..d987d3d1 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java
@@ -1,24 +1,24 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.AttachmentInvalidException;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV2;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupLinkState;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupPermission;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
+import org.asamk.signal.manager.api.LastGroupAdminException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
import org.asamk.signal.manager.api.SendGroupMessageResults;
import org.asamk.signal.manager.api.SendMessageResult;
import org.asamk.signal.manager.config.ServiceConfig;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupIdV1;
-import org.asamk.signal.manager.groups.GroupIdV2;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupLinkState;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupPermission;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
import org.asamk.signal.manager.groups.GroupUtils;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfo;
import org.asamk.signal.manager.storage.groups.GroupInfoV1;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/GroupV2Helper.java b/lib/src/main/java/org/asamk/signal/manager/helper/GroupV2Helper.java
index e410d232..85462e19 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/GroupV2Helper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/GroupV2Helper.java
@@ -3,13 +3,13 @@ package org.asamk.signal.manager.helper;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
-import org.asamk.signal.manager.SignalDependencies;
+import org.asamk.signal.manager.api.GroupLinkState;
+import org.asamk.signal.manager.api.GroupPermission;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.groups.GroupLinkPassword;
-import org.asamk.signal.manager.groups.GroupLinkState;
-import org.asamk.signal.manager.groups.GroupPermission;
import org.asamk.signal.manager.groups.GroupUtils;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.groups.GroupInfoV2;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.util.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java b/lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java
index d0a6a5c0..3b616644 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java
@@ -1,7 +1,6 @@
package org.asamk.signal.manager.helper;
import org.asamk.signal.manager.Manager;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.actions.HandleAction;
import org.asamk.signal.manager.actions.RefreshPreKeysAction;
import org.asamk.signal.manager.actions.RenewSessionAction;
@@ -19,19 +18,20 @@ import org.asamk.signal.manager.actions.SendSyncContactsAction;
import org.asamk.signal.manager.actions.SendSyncGroupsAction;
import org.asamk.signal.manager.actions.SendSyncKeysAction;
import org.asamk.signal.manager.actions.UpdateAccountAttributesAction;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupNotFoundException;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.Pair;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.StickerPackId;
import org.asamk.signal.manager.api.TrustLevel;
import org.asamk.signal.manager.api.UntrustedIdentityException;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.manager.groups.GroupUtils;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.jobs.RetrieveStickerPackJob;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfoV1;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.stickers.StickerPack;
import org.signal.libsignal.metadata.ProtocolInvalidKeyException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/PreKeyHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/PreKeyHelper.java
index 30ab919e..24cd675c 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/PreKeyHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/PreKeyHelper.java
@@ -1,7 +1,7 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.config.ServiceConfig;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.util.KeyUtils;
import org.signal.libsignal.protocol.IdentityKeyPair;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java
index da7440ed..6d5f2aa1 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java
@@ -1,12 +1,12 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.config.ServiceConfig;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfoV2;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.util.IOUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/ReceiveHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/ReceiveHelper.java
index d0ebbc95..b2262223 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/ReceiveHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/ReceiveHelper.java
@@ -1,10 +1,10 @@
package org.asamk.signal.manager.helper;
import org.asamk.signal.manager.Manager;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.actions.HandleAction;
import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.UntrustedIdentityException;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.messageCache.CachedMessage;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java
index f614d7ec..384d1fa0 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java
@@ -1,9 +1,9 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.usernames.BaseUsernameException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java
index a410c2c9..36c4f0d5 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java
@@ -2,17 +2,17 @@ package org.asamk.signal.manager.helper;
import com.google.protobuf.ByteString;
-import org.asamk.signal.manager.SignalDependencies;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
import org.asamk.signal.manager.groups.GroupUtils;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfo;
-import org.asamk.signal.manager.storage.recipients.Contact;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.sendLog.MessageSendLogEntry;
import org.signal.libsignal.protocol.InvalidKeyException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/StickerHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/StickerHelper.java
index c67a6573..915f3d71 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/StickerHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/StickerHelper.java
@@ -1,8 +1,8 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.InvalidStickerException;
import org.asamk.signal.manager.api.StickerPackId;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.stickerPacks.JsonStickerPack;
import org.asamk.signal.manager.util.IOUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/StorageHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/StorageHelper.java
index 50eceb67..fc084f28 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/StorageHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/StorageHelper.java
@@ -1,12 +1,12 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.PhoneNumberSharingMode;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.api.TrustLevel;
-import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
-import org.asamk.signal.manager.storage.recipients.Contact;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.signal.libsignal.protocol.IdentityKey;
import org.signal.libsignal.protocol.InvalidKeyException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/SyncHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/SyncHelper.java
index a005f07d..f015cb1f 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/SyncHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/SyncHelper.java
@@ -1,10 +1,10 @@
package org.asamk.signal.manager.helper;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.TrustLevel;
-import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfoV1;
-import org.asamk.signal.manager.storage.recipients.Contact;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.util.AttachmentUtils;
import org.asamk.signal.manager.util.IOUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java
index 92031576..bc02e319 100644
--- a/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java
+++ b/lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java
@@ -1,9 +1,9 @@
package org.asamk.signal.manager.helper;
-import org.asamk.signal.manager.SignalDependencies;
import org.asamk.signal.manager.api.PhoneNumberSharingMode;
+import org.asamk.signal.manager.api.Profile;
+import org.asamk.signal.manager.internal.SignalDependencies;
import org.asamk.signal.manager.storage.SignalAccount;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.metadata.certificate.InvalidCertificateException;
import org.signal.libsignal.metadata.certificate.SenderCertificate;
diff --git a/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java b/lib/src/main/java/org/asamk/signal/manager/internal/AccountFileUpdaterImpl.java
similarity index 86%
rename from lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/AccountFileUpdaterImpl.java
index af0008c3..5c99d0c1 100644
--- a/lib/src/main/java/org/asamk/signal/manager/AccountFileUpdaterImpl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/AccountFileUpdaterImpl.java
@@ -1,10 +1,10 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.asamk.signal.manager.helper.AccountFileUpdater;
import org.asamk.signal.manager.storage.accounts.AccountsStore;
import org.whispersystems.signalservice.api.push.ACI;
-class AccountFileUpdaterImpl implements AccountFileUpdater {
+public class AccountFileUpdaterImpl implements AccountFileUpdater {
private final AccountsStore accountsStore;
private final String accountPath;
diff --git a/lib/src/main/java/org/asamk/signal/manager/DeviceLinkInfo.java b/lib/src/main/java/org/asamk/signal/manager/internal/DeviceLinkInfo.java
similarity index 98%
rename from lib/src/main/java/org/asamk/signal/manager/DeviceLinkInfo.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/DeviceLinkInfo.java
index 356cb47d..50f04026 100644
--- a/lib/src/main/java/org/asamk/signal/manager/DeviceLinkInfo.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/DeviceLinkInfo.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.util.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/JobExecutor.java b/lib/src/main/java/org/asamk/signal/manager/internal/JobExecutor.java
similarity index 87%
rename from lib/src/main/java/org/asamk/signal/manager/JobExecutor.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/JobExecutor.java
index 12ade9ca..8a3e815f 100644
--- a/lib/src/main/java/org/asamk/signal/manager/JobExecutor.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/JobExecutor.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.asamk.signal.manager.helper.Context;
import org.asamk.signal.manager.jobs.Job;
diff --git a/lib/src/main/java/org/asamk/signal/manager/LibSignalLogger.java b/lib/src/main/java/org/asamk/signal/manager/internal/LibSignalLogger.java
similarity index 92%
rename from lib/src/main/java/org/asamk/signal/manager/LibSignalLogger.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/LibSignalLogger.java
index 7942c194..66a480e9 100644
--- a/lib/src/main/java/org/asamk/signal/manager/LibSignalLogger.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/LibSignalLogger.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.signal.libsignal.protocol.logging.SignalProtocolLogger;
import org.signal.libsignal.protocol.logging.SignalProtocolLoggerProvider;
@@ -9,7 +9,7 @@ public class LibSignalLogger implements SignalProtocolLogger {
private final static Logger logger = LoggerFactory.getLogger("LibSignal");
- static void initLogger() {
+ public static void initLogger() {
SignalProtocolLoggerProvider.setProvider(new LibSignalLogger());
}
diff --git a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/internal/ManagerImpl.java
similarity index 98%
rename from lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/ManagerImpl.java
index 1db3cbc7..7e6a3972 100644
--- a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/ManagerImpl.java
@@ -14,23 +14,31 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
+import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.AlreadyReceivingException;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.Configuration;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.Group;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+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.InactiveGroupLinkException;
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.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.Profile;
import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.Recipient;
import org.asamk.signal.manager.api.RecipientIdentifier;
@@ -47,18 +55,13 @@ import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.manager.helper.AccountFileUpdater;
import org.asamk.signal.manager.helper.Context;
+import org.asamk.signal.manager.storage.AttachmentStore;
+import org.asamk.signal.manager.storage.AvatarStore;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfo;
import org.asamk.signal.manager.storage.identities.IdentityInfo;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.stickerPacks.JsonStickerPack;
import org.asamk.signal.manager.storage.stickerPacks.StickerPackStore;
@@ -110,7 +113,7 @@ import java.util.stream.Stream;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
-class ManagerImpl implements Manager {
+public class ManagerImpl implements Manager {
private final static Logger logger = LoggerFactory.getLogger(ManagerImpl.class);
@@ -128,7 +131,7 @@ class ManagerImpl implements Manager {
private final List addressChangedListeners = new ArrayList<>();
private final CompositeDisposable disposable = new CompositeDisposable();
- ManagerImpl(
+ public ManagerImpl(
SignalAccount account,
PathConfig pathConfig,
AccountFileUpdater accountFileUpdater,
@@ -200,7 +203,7 @@ class ManagerImpl implements Manager {
return account.getNumber();
}
- void checkAccountState() throws IOException {
+ public void checkAccountState() throws IOException {
context.getAccountHelper().checkAccountState();
}
diff --git a/lib/src/main/java/org/asamk/signal/manager/MultiAccountManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/internal/MultiAccountManagerImpl.java
similarity index 91%
rename from lib/src/main/java/org/asamk/signal/manager/MultiAccountManagerImpl.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/MultiAccountManagerImpl.java
index 072e965b..0461254a 100644
--- a/lib/src/main/java/org/asamk/signal/manager/MultiAccountManagerImpl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/MultiAccountManagerImpl.java
@@ -1,5 +1,10 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
+import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.MultiAccountManager;
+import org.asamk.signal.manager.ProvisioningManager;
+import org.asamk.signal.manager.RegistrationManager;
+import org.asamk.signal.manager.SignalAccountFiles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -15,7 +20,7 @@ import java.util.Set;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
-class MultiAccountManagerImpl implements MultiAccountManager {
+public class MultiAccountManagerImpl implements MultiAccountManager {
private final static Logger logger = LoggerFactory.getLogger(MultiAccountManagerImpl.class);
diff --git a/lib/src/main/java/org/asamk/signal/manager/PathConfig.java b/lib/src/main/java/org/asamk/signal/manager/internal/PathConfig.java
similarity index 71%
rename from lib/src/main/java/org/asamk/signal/manager/PathConfig.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/PathConfig.java
index f3bacdc3..1c7a80f3 100644
--- a/lib/src/main/java/org/asamk/signal/manager/PathConfig.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/PathConfig.java
@@ -1,12 +1,12 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import java.io.File;
-record PathConfig(
+public record PathConfig(
File dataPath, File attachmentsPath, File avatarsPath, File stickerPacksPath
) {
- static PathConfig createDefault(final File settingsPath) {
+ public static PathConfig createDefault(final File settingsPath) {
return new PathConfig(new File(settingsPath, "data"),
new File(settingsPath, "attachments"),
new File(settingsPath, "avatars"),
diff --git a/lib/src/main/java/org/asamk/signal/manager/ProvisioningManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/internal/ProvisioningManagerImpl.java
similarity index 97%
rename from lib/src/main/java/org/asamk/signal/manager/ProvisioningManagerImpl.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/ProvisioningManagerImpl.java
index 544032da..d372a27e 100644
--- a/lib/src/main/java/org/asamk/signal/manager/ProvisioningManagerImpl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/ProvisioningManagerImpl.java
@@ -14,8 +14,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
+import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.ProvisioningManager;
+import org.asamk.signal.manager.Settings;
import org.asamk.signal.manager.api.UserAlreadyExistsException;
import org.asamk.signal.manager.config.ServiceConfig;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
@@ -43,7 +46,7 @@ import java.util.function.Consumer;
import static org.asamk.signal.manager.config.ServiceConfig.getCapabilities;
-class ProvisioningManagerImpl implements ProvisioningManager {
+public class ProvisioningManagerImpl implements ProvisioningManager {
private final static Logger logger = LoggerFactory.getLogger(ProvisioningManagerImpl.class);
@@ -59,7 +62,7 @@ class ProvisioningManagerImpl implements ProvisioningManager {
private final int pniRegistrationId;
private final String password;
- ProvisioningManagerImpl(
+ public ProvisioningManagerImpl(
PathConfig pathConfig,
ServiceEnvironmentConfig serviceEnvironmentConfig,
String userAgent,
diff --git a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/internal/RegistrationManagerImpl.java
similarity index 97%
rename from lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/RegistrationManagerImpl.java
index 0e3c9af0..eb51b715 100644
--- a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/RegistrationManagerImpl.java
@@ -14,8 +14,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
+import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.RegistrationManager;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
@@ -46,7 +48,7 @@ import org.whispersystems.signalservice.internal.util.DynamicCredentialsProvider
import java.io.IOException;
import java.util.function.Consumer;
-class RegistrationManagerImpl implements RegistrationManager {
+public class RegistrationManagerImpl implements RegistrationManager {
private final static Logger logger = LoggerFactory.getLogger(RegistrationManagerImpl.class);
@@ -60,7 +62,7 @@ class RegistrationManagerImpl implements RegistrationManager {
private final PinHelper pinHelper;
private final AccountFileUpdater accountFileUpdater;
- RegistrationManagerImpl(
+ public RegistrationManagerImpl(
SignalAccount account,
PathConfig pathConfig,
ServiceEnvironmentConfig serviceEnvironmentConfig,
diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java b/lib/src/main/java/org/asamk/signal/manager/internal/SignalDependencies.java
similarity index 99%
rename from lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/SignalDependencies.java
index 7a8ecc4b..bf2f76df 100644
--- a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/SignalDependencies.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.asamk.signal.manager.config.ServiceConfig;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalWebSocketHealthMonitor.java b/lib/src/main/java/org/asamk/signal/manager/internal/SignalWebSocketHealthMonitor.java
similarity index 99%
rename from lib/src/main/java/org/asamk/signal/manager/SignalWebSocketHealthMonitor.java
rename to lib/src/main/java/org/asamk/signal/manager/internal/SignalWebSocketHealthMonitor.java
index 95d12674..f4ac35e2 100644
--- a/lib/src/main/java/org/asamk/signal/manager/SignalWebSocketHealthMonitor.java
+++ b/lib/src/main/java/org/asamk/signal/manager/internal/SignalWebSocketHealthMonitor.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.internal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/lib/src/main/java/org/asamk/signal/manager/AttachmentStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/AttachmentStore.java
similarity index 98%
rename from lib/src/main/java/org/asamk/signal/manager/AttachmentStore.java
rename to lib/src/main/java/org/asamk/signal/manager/storage/AttachmentStore.java
index e95c2069..5e734174 100644
--- a/lib/src/main/java/org/asamk/signal/manager/AttachmentStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/AttachmentStore.java
@@ -1,4 +1,4 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.storage;
import org.asamk.signal.manager.util.IOUtils;
import org.asamk.signal.manager.util.MimeUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/AvatarStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/AvatarStore.java
similarity index 97%
rename from lib/src/main/java/org/asamk/signal/manager/AvatarStore.java
rename to lib/src/main/java/org/asamk/signal/manager/storage/AvatarStore.java
index b4bd188c..e4475b6e 100644
--- a/lib/src/main/java/org/asamk/signal/manager/AvatarStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/AvatarStore.java
@@ -1,6 +1,6 @@
-package org.asamk.signal.manager;
+package org.asamk.signal.manager.storage;
-import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.util.IOUtils;
import org.asamk.signal.manager.util.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java
index 5014ab6d..850b264f 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java
@@ -4,10 +4,12 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.asamk.signal.manager.Settings;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.Pair;
+import org.asamk.signal.manager.api.Profile;
+import org.asamk.signal.manager.api.ServiceEnvironment;
import org.asamk.signal.manager.api.TrustLevel;
-import org.asamk.signal.manager.config.ServiceEnvironment;
-import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.helper.RecipientAddressResolver;
import org.asamk.signal.manager.storage.configuration.ConfigurationStore;
import org.asamk.signal.manager.storage.contacts.ContactsStore;
@@ -27,10 +29,8 @@ import org.asamk.signal.manager.storage.profiles.LegacyProfileStore;
import org.asamk.signal.manager.storage.profiles.ProfileStore;
import org.asamk.signal.manager.storage.protocol.LegacyJsonSignalProtocolStore;
import org.asamk.signal.manager.storage.protocol.SignalProtocolStore;
-import org.asamk.signal.manager.storage.recipients.Contact;
import org.asamk.signal.manager.storage.recipients.LegacyRecipientStore;
import org.asamk.signal.manager.storage.recipients.LegacyRecipientStore2;
-import org.asamk.signal.manager.storage.recipients.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.recipients.RecipientIdCreator;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/accounts/AccountsStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/accounts/AccountsStore.java
index d708a41c..e7297c6b 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/accounts/AccountsStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/accounts/AccountsStore.java
@@ -3,7 +3,7 @@ package org.asamk.signal.manager.storage.accounts;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.asamk.signal.manager.api.Pair;
-import org.asamk.signal.manager.config.ServiceEnvironment;
+import org.asamk.signal.manager.api.ServiceEnvironment;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.Utils;
import org.asamk.signal.manager.util.IOUtils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/contacts/ContactsStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/contacts/ContactsStore.java
index 2435c4e9..05bc4e27 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/contacts/ContactsStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/contacts/ContactsStore.java
@@ -1,7 +1,7 @@
package org.asamk.signal.manager.storage.contacts;
+import org.asamk.signal.manager.api.Contact;
import org.asamk.signal.manager.api.Pair;
-import org.asamk.signal.manager.storage.recipients.Contact;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import java.util.List;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfo.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfo.java
index 3816dcc6..a16af0ff 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfo.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfo.java
@@ -1,8 +1,8 @@
package org.asamk.signal.manager.storage.groups;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupPermission;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupPermission;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.whispersystems.signalservice.api.push.DistributionId;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV1.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV1.java
index ea5ae7be..ba09337c 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV1.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV1.java
@@ -1,9 +1,9 @@
package org.asamk.signal.manager.storage.groups;
-import org.asamk.signal.manager.groups.GroupIdV1;
-import org.asamk.signal.manager.groups.GroupIdV2;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupPermission;
+import org.asamk.signal.manager.api.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV2;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupPermission;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.whispersystems.signalservice.api.push.DistributionId;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV2.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV2.java
index fca71f10..3e5eac7a 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV2.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupInfoV2.java
@@ -1,8 +1,8 @@
package org.asamk.signal.manager.storage.groups;
-import org.asamk.signal.manager.groups.GroupIdV2;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupPermission;
+import org.asamk.signal.manager.api.GroupIdV2;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupPermission;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.storage.recipients.RecipientResolver;
import org.signal.libsignal.zkgroup.groups.GroupMasterKey;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java
index ece7cde2..0b190105 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java
@@ -2,9 +2,9 @@ package org.asamk.signal.manager.storage.groups;
import com.google.protobuf.InvalidProtocolBufferException;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupIdV1;
-import org.asamk.signal.manager.groups.GroupIdV2;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV2;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.manager.storage.Database;
import org.asamk.signal.manager.storage.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/LegacyGroupStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/LegacyGroupStore.java
index b6205c97..f004ae69 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/LegacyGroupStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/LegacyGroupStore.java
@@ -7,9 +7,9 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupIdV1;
-import org.asamk.signal.manager.groups.GroupIdV2;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupIdV1;
+import org.asamk.signal.manager.api.GroupIdV2;
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.storage.recipients.RecipientResolver;
import org.signal.libsignal.zkgroup.InvalidInputException;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/identities/IdentityKeyStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/identities/IdentityKeyStore.java
index b1d89628..2f8b4dac 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/identities/IdentityKeyStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/identities/IdentityKeyStore.java
@@ -1,6 +1,7 @@
package org.asamk.signal.manager.storage.identities;
import org.asamk.signal.manager.api.TrustLevel;
+import org.asamk.signal.manager.api.TrustNewIdentity;
import org.asamk.signal.manager.storage.Database;
import org.asamk.signal.manager.storage.Utils;
import org.signal.libsignal.protocol.IdentityKey;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/profiles/ProfileStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/profiles/ProfileStore.java
index 9e36bf85..8128435d 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/profiles/ProfileStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/profiles/ProfileStore.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.storage.profiles;
-import org.asamk.signal.manager.storage.recipients.Profile;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/LegacyRecipientStore2.java b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/LegacyRecipientStore2.java
index bd7605db..f1b77180 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/LegacyRecipientStore2.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/LegacyRecipientStore2.java
@@ -1,5 +1,7 @@
package org.asamk.signal.manager.storage.recipients;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.storage.Utils;
import org.signal.libsignal.zkgroup.InvalidInputException;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Recipient.java b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Recipient.java
index 2d3c8430..3790ecde 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Recipient.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/Recipient.java
@@ -1,5 +1,7 @@
package org.asamk.signal.manager.storage.recipients;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.Profile;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java
index b8a4b39b..9c13459b 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java
@@ -1,6 +1,8 @@
package org.asamk.signal.manager.storage.recipients;
+import org.asamk.signal.manager.api.Contact;
import org.asamk.signal.manager.api.Pair;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.storage.Database;
import org.asamk.signal.manager.storage.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogEntry.java b/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogEntry.java
index 67ca5cd4..c7f37396 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogEntry.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogEntry.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.storage.sendLog;
-import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.api.GroupId;
import org.whispersystems.signalservice.api.crypto.ContentHint;
import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogStore.java
index bab0aa4f..d8c8f5aa 100644
--- a/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogStore.java
+++ b/lib/src/main/java/org/asamk/signal/manager/storage/sendLog/MessageSendLogStore.java
@@ -1,6 +1,6 @@
package org.asamk.signal.manager.storage.sendLog;
-import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.manager.storage.Database;
import org.asamk.signal.manager.storage.Utils;
diff --git a/lib/src/main/java/org/asamk/signal/manager/util/ProfileUtils.java b/lib/src/main/java/org/asamk/signal/manager/util/ProfileUtils.java
index 5d61cab3..cfbfc3cc 100644
--- a/lib/src/main/java/org/asamk/signal/manager/util/ProfileUtils.java
+++ b/lib/src/main/java/org/asamk/signal/manager/util/ProfileUtils.java
@@ -3,7 +3,7 @@ package org.asamk.signal.manager.util;
import com.google.protobuf.InvalidProtocolBufferException;
import org.asamk.signal.manager.api.Pair;
-import org.asamk.signal.manager.storage.recipients.Profile;
+import org.asamk.signal.manager.api.Profile;
import org.signal.libsignal.protocol.IdentityKey;
import org.signal.libsignal.protocol.InvalidKeyException;
import org.signal.libsignal.protocol.ecc.ECPublicKey;
diff --git a/src/main/java/org/asamk/signal/App.java b/src/main/java/org/asamk/signal/App.java
index 058ae6bb..e8c30a97 100644
--- a/src/main/java/org/asamk/signal/App.java
+++ b/src/main/java/org/asamk/signal/App.java
@@ -27,9 +27,8 @@ import org.asamk.signal.manager.Settings;
import org.asamk.signal.manager.SignalAccountFiles;
import org.asamk.signal.manager.api.AccountCheckException;
import org.asamk.signal.manager.api.NotRegisteredException;
-import org.asamk.signal.manager.config.ServiceConfig;
-import org.asamk.signal.manager.config.ServiceEnvironment;
-import org.asamk.signal.manager.storage.identities.TrustNewIdentity;
+import org.asamk.signal.manager.api.ServiceEnvironment;
+import org.asamk.signal.manager.api.TrustNewIdentity;
import org.asamk.signal.output.JsonWriterImpl;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.output.PlainTextWriterImpl;
@@ -150,7 +149,7 @@ public class App {
return;
}
- if (!ServiceConfig.isSignalClientAvailable()) {
+ if (!Manager.isSignalClientAvailable()) {
throw new UserErrorException("Missing required native library dependency: libsignal-client");
}
diff --git a/src/main/java/org/asamk/signal/ReceiveMessageHandler.java b/src/main/java/org/asamk/signal/ReceiveMessageHandler.java
index c299ae38..faea75dc 100644
--- a/src/main/java/org/asamk/signal/ReceiveMessageHandler.java
+++ b/src/main/java/org/asamk/signal/ReceiveMessageHandler.java
@@ -1,12 +1,12 @@
package org.asamk.signal;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.RecipientAddress;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.TextStyle;
import org.asamk.signal.manager.api.UntrustedIdentityException;
-import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.output.PlainTextWriter;
import org.asamk.signal.util.DateUtils;
import org.asamk.signal.util.Hex;
diff --git a/src/main/java/org/asamk/signal/commands/BlockCommand.java b/src/main/java/org/asamk/signal/commands/BlockCommand.java
index 682ff63f..2a8c4f50 100644
--- a/src/main/java/org/asamk/signal/commands/BlockCommand.java
+++ b/src/main/java/org/asamk/signal/commands/BlockCommand.java
@@ -7,9 +7,9 @@ import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupNotFoundException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
import org.slf4j.Logger;
diff --git a/src/main/java/org/asamk/signal/commands/JoinGroupCommand.java b/src/main/java/org/asamk/signal/commands/JoinGroupCommand.java
index 5e3461b7..3c3562ae 100644
--- a/src/main/java/org/asamk/signal/commands/JoinGroupCommand.java
+++ b/src/main/java/org/asamk/signal/commands/JoinGroupCommand.java
@@ -8,9 +8,9 @@ import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
import org.asamk.signal.output.JsonWriter;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.output.PlainTextWriter;
diff --git a/src/main/java/org/asamk/signal/commands/ListContactsCommand.java b/src/main/java/org/asamk/signal/commands/ListContactsCommand.java
index e3b978b1..997e31dd 100644
--- a/src/main/java/org/asamk/signal/commands/ListContactsCommand.java
+++ b/src/main/java/org/asamk/signal/commands/ListContactsCommand.java
@@ -6,8 +6,8 @@ import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.manager.Manager;
-import org.asamk.signal.manager.storage.recipients.Contact;
-import org.asamk.signal.manager.storage.recipients.Profile;
+import org.asamk.signal.manager.api.Contact;
+import org.asamk.signal.manager.api.Profile;
import org.asamk.signal.output.JsonWriter;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.output.PlainTextWriter;
diff --git a/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java b/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java
index 201451ee..ca745b32 100644
--- a/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java
+++ b/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java
@@ -8,10 +8,10 @@ import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.LastGroupAdminException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
import org.slf4j.Logger;
diff --git a/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java b/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java
index 85d2dcd4..294fd7c5 100644
--- a/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java
+++ b/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java
@@ -8,9 +8,9 @@ import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
diff --git a/src/main/java/org/asamk/signal/commands/SendCommand.java b/src/main/java/org/asamk/signal/commands/SendCommand.java
index 33777167..56a26253 100644
--- a/src/main/java/org/asamk/signal/commands/SendCommand.java
+++ b/src/main/java/org/asamk/signal/commands/SendCommand.java
@@ -9,14 +9,14 @@ import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.AttachmentInvalidException;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.InvalidStickerException;
import org.asamk.signal.manager.api.Message;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.TextStyle;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
import org.asamk.signal.util.Hex;
diff --git a/src/main/java/org/asamk/signal/commands/SendReactionCommand.java b/src/main/java/org/asamk/signal/commands/SendReactionCommand.java
index a844fabf..0eafc2fd 100644
--- a/src/main/java/org/asamk/signal/commands/SendReactionCommand.java
+++ b/src/main/java/org/asamk/signal/commands/SendReactionCommand.java
@@ -8,10 +8,10 @@ import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
diff --git a/src/main/java/org/asamk/signal/commands/SendTypingCommand.java b/src/main/java/org/asamk/signal/commands/SendTypingCommand.java
index 4a2a038c..9293ec6a 100644
--- a/src/main/java/org/asamk/signal/commands/SendTypingCommand.java
+++ b/src/main/java/org/asamk/signal/commands/SendTypingCommand.java
@@ -7,11 +7,11 @@ import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.TypingAction;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
diff --git a/src/main/java/org/asamk/signal/commands/UnblockCommand.java b/src/main/java/org/asamk/signal/commands/UnblockCommand.java
index 9ff018bb..a7a8b6d7 100644
--- a/src/main/java/org/asamk/signal/commands/UnblockCommand.java
+++ b/src/main/java/org/asamk/signal/commands/UnblockCommand.java
@@ -7,9 +7,9 @@ import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupNotFoundException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
import org.slf4j.Logger;
diff --git a/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java b/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java
index 14ad14f8..1f7825fb 100644
--- a/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java
+++ b/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java
@@ -9,15 +9,15 @@ import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.AttachmentInvalidException;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupLinkState;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupPermission;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.SendGroupMessageResults;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupLinkState;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupPermission;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.output.JsonWriter;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.output.PlainTextWriter;
diff --git a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
index e5f64ab3..1873bfd0 100644
--- a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
+++ b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
@@ -5,15 +5,23 @@ import org.asamk.signal.DbusConfig;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.Configuration;
+import org.asamk.signal.manager.api.Contact;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.Group;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupPermission;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.Identity;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
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.NotAGroupMemberException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.ReceiveConfig;
@@ -30,14 +38,6 @@ import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupPermission;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
-import org.asamk.signal.manager.storage.recipients.Contact;
import org.freedesktop.dbus.DBusMap;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.connections.impl.DBusConnection;
diff --git a/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java b/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java
index 66c1fd65..3176620d 100644
--- a/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java
+++ b/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java
@@ -2,9 +2,9 @@ package org.asamk.signal.dbus;
import org.asamk.Signal;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.RecipientAddress;
-import org.asamk.signal.manager.groups.GroupId;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.types.Variant;
diff --git a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
index f91f8001..db7253bd 100644
--- a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
+++ b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
@@ -4,11 +4,19 @@ import org.asamk.Signal;
import org.asamk.signal.BaseConfig;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.AttachmentInvalidException;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupInviteLinkUrl;
+import org.asamk.signal.manager.api.GroupLinkState;
+import org.asamk.signal.manager.api.GroupNotFoundException;
+import org.asamk.signal.manager.api.GroupPermission;
+import org.asamk.signal.manager.api.GroupSendingNotAllowedException;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.InvalidNumberException;
import org.asamk.signal.manager.api.InvalidStickerException;
+import org.asamk.signal.manager.api.LastGroupAdminException;
import org.asamk.signal.manager.api.Message;
+import org.asamk.signal.manager.api.NotAGroupMemberException;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.PendingAdminApprovalException;
import org.asamk.signal.manager.api.RecipientAddress;
@@ -21,14 +29,6 @@ import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
-import org.asamk.signal.manager.groups.GroupLinkState;
-import org.asamk.signal.manager.groups.GroupNotFoundException;
-import org.asamk.signal.manager.groups.GroupPermission;
-import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
-import org.asamk.signal.manager.groups.LastGroupAdminException;
-import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.util.SendMessageResultUtils;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.connections.impl.DBusConnection;
diff --git a/src/main/java/org/asamk/signal/http/HttpServerHandler.java b/src/main/java/org/asamk/signal/http/HttpServerHandler.java
index f7d06b15..39e7f51e 100644
--- a/src/main/java/org/asamk/signal/http/HttpServerHandler.java
+++ b/src/main/java/org/asamk/signal/http/HttpServerHandler.java
@@ -13,7 +13,6 @@ import org.asamk.signal.jsonrpc.SignalJsonRpcCommandHandler;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.MultiAccountManager;
import org.asamk.signal.manager.api.Pair;
-import org.asamk.signal.manager.util.Utils;
import org.asamk.signal.util.Util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -138,7 +137,7 @@ public class HttpServerHandler {
try {
final var queryString = httpExchange.getRequestURI().getQuery();
- final var query = queryString == null ? Map.of() : Utils.getQueryMap(queryString);
+ final var query = queryString == null ? Map.of() : Util.getQueryMap(queryString);
List managers = getManagerFromQuery(query);
if (managers == null) {
diff --git a/src/main/java/org/asamk/signal/json/JsonSendMessageResult.java b/src/main/java/org/asamk/signal/json/JsonSendMessageResult.java
index dd7f235f..13b953fc 100644
--- a/src/main/java/org/asamk/signal/json/JsonSendMessageResult.java
+++ b/src/main/java/org/asamk/signal/json/JsonSendMessageResult.java
@@ -2,8 +2,8 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonInclude;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.SendMessageResult;
-import org.asamk.signal.manager.groups.GroupId;
public record JsonSendMessageResult(
JsonRecipientAddress recipientAddress,
diff --git a/src/main/java/org/asamk/signal/json/JsonStoryMessage.java b/src/main/java/org/asamk/signal/json/JsonStoryMessage.java
index 012df53d..c1ca6144 100644
--- a/src/main/java/org/asamk/signal/json/JsonStoryMessage.java
+++ b/src/main/java/org/asamk/signal/json/JsonStoryMessage.java
@@ -3,8 +3,8 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.asamk.signal.manager.api.Color;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
-import org.asamk.signal.manager.groups.GroupId;
import java.util.List;
diff --git a/src/main/java/org/asamk/signal/json/JsonSyncMessage.java b/src/main/java/org/asamk/signal/json/JsonSyncMessage.java
index 802c07d5..98c3571e 100644
--- a/src/main/java/org/asamk/signal/json/JsonSyncMessage.java
+++ b/src/main/java/org/asamk/signal/json/JsonSyncMessage.java
@@ -2,9 +2,9 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonInclude;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.RecipientAddress;
-import org.asamk.signal.manager.groups.GroupId;
import java.util.List;
diff --git a/src/main/java/org/asamk/signal/json/JsonTypingMessage.java b/src/main/java/org/asamk/signal/json/JsonTypingMessage.java
index 0df82b1c..79a66d34 100644
--- a/src/main/java/org/asamk/signal/json/JsonTypingMessage.java
+++ b/src/main/java/org/asamk/signal/json/JsonTypingMessage.java
@@ -2,8 +2,8 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonInclude;
+import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
-import org.asamk.signal.manager.groups.GroupId;
record JsonTypingMessage(
String action, long timestamp, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId
diff --git a/src/main/java/org/asamk/signal/util/CommandUtil.java b/src/main/java/org/asamk/signal/util/CommandUtil.java
index b86a9989..311b78af 100644
--- a/src/main/java/org/asamk/signal/util/CommandUtil.java
+++ b/src/main/java/org/asamk/signal/util/CommandUtil.java
@@ -2,10 +2,10 @@ package org.asamk.signal.util;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
+import org.asamk.signal.manager.api.GroupId;
+import org.asamk.signal.manager.api.GroupIdFormatException;
import org.asamk.signal.manager.api.InvalidNumberException;
import org.asamk.signal.manager.api.RecipientIdentifier;
-import org.asamk.signal.manager.groups.GroupId;
-import org.asamk.signal.manager.groups.GroupIdFormatException;
import java.util.Collection;
import java.util.HashSet;
diff --git a/src/main/java/org/asamk/signal/util/Util.java b/src/main/java/org/asamk/signal/util/Util.java
index c844e2ea..338c986a 100644
--- a/src/main/java/org/asamk/signal/util/Util.java
+++ b/src/main/java/org/asamk/signal/util/Util.java
@@ -5,9 +5,13 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -63,4 +67,17 @@ public class Util {
objectMapper.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
return objectMapper;
}
+
+ public static Map getQueryMap(String query) {
+ var params = query.split("&");
+ var map = new HashMap();
+ for (var param : params) {
+ final var paramParts = param.split("=");
+ var name = URLDecoder.decode(paramParts[0], StandardCharsets.UTF_8);
+ var value = paramParts.length == 1 ? null : URLDecoder.decode(paramParts[1], StandardCharsets.UTF_8);
+ map.put(name, value);
+ }
+ return map;
+ }
+
}