Move group classes to separate package

This commit is contained in:
AsamK 2020-12-29 22:09:06 +01:00
parent 22f19c4067
commit 9e6a353427
32 changed files with 69 additions and 59 deletions

View file

@ -1,5 +1,6 @@
package org.asamk.signal.manager;
import org.asamk.signal.manager.groups.GroupIdV1;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import java.util.Objects;

View file

@ -5,7 +5,7 @@ import org.signal.zkgroup.InvalidInputException;
import org.signal.zkgroup.profiles.ProfileKey;
import org.whispersystems.util.Base64;
class KeyUtils {
public class KeyUtils {
private KeyUtils() {
}
@ -35,7 +35,7 @@ class KeyUtils {
return Base64.encodeBytes(secret);
}
static byte[] getSecretBytes(int size) {
public static byte[] getSecretBytes(int size) {
byte[] secret = new byte[size];
RandomUtils.getSecureRandom().nextBytes(secret);
return secret;

View file

@ -18,6 +18,13 @@ package org.asamk.signal.manager;
import com.fasterxml.jackson.databind.ObjectMapper;
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.GroupNotFoundException;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.manager.helper.GroupHelper;
import org.asamk.signal.manager.helper.ProfileHelper;
import org.asamk.signal.manager.helper.UnidentifiedAccessHelper;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import org.whispersystems.util.Base64;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
public class GroupIdFormatException extends Exception {

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import static org.asamk.signal.manager.KeyUtils.getSecretBytes;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import java.util.Base64;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import com.google.protobuf.ByteString;

View file

@ -1,4 +1,6 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import org.asamk.signal.manager.KeyUtils;
import java.util.Arrays;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
public class GroupNotFoundException extends Exception {

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
import org.asamk.signal.storage.groups.GroupInfo;
import org.asamk.signal.storage.groups.GroupInfoV1;

View file

@ -1,4 +1,4 @@
package org.asamk.signal.manager;
package org.asamk.signal.manager.groups;
public class NotAGroupMemberException extends Exception {

View file

@ -2,9 +2,9 @@ package org.asamk.signal.manager.helper;
import com.google.protobuf.InvalidProtocolBufferException;
import org.asamk.signal.manager.GroupIdV2;
import org.asamk.signal.manager.GroupLinkPassword;
import org.asamk.signal.manager.GroupUtils;
import org.asamk.signal.manager.groups.GroupIdV2;
import org.asamk.signal.manager.groups.GroupLinkPassword;
import org.asamk.signal.manager.groups.GroupUtils;
import org.asamk.signal.storage.groups.GroupInfoV2;
import org.asamk.signal.storage.profiles.SignalProfile;
import org.asamk.signal.util.IOUtils;