Add kotlin/proto level message processing.

This commit is contained in:
Cody Henthorne
2023-03-30 11:45:13 -04:00
committed by Alex Hart
parent 28f27915c5
commit 2e45bd719a
43 changed files with 4505 additions and 84 deletions

View File

@@ -3,6 +3,8 @@ package org.thoughtcrime.securesms.groups;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.protobuf.ByteString;
import org.signal.core.util.DatabaseId;
import org.signal.core.util.Hex;
import org.signal.libsignal.protocol.kdf.HKDFv3;
@@ -83,6 +85,10 @@ public abstract class GroupId implements DatabaseId {
.getGroupIdentifier());
}
public static GroupId.Push push(ByteString bytes) throws BadGroupIdException {
return push(bytes.toByteArray());
}
public static GroupId.Push push(byte[] bytes) throws BadGroupIdException {
return bytes.length == V2_BYTE_LENGTH ? v2(bytes) : v1(bytes);
}