Extract static methods from Main

This commit is contained in:
AsamK 2018-11-19 22:40:16 +01:00
parent 184354ffb7
commit 860ec6f5dc
8 changed files with 520 additions and 440 deletions

View file

@ -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);
}
}
}