2023-06-30 09:54:08 +00:00
|
|
|
package payload
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetWebEncryptionKey(WebPairKey []byte) ([]byte, *binary.Container, error) {
|
|
|
|
id := util.RandomUUIDv4()
|
|
|
|
payload := &binary.Container{
|
|
|
|
PhoneRelay: &binary.PhoneRelayBody{
|
2023-06-30 13:26:46 +00:00
|
|
|
ID: id,
|
2023-06-30 09:54:08 +00:00
|
|
|
RpcKey: WebPairKey,
|
|
|
|
Date: &binary.Date{
|
|
|
|
Year: 2023,
|
|
|
|
Seq1: 6,
|
|
|
|
Seq2: 8,
|
|
|
|
Seq3: 4,
|
|
|
|
Seq4: 6,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
encodedPayload, err2 := binary.EncodeProtoMessage(payload)
|
|
|
|
if err2 != nil {
|
|
|
|
return nil, payload, err2
|
|
|
|
}
|
|
|
|
return encodedPayload, payload, nil
|
|
|
|
}
|