mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Extract static methods from Main
This commit is contained in:
parent
184354ffb7
commit
860ec6f5dc
8 changed files with 520 additions and 440 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue