mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-19 15:14:21 +01:00
Extract static methods from Main
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package org.asamk.signal.util;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.asamk.signal.GroupIdFormatException;
|
||||
import org.whispersystems.signalservice.internal.util.Base64;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InvalidObjectException;
|
||||
|
||||
public class Util {
|
||||
@@ -39,4 +42,12 @@ public class Util {
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
public static byte[] decodeGroupId(String groupId) throws GroupIdFormatException {
|
||||
try {
|
||||
return Base64.decode(groupId);
|
||||
} catch (IOException e) {
|
||||
throw new GroupIdFormatException(groupId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user