This repository contains generated Go code for the Xiphias Model Common protocol buffers used by Kik Messenger.
go get github.com/sokkit-io/xiphias-model-common@latest
You can use the generated code to marshal and unmarshal protocol buffer messages, typically from a Kik XMPP stanza.
For example:
package main
import (
"encoding/base64"
"github.com/golang/protobuf/proto"
"github.com/sokkit-io/xiphias-model-common/generated/go"
"strings"
)
func main() {
// Let's say you've got a base64-encoded response from Kik that you want to decode. This happens to be a XiBareUserJid body.
xiBareUserJidB64 := "Cgd0ZWRfdzZ3"
// Remove trailing padding characters
xiBareUserJidB64 = strings.TrimRight(xiBareUserJidB64, "=")
// Decode the base64-encoded response
xiBareUserJidBytes, _ := base64.RawURLEncoding.DecodeString(xiBareUserJidB64)
// Prepare a XiBareUserJid struct to unmarshal the response into
xiBareUserJid := &common.XiBareUserJid{}
// Unmarshal the response into the XiBareUserJid struct
_ = proto.Unmarshal(xiBareUserJidBytes, xiBareUserJid)
// Print the JID
println(xiBareUserJid.GetLocalPart())
}
Protocol buffer definitions were extracted from the Kik Messenger Android application version 15.51.1.28280 using pbtk.
Definitions will be updated as breaking changes are introduced.
- kikinteractive for creating Kik Messenger
- marin-m for creating pbtk
- golang/protobuf contributors
- Developers and skids of the Kik modding community