pull/2147/head
tzagim 1 month ago committed by GitHub
commit 9c58e758d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -136,7 +136,7 @@ func isGroupJid(identifier string) bool {
func (b *Bwhatsapp) getDevice() (*store.Device, error) {
device := &store.Device{}
storeContainer, err := sqlstore.New("sqlite", "file:"+b.Config.GetString("sessionfile")+".db?_foreign_keys=on&_pragma=busy_timeout=10000", nil)
storeContainer, err := sqlstore.New("sqlite", "file:"+b.Config.GetString("sessionfile")+".db?_pragma=foreign_keys(1)&_pragma=busy_timeout(10000)", nil)
if err != nil {
return device, fmt.Errorf("failed to connect to database: %v", err)
}

@ -1,4 +1,4 @@
module github.com/42wim/matterbridge
module github.com/tzagim/matterbridge
require (
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
@ -148,4 +148,4 @@ require (
//replace github.com/matrix-org/gomatrix => github.com/matterbridge/gomatrix v0.0.0-20220205235239-607eb9ee6419
go 1.19
go 1.21

@ -223,6 +223,41 @@ func (cli *Client) dispatchAppState(mutation appstate.Mutation, fullSync bool, e
Action: mutation.Action.GetUserStatusMuteAction(),
FromFullSync: fullSync,
}
case appstate.IndexLabelEdit:
act := mutation.Action.GetLabelEditAction()
eventToDispatch = &events.LabelEdit{
Timestamp: ts,
LabelID: mutation.Index[1],
Action: act,
FromFullSync: fullSync,
}
case appstate.IndexLabelAssociationChat:
if len(mutation.Index) < 3 {
return
}
jid, _ = types.ParseJID(mutation.Index[2])
act := mutation.Action.GetLabelAssociationAction()
eventToDispatch = &events.LabelAssociationChat{
JID: jid,
Timestamp: ts,
LabelID: mutation.Index[1],
Action: act,
FromFullSync: fullSync,
}
case appstate.IndexLabelAssociationMessage:
if len(mutation.Index) < 6 {
return
}
jid, _ = types.ParseJID(mutation.Index[2])
act := mutation.Action.GetLabelAssociationAction()
eventToDispatch = &events.LabelAssociationMessage{
JID: jid,
Timestamp: ts,
LabelID: mutation.Index[1],
MessageID: mutation.Index[3],
Action: act,
FromFullSync: fullSync,
}
}
if storeUpdateError != nil {
cli.Log.Errorf("Failed to update device store after app state mutation: %v", storeUpdateError)

@ -123,6 +123,96 @@ func BuildArchive(target types.JID, archive bool, lastMessageTimestamp time.Time
return result
}
func newLabelChatMutation(target types.JID, labelID string, labeled bool) MutationInfo {
return MutationInfo{
Index: []string{IndexLabelAssociationChat, labelID, target.String()},
Version: 3,
Value: &waProto.SyncActionValue{
LabelAssociationAction: &waProto.LabelAssociationAction{
Labeled: &labeled,
},
},
}
}
// BuildLabelChat builds an app state patch for labeling or un(labeling) a chat.
func BuildLabelChat(target types.JID, labelID string, labeled bool) PatchInfo {
return PatchInfo{
Type: WAPatchRegular,
Mutations: []MutationInfo{
newLabelChatMutation(target, labelID, labeled),
},
}
}
func newLabelMessageMutation(target types.JID, labelID, messageID string, labeled bool) MutationInfo {
return MutationInfo{
Index: []string{IndexLabelAssociationMessage, labelID, target.String(), messageID, "0", "0"},
Version: 3,
Value: &waProto.SyncActionValue{
LabelAssociationAction: &waProto.LabelAssociationAction{
Labeled: &labeled,
},
},
}
}
// BuildLabelMessage builds an app state patch for labeling or un(labeling) a message.
func BuildLabelMessage(target types.JID, labelID, messageID string, labeled bool) PatchInfo {
return PatchInfo{
Type: WAPatchRegular,
Mutations: []MutationInfo{
newLabelMessageMutation(target, labelID, messageID, labeled),
},
}
}
func newLabelEditMutation(labelID string, labelName string, labelColor int32, deleted bool) MutationInfo {
return MutationInfo{
Index: []string{IndexLabelEdit, labelID},
Version: 3,
Value: &waProto.SyncActionValue{
LabelEditAction: &waProto.LabelEditAction{
Name: &labelName,
Color: &labelColor,
Deleted: &deleted,
},
},
}
}
// BuildLabelEdit builds an app state patch for editing a label.
func BuildLabelEdit(labelID string, labelName string, labelColor int32, deleted bool) PatchInfo {
return PatchInfo{
Type: WAPatchRegular,
Mutations: []MutationInfo{
newLabelEditMutation(labelID, labelName, labelColor, deleted),
},
}
}
func newSettingPushNameMutation(pushName string) MutationInfo {
return MutationInfo{
Index: []string{IndexSettingPushName},
Version: 1,
Value: &waProto.SyncActionValue{
PushNameSetting: &waProto.PushNameSetting{
Name: &pushName,
},
},
}
}
// BuildSettingPushName builds an app state patch for setting the push name.
func BuildSettingPushName(pushName string) PatchInfo {
return PatchInfo{
Type: WAPatchCriticalBlock,
Mutations: []MutationInfo{
newSettingPushNameMutation(pushName),
},
}
}
func (proc *Processor) EncodePatch(keyID []byte, state HashState, patchInfo PatchInfo) ([]byte, error) {
keys, err := proc.getAppStateKey(keyID)
if err != nil {

@ -37,18 +37,21 @@ var AllPatchNames = [...]WAPatchName{WAPatchCriticalBlock, WAPatchCriticalUnbloc
// Constants for the first part of app state indexes.
const (
IndexMute = "mute"
IndexPin = "pin_v1"
IndexArchive = "archive"
IndexContact = "contact"
IndexClearChat = "clearChat"
IndexDeleteChat = "deleteChat"
IndexStar = "star"
IndexDeleteMessageForMe = "deleteMessageForMe"
IndexMarkChatAsRead = "markChatAsRead"
IndexSettingPushName = "setting_pushName"
IndexSettingUnarchiveChats = "setting_unarchiveChats"
IndexUserStatusMute = "userStatusMute"
IndexMute = "mute"
IndexPin = "pin_v1"
IndexArchive = "archive"
IndexContact = "contact"
IndexClearChat = "clearChat"
IndexDeleteChat = "deleteChat"
IndexStar = "star"
IndexDeleteMessageForMe = "deleteMessageForMe"
IndexMarkChatAsRead = "markChatAsRead"
IndexSettingPushName = "setting_pushName"
IndexSettingUnarchiveChats = "setting_unarchiveChats"
IndexUserStatusMute = "userStatusMute"
IndexLabelEdit = "label_edit"
IndexLabelAssociationChat = "label_jid"
IndexLabelAssociationMessage = "label_message"
)
type Processor struct {

@ -0,0 +1,99 @@
// Copyright (c) 2024 Tulir Asokan
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package whatsmeow
import (
"fmt"
"google.golang.org/protobuf/proto"
"go.mau.fi/whatsmeow/binary/armadillo"
"go.mau.fi/whatsmeow/binary/armadillo/waCommon"
"go.mau.fi/whatsmeow/binary/armadillo/waMsgApplication"
"go.mau.fi/whatsmeow/binary/armadillo/waMsgTransport"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
)
func (cli *Client) handleDecryptedArmadillo(info *types.MessageInfo, decrypted []byte, retryCount int) bool {
dec, err := decodeArmadillo(decrypted)
if err != nil {
cli.Log.Warnf("Failed to decode armadillo message from %s: %v", info.SourceString(), err)
return false
}
dec.Info = *info
dec.RetryCount = retryCount
if dec.Transport.GetProtocol().GetAncillary().GetSkdm() != nil {
if !info.IsGroup {
cli.Log.Warnf("Got sender key distribution message in non-group chat from %s", info.Sender)
} else {
skdm := dec.Transport.GetProtocol().GetAncillary().GetSkdm()
cli.handleSenderKeyDistributionMessage(info.Chat, info.Sender, skdm.AxolotlSenderKeyDistributionMessage)
}
}
if dec.Message != nil {
cli.dispatchEvent(&dec)
}
return true
}
func decodeArmadillo(data []byte) (dec events.FBMessage, err error) {
var transport waMsgTransport.MessageTransport
err = proto.Unmarshal(data, &transport)
if err != nil {
return dec, fmt.Errorf("failed to unmarshal transport: %w", err)
}
dec.Transport = &transport
if transport.GetPayload() == nil {
return
}
application, err := transport.GetPayload().Decode()
if err != nil {
return dec, fmt.Errorf("failed to unmarshal application: %w", err)
}
dec.Application = application
if application.GetPayload() == nil {
return
}
switch typedContent := application.GetPayload().GetContent().(type) {
case *waMsgApplication.MessageApplication_Payload_CoreContent:
err = fmt.Errorf("unsupported core content payload")
case *waMsgApplication.MessageApplication_Payload_Signal:
err = fmt.Errorf("unsupported signal payload")
case *waMsgApplication.MessageApplication_Payload_ApplicationData:
err = fmt.Errorf("unsupported application data payload")
case *waMsgApplication.MessageApplication_Payload_SubProtocol:
var protoMsg proto.Message
var subData *waCommon.SubProtocol
switch subProtocol := typedContent.SubProtocol.GetSubProtocol().(type) {
case *waMsgApplication.MessageApplication_SubProtocolPayload_ConsumerMessage:
dec.Message, err = subProtocol.Decode()
case *waMsgApplication.MessageApplication_SubProtocolPayload_BusinessMessage:
dec.Message = (*armadillo.Unsupported_BusinessApplication)(subProtocol.BusinessMessage)
case *waMsgApplication.MessageApplication_SubProtocolPayload_PaymentMessage:
dec.Message = (*armadillo.Unsupported_PaymentApplication)(subProtocol.PaymentMessage)
case *waMsgApplication.MessageApplication_SubProtocolPayload_MultiDevice:
dec.Message, err = subProtocol.Decode()
case *waMsgApplication.MessageApplication_SubProtocolPayload_Voip:
dec.Message = (*armadillo.Unsupported_Voip)(subProtocol.Voip)
case *waMsgApplication.MessageApplication_SubProtocolPayload_Armadillo:
dec.Message, err = subProtocol.Decode()
default:
return dec, fmt.Errorf("unsupported subprotocol type: %T", subProtocol)
}
if protoMsg != nil {
err = proto.Unmarshal(subData.GetPayload(), protoMsg)
if err != nil {
return dec, fmt.Errorf("failed to unmarshal application subprotocol payload (%T v%d): %w", protoMsg, subData.GetVersion(), err)
}
}
default:
err = fmt.Errorf("unsupported application payload content type: %T", typedContent)
}
return
}

@ -0,0 +1,32 @@
package armadilloutil
import (
"errors"
"fmt"
"google.golang.org/protobuf/proto"
"go.mau.fi/whatsmeow/binary/armadillo/waCommon"
)
var ErrUnsupportedVersion = errors.New("unsupported subprotocol version")
func Unmarshal[T proto.Message](into T, msg *waCommon.SubProtocol, expectedVersion int32) (T, error) {
if msg.GetVersion() != expectedVersion {
return into, fmt.Errorf("%w %d in %T (expected %d)", ErrUnsupportedVersion, msg.GetVersion(), into, expectedVersion)
}
err := proto.Unmarshal(msg.GetPayload(), into)
return into, err
}
func Marshal[T proto.Message](msg T, version int32) (*waCommon.SubProtocol, error) {
payload, err := proto.Marshal(msg)
if err != nil {
return nil, err
}
return &waCommon.SubProtocol{
Payload: payload,
Version: version,
}, nil
}

@ -0,0 +1,29 @@
package armadillo
import (
"go.mau.fi/whatsmeow/binary/armadillo/waArmadilloApplication"
"go.mau.fi/whatsmeow/binary/armadillo/waCommon"
"go.mau.fi/whatsmeow/binary/armadillo/waConsumerApplication"
"go.mau.fi/whatsmeow/binary/armadillo/waMultiDevice"
)
type MessageApplicationSub interface {
IsMessageApplicationSub()
}
type Unsupported_BusinessApplication waCommon.SubProtocol
type Unsupported_PaymentApplication waCommon.SubProtocol
type Unsupported_Voip waCommon.SubProtocol
var (
_ MessageApplicationSub = (*waConsumerApplication.ConsumerApplication)(nil) // 2
_ MessageApplicationSub = (*Unsupported_BusinessApplication)(nil) // 3
_ MessageApplicationSub = (*Unsupported_PaymentApplication)(nil) // 4
_ MessageApplicationSub = (*waMultiDevice.MultiDevice)(nil) // 5
_ MessageApplicationSub = (*Unsupported_Voip)(nil) // 6
_ MessageApplicationSub = (*waArmadilloApplication.Armadillo)(nil) // 7
)
func (*Unsupported_BusinessApplication) IsMessageApplicationSub() {}
func (*Unsupported_PaymentApplication) IsMessageApplicationSub() {}
func (*Unsupported_Voip) IsMessageApplicationSub() {}

@ -0,0 +1,9 @@
#!/bin/bash
cd $(dirname $0)
set -euo pipefail
if [[ ! -f "e2ee.js" ]]; then
echo "Please download the encryption javascript file and save it to e2ee.js first"
exit 1
fi
node parse-proto.js
protoc --go_out=. --go_opt=paths=source_relative --go_opt=embed_raw=true */*.proto

@ -0,0 +1,351 @@
///////////////////
// JS EVALUATION //
///////////////////
const protos = []
const modules = {
"$InternalEnum": {
exports: {
exports: function (data) {
data.__enum__ = true
return data
}
}
},
}
function requireModule(name) {
if (!modules[name]) {
throw new Error(`Unknown requirement ${name}`)
}
return modules[name].exports
}
function requireDefault(name) {
return requireModule(name).exports
}
function ignoreModule(name) {
if (name === "WAProtoConst") {
return false
} else if (!name.endsWith(".pb")) {
// Ignore any non-protobuf modules, except WAProtoConst above
return true
} else if (name.startsWith("MAWArmadillo") && (name.endsWith("TableSchema.pb") || name.endsWith("TablesSchema.pb"))) {
// Ignore internal table schemas
return true
} else if (name === "WASignalLocalStorageProtocol.pb" || name === "WASignalWhisperTextProtocol.pb") {
// Ignore standard signal protocol stuff
return true
} else {
return false
}
}
function defineModule(name, dependencies, callback, unknownIntOrNull) {
if (ignoreModule(name)) {
return
}
const exports = {}
if (dependencies.length > 0) {
callback(null, requireDefault, null, requireModule, null, null, exports)
} else {
callback(null, requireDefault, null, requireModule, exports, exports)
}
modules[name] = {exports, dependencies}
}
global.self = global
global.__d = defineModule
require("./e2ee.js")
function dereference(obj, module, currentPath, next, ...remainder) {
if (!next) {
return obj
}
if (!obj.messages[next]) {
obj.messages[next] = {messages: {}, enums: {}, __module__: module, __path__: currentPath, __name__: next}
}
return dereference(obj.messages[next], module, currentPath.concat([next]), ...remainder)
}
function dereferenceSnake(obj, currentPath, path) {
let next = path[0]
path = path.slice(1)
while (!obj.messages[next]) {
if (path.length === 0) {
return [obj, currentPath, next]
}
next += path[0]
path = path.slice(1)
}
return dereferenceSnake(obj.messages[next], currentPath.concat([next]), path)
}
function renameModule(name) {
return name.replace(".pb", "")
}
function renameDependencies(dependencies) {
return dependencies
.filter(name => name.endsWith(".pb"))
.map(renameModule)
.map(name => name === "WAProtocol" ? "WACommon" : name)
}
function renameType(protoName, fieldName, field) {
return fieldName
}
for (const [name, module] of Object.entries(modules)) {
if (!name.endsWith(".pb")) {
continue
} else if (!module.exports) {
console.warn(name, "has no exports")
continue
}
// Slightly hacky way to get rid of WAProtocol.pb and just use the MessageKey in WACommon
if (name === "WAProtocol.pb") {
if (Object.entries(module.exports).length > 1) {
console.warn("WAProtocol.pb has more than one export")
}
module.exports["MessageKeySpec"].__name__ = "MessageKey"
module.exports["MessageKeySpec"].__module__ = "WACommon"
module.exports["MessageKeySpec"].__path__ = []
continue
}
const proto = {
__protobuf__: true,
messages: {},
enums: {},
__name__: renameModule(name),
dependencies: renameDependencies(module.dependencies),
}
const upperSnakeEnums = []
for (const [name, field] of Object.entries(module.exports)) {
const namePath = name.replace(/Spec$/, "").split("$")
field.__name__ = renameType(proto.__name__, namePath[namePath.length - 1], field)
namePath[namePath.length - 1] = field.__name__
field.__path__ = namePath.slice(0, -1)
field.__module__ = proto.__name__
if (field.internalSpec) {
dereference(proto, proto.__name__, [], ...namePath).message = field.internalSpec
} else if (namePath.length === 1 && name.toUpperCase() === name) {
upperSnakeEnums.push(field)
} else {
dereference(proto, proto.__name__, [], ...namePath.slice(0, -1)).enums[field.__name__] = field
}
}
// Some enums have uppercase names, instead of capital case with $ separators.
// For those, we need to find the right nesting location.
for (const field of upperSnakeEnums) {
field.__enum__ = true
const [obj, path, name] = dereferenceSnake(proto, [], field.__name__.split("_").map(part => part[0] + part.slice(1).toLowerCase()))
field.__path__ = path
field.__name__ = name
field.__module__ = proto.__name__
obj.enums[name] = field
}
protos.push(proto)
}
////////////////////////////////
// PROTOBUF SCHEMA GENERATION //
////////////////////////////////
function indent(lines, indent = "\t") {
return lines.map(line => line ? `${indent}${line}` : "")
}
function flattenWithBlankLines(...items) {
return items
.flatMap(item => item.length > 0 ? [item, [""]] : [])
.slice(0, -1)
.flatMap(item => item)
}
function protoifyChildren(container) {
return flattenWithBlankLines(
...Object.values(container.enums).map(protoifyEnum),
...Object.values(container.messages).map(protoifyMessage),
)
}
function protoifyEnum(enumDef) {
const values = []
const names = Object.fromEntries(Object.entries(enumDef).map(([name, value]) => [value, name]))
if (!names["0"]) {
if (names["-1"]) {
enumDef[names["-1"]] = 0
} else {
// TODO add snake case
values.push(`${enumDef.__name__.toUpperCase()}_UNKNOWN = 0;`)
}
}
for (const [name, value] of Object.entries(enumDef)) {
if (name.startsWith("__") && name.endsWith("__")) {
continue
}
values.push(`${name} = ${value};`)
}
return [`enum ${enumDef.__name__} ` + "{", ...indent(values), "}"]
}
const {TYPES, TYPE_MASK, FLAGS} = requireModule("WAProtoConst")
function fieldTypeName(typeID, typeRef, parentModule, parentPath) {
switch (typeID) {
case TYPES.INT32:
return "int32"
case TYPES.INT64:
return "int64"
case TYPES.UINT32:
return "uint32"
case TYPES.UINT64:
return "uint64"
case TYPES.SINT32:
return "sint32"
case TYPES.SINT64:
return "sint64"
case TYPES.BOOL:
return "bool"
case TYPES.ENUM:
case TYPES.MESSAGE:
let pathStartIndex = 0
for (let i = 0; i < parentPath.length && i < typeRef.__path__.length; i++) {
if (typeRef.__path__[i] === parentPath[i]) {
pathStartIndex++
} else {
break
}
}
const namePath = []
if (typeRef.__module__ !== parentModule) {
namePath.push(typeRef.__module__)
pathStartIndex = 0
}
namePath.push(...typeRef.__path__.slice(pathStartIndex))
namePath.push(typeRef.__name__)
return namePath.join(".")
case TYPES.FIXED64:
return "fixed64"
case TYPES.SFIXED64:
return "sfixed64"
case TYPES.DOUBLE:
return "double"
case TYPES.STRING:
return "string"
case TYPES.BYTES:
return "bytes"
case TYPES.FIXED32:
return "fixed32"
case TYPES.SFIXED32:
return "sfixed32"
case TYPES.FLOAT:
return "float"
}
}
const staticRenames = {
id: "ID",
jid: "JID",
encIv: "encIV",
iv: "IV",
ptt: "PTT",
hmac: "HMAC",
url: "URL",
fbid: "FBID",
jpegThumbnail: "JPEGThumbnail",
dsm: "DSM",
}
function fixFieldName(name) {
if (name === "id") {
return "ID"
} else if (name === "encIv") {
return "encIV"
}
return staticRenames[name] ?? name
.replace(/Id([A-Zs]|$)/, "ID$1")
.replace("Jid", "JID")
.replace(/Ms([A-Z]|$)/, "MS$1")
.replace(/Ts([A-Z]|$)/, "TS$1")
.replace(/Mac([A-Z]|$)/, "MAC$1")
.replace("Url", "URL")
.replace("Cdn", "CDN")
.replace("Json", "JSON")
.replace("Jpeg", "JPEG")
.replace("Sha256", "SHA256")
}
function protoifyField(name, [index, flags, typeRef], parentModule, parentPath) {
const preflags = []
const postflags = [""]
if ((flags & FLAGS.REPEATED) !== 0) {
preflags.push("repeated")
}
// if ((flags & FLAGS.REQUIRED) === 0) {
// preflags.push("optional")
// } else {
// preflags.push("required")
// }
preflags.push(fieldTypeName(flags & TYPE_MASK, typeRef, parentModule, parentPath))
if ((flags & FLAGS.PACKED) !== 0) {
postflags.push(`[packed=true]`)
}
return `${preflags.join(" ")} ${fixFieldName(name)} = ${index}${postflags.join(" ")};`
}
function protoifyFields(fields, parentModule, parentPath) {
return Object.entries(fields).map(([name, definition]) => protoifyField(name, definition, parentModule, parentPath))
}
function protoifyMessage(message) {
const sections = [protoifyChildren(message)]
const spec = message.message
const fullMessagePath = message.__path__.concat([message.__name__])
for (const [name, fieldNames] of Object.entries(spec.__oneofs__ ?? {})) {
const fields = Object.fromEntries(fieldNames.map(fieldName => {
const def = spec[fieldName]
delete spec[fieldName]
return [fieldName, def]
}))
sections.push([`oneof ${name} ` + "{", ...indent(protoifyFields(fields, message.__module__, fullMessagePath)), "}"])
}
if (spec.__reserved__) {
console.warn("Found reserved keys:", message.__name__, spec.__reserved__)
}
delete spec.__oneofs__
delete spec.__reserved__
sections.push(protoifyFields(spec, message.__module__, fullMessagePath))
return [`message ${message.__name__} ` + "{", ...indent(flattenWithBlankLines(...sections)), "}"]
}
function goPackageName(name) {
return name.replace(/^WA/, "wa")
}
function protoifyModule(module) {
const output = []
output.push(`syntax = "proto3";`)
output.push(`package ${module.__name__};`)
output.push(`option go_package = "go.mau.fi/whatsmeow/binary/armadillo/${goPackageName(module.__name__)}";`)
output.push("")
if (module.dependencies.length > 0) {
for (const dependency of module.dependencies) {
output.push(`import "${goPackageName(dependency)}/${dependency}.proto";`)
}
output.push("")
}
const children = protoifyChildren(module)
children.push("")
return output.concat(children)
}
const fs = require("fs")
for (const proto of protos) {
fs.mkdirSync(goPackageName(proto.__name__), {recursive: true})
fs.writeFileSync(`${goPackageName(proto.__name__)}/${proto.__name__}.proto`, protoifyModule(proto).join("\n"))
}

@ -0,0 +1,552 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waAdv/WAAdv.proto
package waAdv
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ADVEncryptionType int32
const (
ADVEncryptionType_E2EE ADVEncryptionType = 0
ADVEncryptionType_HOSTED ADVEncryptionType = 1
)
// Enum value maps for ADVEncryptionType.
var (
ADVEncryptionType_name = map[int32]string{
0: "E2EE",
1: "HOSTED",
}
ADVEncryptionType_value = map[string]int32{
"E2EE": 0,
"HOSTED": 1,
}
)
func (x ADVEncryptionType) Enum() *ADVEncryptionType {
p := new(ADVEncryptionType)
*p = x
return p
}
func (x ADVEncryptionType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ADVEncryptionType) Descriptor() protoreflect.EnumDescriptor {
return file_waAdv_WAAdv_proto_enumTypes[0].Descriptor()
}
func (ADVEncryptionType) Type() protoreflect.EnumType {
return &file_waAdv_WAAdv_proto_enumTypes[0]
}
func (x ADVEncryptionType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ADVEncryptionType.Descriptor instead.
func (ADVEncryptionType) EnumDescriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{0}
}
type ADVKeyIndexList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RawID uint32 `protobuf:"varint,1,opt,name=rawID,proto3" json:"rawID,omitempty"`
Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
CurrentIndex uint32 `protobuf:"varint,3,opt,name=currentIndex,proto3" json:"currentIndex,omitempty"`
ValidIndexes []uint32 `protobuf:"varint,4,rep,packed,name=validIndexes,proto3" json:"validIndexes,omitempty"`
AccountType ADVEncryptionType `protobuf:"varint,5,opt,name=accountType,proto3,enum=WAAdv.ADVEncryptionType" json:"accountType,omitempty"`
}
func (x *ADVKeyIndexList) Reset() {
*x = ADVKeyIndexList{}
if protoimpl.UnsafeEnabled {
mi := &file_waAdv_WAAdv_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ADVKeyIndexList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ADVKeyIndexList) ProtoMessage() {}
func (x *ADVKeyIndexList) ProtoReflect() protoreflect.Message {
mi := &file_waAdv_WAAdv_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ADVKeyIndexList.ProtoReflect.Descriptor instead.
func (*ADVKeyIndexList) Descriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{0}
}
func (x *ADVKeyIndexList) GetRawID() uint32 {
if x != nil {
return x.RawID
}
return 0
}
func (x *ADVKeyIndexList) GetTimestamp() uint64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ADVKeyIndexList) GetCurrentIndex() uint32 {
if x != nil {
return x.CurrentIndex
}
return 0
}
func (x *ADVKeyIndexList) GetValidIndexes() []uint32 {
if x != nil {
return x.ValidIndexes
}
return nil
}
func (x *ADVKeyIndexList) GetAccountType() ADVEncryptionType {
if x != nil {
return x.AccountType
}
return ADVEncryptionType_E2EE
}
type ADVSignedKeyIndexList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
AccountSignature []byte `protobuf:"bytes,2,opt,name=accountSignature,proto3" json:"accountSignature,omitempty"`
AccountSignatureKey []byte `protobuf:"bytes,3,opt,name=accountSignatureKey,proto3" json:"accountSignatureKey,omitempty"`
}
func (x *ADVSignedKeyIndexList) Reset() {
*x = ADVSignedKeyIndexList{}
if protoimpl.UnsafeEnabled {
mi := &file_waAdv_WAAdv_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ADVSignedKeyIndexList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ADVSignedKeyIndexList) ProtoMessage() {}
func (x *ADVSignedKeyIndexList) ProtoReflect() protoreflect.Message {
mi := &file_waAdv_WAAdv_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ADVSignedKeyIndexList.ProtoReflect.Descriptor instead.
func (*ADVSignedKeyIndexList) Descriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{1}
}
func (x *ADVSignedKeyIndexList) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *ADVSignedKeyIndexList) GetAccountSignature() []byte {
if x != nil {
return x.AccountSignature
}
return nil
}
func (x *ADVSignedKeyIndexList) GetAccountSignatureKey() []byte {
if x != nil {
return x.AccountSignatureKey
}
return nil
}
type ADVDeviceIdentity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RawID uint32 `protobuf:"varint,1,opt,name=rawID,proto3" json:"rawID,omitempty"`
Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
KeyIndex uint32 `protobuf:"varint,3,opt,name=keyIndex,proto3" json:"keyIndex,omitempty"`
AccountType ADVEncryptionType `protobuf:"varint,4,opt,name=accountType,proto3,enum=WAAdv.ADVEncryptionType" json:"accountType,omitempty"`
DeviceType ADVEncryptionType `protobuf:"varint,5,opt,name=deviceType,proto3,enum=WAAdv.ADVEncryptionType" json:"deviceType,omitempty"`
}
func (x *ADVDeviceIdentity) Reset() {
*x = ADVDeviceIdentity{}
if protoimpl.UnsafeEnabled {
mi := &file_waAdv_WAAdv_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ADVDeviceIdentity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ADVDeviceIdentity) ProtoMessage() {}
func (x *ADVDeviceIdentity) ProtoReflect() protoreflect.Message {
mi := &file_waAdv_WAAdv_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ADVDeviceIdentity.ProtoReflect.Descriptor instead.
func (*ADVDeviceIdentity) Descriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{2}
}
func (x *ADVDeviceIdentity) GetRawID() uint32 {
if x != nil {
return x.RawID
}
return 0
}
func (x *ADVDeviceIdentity) GetTimestamp() uint64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ADVDeviceIdentity) GetKeyIndex() uint32 {
if x != nil {
return x.KeyIndex
}
return 0
}
func (x *ADVDeviceIdentity) GetAccountType() ADVEncryptionType {
if x != nil {
return x.AccountType
}
return ADVEncryptionType_E2EE
}
func (x *ADVDeviceIdentity) GetDeviceType() ADVEncryptionType {
if x != nil {
return x.DeviceType
}
return ADVEncryptionType_E2EE
}
type ADVSignedDeviceIdentity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
AccountSignatureKey []byte `protobuf:"bytes,2,opt,name=accountSignatureKey,proto3" json:"accountSignatureKey,omitempty"`
AccountSignature []byte `protobuf:"bytes,3,opt,name=accountSignature,proto3" json:"accountSignature,omitempty"`
DeviceSignature []byte `protobuf:"bytes,4,opt,name=deviceSignature,proto3" json:"deviceSignature,omitempty"`
}
func (x *ADVSignedDeviceIdentity) Reset() {
*x = ADVSignedDeviceIdentity{}
if protoimpl.UnsafeEnabled {
mi := &file_waAdv_WAAdv_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ADVSignedDeviceIdentity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ADVSignedDeviceIdentity) ProtoMessage() {}
func (x *ADVSignedDeviceIdentity) ProtoReflect() protoreflect.Message {
mi := &file_waAdv_WAAdv_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ADVSignedDeviceIdentity.ProtoReflect.Descriptor instead.
func (*ADVSignedDeviceIdentity) Descriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{3}
}
func (x *ADVSignedDeviceIdentity) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *ADVSignedDeviceIdentity) GetAccountSignatureKey() []byte {
if x != nil {
return x.AccountSignatureKey
}
return nil
}
func (x *ADVSignedDeviceIdentity) GetAccountSignature() []byte {
if x != nil {
return x.AccountSignature
}
return nil
}
func (x *ADVSignedDeviceIdentity) GetDeviceSignature() []byte {
if x != nil {
return x.DeviceSignature
}
return nil
}
type ADVSignedDeviceIdentityHMAC struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
HMAC []byte `protobuf:"bytes,2,opt,name=HMAC,proto3" json:"HMAC,omitempty"`
AccountType ADVEncryptionType `protobuf:"varint,3,opt,name=accountType,proto3,enum=WAAdv.ADVEncryptionType" json:"accountType,omitempty"`
}
func (x *ADVSignedDeviceIdentityHMAC) Reset() {
*x = ADVSignedDeviceIdentityHMAC{}
if protoimpl.UnsafeEnabled {
mi := &file_waAdv_WAAdv_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ADVSignedDeviceIdentityHMAC) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ADVSignedDeviceIdentityHMAC) ProtoMessage() {}
func (x *ADVSignedDeviceIdentityHMAC) ProtoReflect() protoreflect.Message {
mi := &file_waAdv_WAAdv_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ADVSignedDeviceIdentityHMAC.ProtoReflect.Descriptor instead.
func (*ADVSignedDeviceIdentityHMAC) Descriptor() ([]byte, []int) {
return file_waAdv_WAAdv_proto_rawDescGZIP(), []int{4}
}
func (x *ADVSignedDeviceIdentityHMAC) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *ADVSignedDeviceIdentityHMAC) GetHMAC() []byte {
if x != nil {
return x.HMAC
}
return nil
}
func (x *ADVSignedDeviceIdentityHMAC) GetAccountType() ADVEncryptionType {
if x != nil {
return x.AccountType
}
return ADVEncryptionType_E2EE
}
var File_waAdv_WAAdv_proto protoreflect.FileDescriptor
//go:embed WAAdv.pb.raw
var file_waAdv_WAAdv_proto_rawDesc []byte
var (
file_waAdv_WAAdv_proto_rawDescOnce sync.Once
file_waAdv_WAAdv_proto_rawDescData = file_waAdv_WAAdv_proto_rawDesc
)
func file_waAdv_WAAdv_proto_rawDescGZIP() []byte {
file_waAdv_WAAdv_proto_rawDescOnce.Do(func() {
file_waAdv_WAAdv_proto_rawDescData = protoimpl.X.CompressGZIP(file_waAdv_WAAdv_proto_rawDescData)
})
return file_waAdv_WAAdv_proto_rawDescData
}
var file_waAdv_WAAdv_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_waAdv_WAAdv_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_waAdv_WAAdv_proto_goTypes = []interface{}{
(ADVEncryptionType)(0), // 0: WAAdv.ADVEncryptionType
(*ADVKeyIndexList)(nil), // 1: WAAdv.ADVKeyIndexList
(*ADVSignedKeyIndexList)(nil), // 2: WAAdv.ADVSignedKeyIndexList
(*ADVDeviceIdentity)(nil), // 3: WAAdv.ADVDeviceIdentity
(*ADVSignedDeviceIdentity)(nil), // 4: WAAdv.ADVSignedDeviceIdentity
(*ADVSignedDeviceIdentityHMAC)(nil), // 5: WAAdv.ADVSignedDeviceIdentityHMAC
}
var file_waAdv_WAAdv_proto_depIdxs = []int32{
0, // 0: WAAdv.ADVKeyIndexList.accountType:type_name -> WAAdv.ADVEncryptionType
0, // 1: WAAdv.ADVDeviceIdentity.accountType:type_name -> WAAdv.ADVEncryptionType
0, // 2: WAAdv.ADVDeviceIdentity.deviceType:type_name -> WAAdv.ADVEncryptionType
0, // 3: WAAdv.ADVSignedDeviceIdentityHMAC.accountType:type_name -> WAAdv.ADVEncryptionType
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_waAdv_WAAdv_proto_init() }
func file_waAdv_WAAdv_proto_init() {
if File_waAdv_WAAdv_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waAdv_WAAdv_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ADVKeyIndexList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waAdv_WAAdv_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ADVSignedKeyIndexList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waAdv_WAAdv_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ADVDeviceIdentity); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waAdv_WAAdv_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ADVSignedDeviceIdentity); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waAdv_WAAdv_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ADVSignedDeviceIdentityHMAC); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waAdv_WAAdv_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waAdv_WAAdv_proto_goTypes,
DependencyIndexes: file_waAdv_WAAdv_proto_depIdxs,
EnumInfos: file_waAdv_WAAdv_proto_enumTypes,
MessageInfos: file_waAdv_WAAdv_proto_msgTypes,
}.Build()
File_waAdv_WAAdv_proto = out.File
file_waAdv_WAAdv_proto_rawDesc = nil
file_waAdv_WAAdv_proto_goTypes = nil
file_waAdv_WAAdv_proto_depIdxs = nil
}

@ -0,0 +1,43 @@
syntax = "proto3";
package WAAdv;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waAdv";
enum ADVEncryptionType {
E2EE = 0;
HOSTED = 1;
}
message ADVKeyIndexList {
uint32 rawID = 1;
uint64 timestamp = 2;
uint32 currentIndex = 3;
repeated uint32 validIndexes = 4 [packed=true];
ADVEncryptionType accountType = 5;
}
message ADVSignedKeyIndexList {
bytes details = 1;
bytes accountSignature = 2;
bytes accountSignatureKey = 3;
}
message ADVDeviceIdentity {
uint32 rawID = 1;
uint64 timestamp = 2;
uint32 keyIndex = 3;
ADVEncryptionType accountType = 4;
ADVEncryptionType deviceType = 5;
}
message ADVSignedDeviceIdentity {
bytes details = 1;
bytes accountSignatureKey = 2;
bytes accountSignature = 3;
bytes deviceSignature = 4;
}
message ADVSignedDeviceIdentityHMAC {
bytes details = 1;
bytes HMAC = 2;
ADVEncryptionType accountType = 3;
}

@ -0,0 +1,245 @@
syntax = "proto3";
package WAArmadilloApplication;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waArmadilloApplication";
import "waArmadilloXMA/WAArmadilloXMA.proto";
import "waCommon/WACommon.proto";
message Armadillo {
message Metadata {
}
message Payload {
oneof payload {
Content content = 1;
ApplicationData applicationData = 2;
Signal signal = 3;
SubProtocolPayload subProtocol = 4;
}
}
message SubProtocolPayload {
WACommon.FutureProofBehavior futureProof = 1;
}
message Signal {
message EncryptedBackupsSecrets {
message Epoch {
enum EpochStatus {
EPOCHSTATUS_UNKNOWN = 0;
ES_OPEN = 1;
ES_CLOSE = 2;
}
uint64 ID = 1;
bytes anonID = 2;
bytes rootKey = 3;
EpochStatus status = 4;
}
uint64 backupID = 1;
uint64 serverDataID = 2;
repeated Epoch epoch = 3;
bytes tempOcmfClientState = 4;
bytes mailboxRootKey = 5;
bytes obliviousValidationToken = 6;
}
oneof signal {
EncryptedBackupsSecrets encryptedBackupsSecrets = 1;
}
}
message ApplicationData {
message AIBotResponseMessage {
string summonToken = 1;
string messageText = 2;
string serializedExtras = 3;
}
message MetadataSyncAction {
message SyncMessageAction {
message ActionMessageDelete {
}
oneof action {
ActionMessageDelete messageDelete = 101;
}
WACommon.MessageKey key = 1;
}
message SyncChatAction {
message ActionChatRead {
SyncActionMessageRange messageRange = 1;
bool read = 2;
}
message ActionChatDelete {
SyncActionMessageRange messageRange = 1;
}
message ActionChatArchive {
SyncActionMessageRange messageRange = 1;
bool archived = 2;
}
oneof action {
ActionChatArchive chatArchive = 101;
ActionChatDelete chatDelete = 102;
ActionChatRead chatRead = 103;
}
string chatID = 1;
}
message SyncActionMessage {
WACommon.MessageKey key = 1;
int64 timestamp = 2;
}
message SyncActionMessageRange {
int64 lastMessageTimestamp = 1;
int64 lastSystemMessageTimestamp = 2;
repeated SyncActionMessage messages = 3;
}
oneof actionType {
SyncChatAction chatAction = 101;
SyncMessageAction messageAction = 102;
}
int64 actionTimestamp = 1;
}
message MetadataSyncNotification {
repeated MetadataSyncAction actions = 2;
}
oneof applicationData {
MetadataSyncNotification metadataSync = 1;
AIBotResponseMessage aiBotResponse = 2;
}
}
message Content {
message PaymentsTransactionMessage {
enum PaymentStatus {
PAYMENT_UNKNOWN = 0;
REQUEST_INITED = 4;
REQUEST_DECLINED = 5;
REQUEST_TRANSFER_INITED = 6;
REQUEST_TRANSFER_COMPLETED = 7;
REQUEST_TRANSFER_FAILED = 8;
REQUEST_CANCELED = 9;
REQUEST_EXPIRED = 10;
TRANSFER_INITED = 11;
TRANSFER_PENDING = 12;
TRANSFER_PENDING_RECIPIENT_VERIFICATION = 13;
TRANSFER_CANCELED = 14;
TRANSFER_COMPLETED = 15;
TRANSFER_NO_RECEIVER_CREDENTIAL_NO_RTS_PENDING_CANCELED = 16;
TRANSFER_NO_RECEIVER_CREDENTIAL_NO_RTS_PENDING_OTHER = 17;
TRANSFER_REFUNDED = 18;
TRANSFER_PARTIAL_REFUND = 19;
TRANSFER_CHARGED_BACK = 20;
TRANSFER_EXPIRED = 21;
TRANSFER_DECLINED = 22;
TRANSFER_UNAVAILABLE = 23;
}
uint64 transactionID = 1;
string amount = 2;
string currency = 3;
PaymentStatus paymentStatus = 4;
WAArmadilloXMA.ExtendedContentMessage extendedContentMessage = 5;
}
message NoteReplyMessage {
string noteID = 1;
WACommon.MessageText noteText = 2;
int64 noteTimestampMS = 3;
WACommon.MessageText noteReplyText = 4;
}
message BumpExistingMessage {
WACommon.MessageKey key = 1;
}
message ImageGalleryMessage {
repeated WACommon.SubProtocol images = 1;
}
message ScreenshotAction {
enum ScreenshotType {
SCREENSHOTTYPE_UNKNOWN = 0;
SCREENSHOT_IMAGE = 1;
SCREEN_RECORDING = 2;
}
ScreenshotType screenshotType = 1;
}
message ExtendedContentMessageWithSear {
string searID = 1;
bytes payload = 2;
string nativeURL = 3;
WACommon.SubProtocol searAssociatedMessage = 4;
string searSentWithMessageID = 5;
}
message RavenActionNotifMessage {
enum ActionType {
PLAYED = 0;
SCREENSHOT = 1;
FORCE_DISABLE = 2;
}
WACommon.MessageKey key = 1;
int64 actionTimestamp = 2;
ActionType actionType = 3;
}
message RavenMessage {
enum EphemeralType {
VIEW_ONCE = 0;
ALLOW_REPLAY = 1;
KEEP_IN_CHAT = 2;
}
oneof mediaContent {
WACommon.SubProtocol imageMessage = 2;
WACommon.SubProtocol videoMessage = 3;
}
EphemeralType ephemeralType = 1;
}
message CommonSticker {
enum StickerType {
STICKERTYPE_UNKNOWN = 0;
SMALL_LIKE = 1;
MEDIUM_LIKE = 2;
LARGE_LIKE = 3;
}
StickerType stickerType = 1;
}
oneof content {
CommonSticker commonSticker = 1;
ScreenshotAction screenshotAction = 3;
WAArmadilloXMA.ExtendedContentMessage extendedContentMessage = 4;
RavenMessage ravenMessage = 5;
RavenActionNotifMessage ravenActionNotifMessage = 6;
ExtendedContentMessageWithSear extendedMessageContentWithSear = 7;
ImageGalleryMessage imageGalleryMessage = 8;
PaymentsTransactionMessage paymentsTransactionMessage = 10;
BumpExistingMessage bumpExistingMessage = 11;
NoteReplyMessage noteReplyMessage = 13;
}
}
Payload payload = 1;
Metadata metadata = 2;
}

@ -0,0 +1,3 @@
package waArmadilloApplication
func (*Armadillo) IsMessageApplicationSub() {}

@ -0,0 +1,317 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waArmadilloBackupMessage/WAArmadilloBackupMessage.proto
package waArmadilloBackupMessage
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type BackupMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Metadata *BackupMessage_Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (x *BackupMessage) Reset() {
*x = BackupMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BackupMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BackupMessage) ProtoMessage() {}
func (x *BackupMessage) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BackupMessage.ProtoReflect.Descriptor instead.
func (*BackupMessage) Descriptor() ([]byte, []int) {
return file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescGZIP(), []int{0}
}
func (x *BackupMessage) GetMetadata() *BackupMessage_Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *BackupMessage) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
type BackupMessage_Metadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SenderID string `protobuf:"bytes,1,opt,name=senderID,proto3" json:"senderID,omitempty"`
MessageID string `protobuf:"bytes,2,opt,name=messageID,proto3" json:"messageID,omitempty"`
TimestampMS int64 `protobuf:"varint,3,opt,name=timestampMS,proto3" json:"timestampMS,omitempty"`
FrankingMetadata *BackupMessage_Metadata_FrankingMetadata `protobuf:"bytes,4,opt,name=frankingMetadata,proto3" json:"frankingMetadata,omitempty"`
PayloadVersion int32 `protobuf:"varint,5,opt,name=payloadVersion,proto3" json:"payloadVersion,omitempty"`
FutureProofBehavior int32 `protobuf:"varint,6,opt,name=futureProofBehavior,proto3" json:"futureProofBehavior,omitempty"`
}
func (x *BackupMessage_Metadata) Reset() {
*x = BackupMessage_Metadata{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BackupMessage_Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BackupMessage_Metadata) ProtoMessage() {}
func (x *BackupMessage_Metadata) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BackupMessage_Metadata.ProtoReflect.Descriptor instead.
func (*BackupMessage_Metadata) Descriptor() ([]byte, []int) {
return file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescGZIP(), []int{0, 0}
}
func (x *BackupMessage_Metadata) GetSenderID() string {
if x != nil {
return x.SenderID
}
return ""
}
func (x *BackupMessage_Metadata) GetMessageID() string {
if x != nil {
return x.MessageID
}
return ""
}
func (x *BackupMessage_Metadata) GetTimestampMS() int64 {
if x != nil {
return x.TimestampMS
}
return 0
}
func (x *BackupMessage_Metadata) GetFrankingMetadata() *BackupMessage_Metadata_FrankingMetadata {
if x != nil {
return x.FrankingMetadata
}
return nil
}
func (x *BackupMessage_Metadata) GetPayloadVersion() int32 {
if x != nil {
return x.PayloadVersion
}
return 0
}
func (x *BackupMessage_Metadata) GetFutureProofBehavior() int32 {
if x != nil {
return x.FutureProofBehavior
}
return 0
}
type BackupMessage_Metadata_FrankingMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FrankingTag []byte `protobuf:"bytes,3,opt,name=frankingTag,proto3" json:"frankingTag,omitempty"`
ReportingTag []byte `protobuf:"bytes,4,opt,name=reportingTag,proto3" json:"reportingTag,omitempty"`
}
func (x *BackupMessage_Metadata_FrankingMetadata) Reset() {
*x = BackupMessage_Metadata_FrankingMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BackupMessage_Metadata_FrankingMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BackupMessage_Metadata_FrankingMetadata) ProtoMessage() {}
func (x *BackupMessage_Metadata_FrankingMetadata) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BackupMessage_Metadata_FrankingMetadata.ProtoReflect.Descriptor instead.
func (*BackupMessage_Metadata_FrankingMetadata) Descriptor() ([]byte, []int) {
return file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescGZIP(), []int{0, 0, 0}
}
func (x *BackupMessage_Metadata_FrankingMetadata) GetFrankingTag() []byte {
if x != nil {
return x.FrankingTag
}
return nil
}
func (x *BackupMessage_Metadata_FrankingMetadata) GetReportingTag() []byte {
if x != nil {
return x.ReportingTag
}
return nil
}
var File_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto protoreflect.FileDescriptor
//go:embed WAArmadilloBackupMessage.pb.raw
var file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDesc []byte
var (
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescOnce sync.Once
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescData = file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDesc
)
func file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescGZIP() []byte {
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescOnce.Do(func() {
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescData = protoimpl.X.CompressGZIP(file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescData)
})
return file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDescData
}
var file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_goTypes = []interface{}{
(*BackupMessage)(nil), // 0: WAArmadilloBackupMessage.BackupMessage
(*BackupMessage_Metadata)(nil), // 1: WAArmadilloBackupMessage.BackupMessage.Metadata
(*BackupMessage_Metadata_FrankingMetadata)(nil), // 2: WAArmadilloBackupMessage.BackupMessage.Metadata.FrankingMetadata
}
var file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_depIdxs = []int32{
1, // 0: WAArmadilloBackupMessage.BackupMessage.metadata:type_name -> WAArmadilloBackupMessage.BackupMessage.Metadata
2, // 1: WAArmadilloBackupMessage.BackupMessage.Metadata.frankingMetadata:type_name -> WAArmadilloBackupMessage.BackupMessage.Metadata.FrankingMetadata
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_init() }
func file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_init() {
if File_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BackupMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BackupMessage_Metadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BackupMessage_Metadata_FrankingMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_goTypes,
DependencyIndexes: file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_depIdxs,
MessageInfos: file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_msgTypes,
}.Build()
File_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto = out.File
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_rawDesc = nil
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_goTypes = nil
file_waArmadilloBackupMessage_WAArmadilloBackupMessage_proto_depIdxs = nil
}

@ -0,0 +1,15 @@
7waArmadilloBackupMessage/WAArmadilloBackupMessage.protoWAArmadilloBackupMessage"ƒ
BackupMessageL
metadata ( 20.WAArmadilloBackupMessage.BackupMessage.MetadataRmetadata
payload ( Rpayload
Metadata
senderID ( RsenderID
messageID ( R messageID
timestampMS (R timestampMSm
frankingMetadata ( 2A.WAArmadilloBackupMessage.BackupMessage.Metadata.FrankingMetadataRfrankingMetadata&
payloadVersion (RpayloadVersion0
futureProofBehavior (RfutureProofBehaviorX
FrankingMetadata
frankingTag ( R frankingTag"
reportingTag ( R reportingTagB?Z=go.mau.fi/whatsmeow/binary/armadillo/waArmadilloBackupMessagebproto3

@ -0,0 +1,22 @@
syntax = "proto3";
package WAArmadilloBackupMessage;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waArmadilloBackupMessage";
message BackupMessage {
message Metadata {
message FrankingMetadata {
bytes frankingTag = 3;
bytes reportingTag = 4;
}
string senderID = 1;
string messageID = 2;
int64 timestampMS = 3;
FrankingMetadata frankingMetadata = 4;
int32 payloadVersion = 5;
int32 futureProofBehavior = 6;
}
Metadata metadata = 1;
bytes payload = 2;
}

@ -0,0 +1,231 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waArmadilloICDC/WAArmadilloICDC.proto
package waArmadilloICDC
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ICDCIdentityList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Seq int32 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Devices [][]byte `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
SigningDeviceIndex int32 `protobuf:"varint,4,opt,name=signingDeviceIndex,proto3" json:"signingDeviceIndex,omitempty"`
}
func (x *ICDCIdentityList) Reset() {
*x = ICDCIdentityList{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ICDCIdentityList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ICDCIdentityList) ProtoMessage() {}
func (x *ICDCIdentityList) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ICDCIdentityList.ProtoReflect.Descriptor instead.
func (*ICDCIdentityList) Descriptor() ([]byte, []int) {
return file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescGZIP(), []int{0}
}
func (x *ICDCIdentityList) GetSeq() int32 {
if x != nil {
return x.Seq
}
return 0
}
func (x *ICDCIdentityList) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ICDCIdentityList) GetDevices() [][]byte {
if x != nil {
return x.Devices
}
return nil
}
func (x *ICDCIdentityList) GetSigningDeviceIndex() int32 {
if x != nil {
return x.SigningDeviceIndex
}
return 0
}
type SignedICDCIdentityList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}
func (x *SignedICDCIdentityList) Reset() {
*x = SignedICDCIdentityList{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignedICDCIdentityList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignedICDCIdentityList) ProtoMessage() {}
func (x *SignedICDCIdentityList) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignedICDCIdentityList.ProtoReflect.Descriptor instead.
func (*SignedICDCIdentityList) Descriptor() ([]byte, []int) {
return file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescGZIP(), []int{1}
}
func (x *SignedICDCIdentityList) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *SignedICDCIdentityList) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
var File_waArmadilloICDC_WAArmadilloICDC_proto protoreflect.FileDescriptor
//go:embed WAArmadilloICDC.pb.raw
var file_waArmadilloICDC_WAArmadilloICDC_proto_rawDesc []byte
var (
file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescOnce sync.Once
file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescData = file_waArmadilloICDC_WAArmadilloICDC_proto_rawDesc
)
func file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescGZIP() []byte {
file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescOnce.Do(func() {
file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescData = protoimpl.X.CompressGZIP(file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescData)
})
return file_waArmadilloICDC_WAArmadilloICDC_proto_rawDescData
}
var file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_waArmadilloICDC_WAArmadilloICDC_proto_goTypes = []interface{}{
(*ICDCIdentityList)(nil), // 0: WAArmadilloICDC.ICDCIdentityList
(*SignedICDCIdentityList)(nil), // 1: WAArmadilloICDC.SignedICDCIdentityList
}
var file_waArmadilloICDC_WAArmadilloICDC_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_waArmadilloICDC_WAArmadilloICDC_proto_init() }
func file_waArmadilloICDC_WAArmadilloICDC_proto_init() {
if File_waArmadilloICDC_WAArmadilloICDC_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ICDCIdentityList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignedICDCIdentityList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waArmadilloICDC_WAArmadilloICDC_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waArmadilloICDC_WAArmadilloICDC_proto_goTypes,
DependencyIndexes: file_waArmadilloICDC_WAArmadilloICDC_proto_depIdxs,
MessageInfos: file_waArmadilloICDC_WAArmadilloICDC_proto_msgTypes,
}.Build()
File_waArmadilloICDC_WAArmadilloICDC_proto = out.File
file_waArmadilloICDC_WAArmadilloICDC_proto_rawDesc = nil
file_waArmadilloICDC_WAArmadilloICDC_proto_goTypes = nil
file_waArmadilloICDC_WAArmadilloICDC_proto_depIdxs = nil
}

@ -0,0 +1,10 @@
%waArmadilloICDC/WAArmadilloICDC.protoWAArmadilloICDC"Œ
ICDCIdentityList
seq (Rseq
timestamp (R timestamp
devices ( Rdevices.
signingDeviceIndex (RsigningDeviceIndex"P
SignedICDCIdentityList
details ( Rdetails
signature ( R signatureB6Z4go.mau.fi/whatsmeow/binary/armadillo/waArmadilloICDCbproto3

@ -0,0 +1,15 @@
syntax = "proto3";
package WAArmadilloICDC;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waArmadilloICDC";
message ICDCIdentityList {
int32 seq = 1;
int64 timestamp = 2;
repeated bytes devices = 3;
int32 signingDeviceIndex = 4;
}
message SignedICDCIdentityList {
bytes details = 1;
bytes signature = 2;
}

@ -0,0 +1,785 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waArmadilloXMA/WAArmadilloXMA.proto
package waArmadilloXMA
import (
reflect "reflect"
sync "sync"
waCommon "go.mau.fi/whatsmeow/binary/armadillo/waCommon"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ExtendedContentMessage_OverlayIconGlyph int32
const (
ExtendedContentMessage_INFO ExtendedContentMessage_OverlayIconGlyph = 0
ExtendedContentMessage_EYE_OFF ExtendedContentMessage_OverlayIconGlyph = 1
ExtendedContentMessage_NEWS_OFF ExtendedContentMessage_OverlayIconGlyph = 2
ExtendedContentMessage_WARNING ExtendedContentMessage_OverlayIconGlyph = 3
ExtendedContentMessage_PRIVATE ExtendedContentMessage_OverlayIconGlyph = 4
ExtendedContentMessage_NONE ExtendedContentMessage_OverlayIconGlyph = 5
ExtendedContentMessage_MEDIA_LABEL ExtendedContentMessage_OverlayIconGlyph = 6
ExtendedContentMessage_POST_COVER ExtendedContentMessage_OverlayIconGlyph = 7
ExtendedContentMessage_POST_LABEL ExtendedContentMessage_OverlayIconGlyph = 8
ExtendedContentMessage_WARNING_SCREENS ExtendedContentMessage_OverlayIconGlyph = 9
)
// Enum value maps for ExtendedContentMessage_OverlayIconGlyph.
var (
ExtendedContentMessage_OverlayIconGlyph_name = map[int32]string{
0: "INFO",
1: "EYE_OFF",
2: "NEWS_OFF",
3: "WARNING",
4: "PRIVATE",
5: "NONE",
6: "MEDIA_LABEL",
7: "POST_COVER",
8: "POST_LABEL",
9: "WARNING_SCREENS",
}
ExtendedContentMessage_OverlayIconGlyph_value = map[string]int32{
"INFO": 0,
"EYE_OFF": 1,
"NEWS_OFF": 2,
"WARNING": 3,
"PRIVATE": 4,
"NONE": 5,
"MEDIA_LABEL": 6,
"POST_COVER": 7,
"POST_LABEL": 8,
"WARNING_SCREENS": 9,
}
)
func (x ExtendedContentMessage_OverlayIconGlyph) Enum() *ExtendedContentMessage_OverlayIconGlyph {
p := new(ExtendedContentMessage_OverlayIconGlyph)
*p = x
return p
}
func (x ExtendedContentMessage_OverlayIconGlyph) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExtendedContentMessage_OverlayIconGlyph) Descriptor() protoreflect.EnumDescriptor {
return file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[0].Descriptor()
}
func (ExtendedContentMessage_OverlayIconGlyph) Type() protoreflect.EnumType {
return &file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[0]
}
func (x ExtendedContentMessage_OverlayIconGlyph) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExtendedContentMessage_OverlayIconGlyph.Descriptor instead.
func (ExtendedContentMessage_OverlayIconGlyph) EnumDescriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0, 0}
}
type ExtendedContentMessage_CtaButtonType int32
const (
ExtendedContentMessage_CTABUTTONTYPE_UNKNOWN ExtendedContentMessage_CtaButtonType = 0
ExtendedContentMessage_OPEN_NATIVE ExtendedContentMessage_CtaButtonType = 11
)
// Enum value maps for ExtendedContentMessage_CtaButtonType.
var (
ExtendedContentMessage_CtaButtonType_name = map[int32]string{
0: "CTABUTTONTYPE_UNKNOWN",
11: "OPEN_NATIVE",
}
ExtendedContentMessage_CtaButtonType_value = map[string]int32{
"CTABUTTONTYPE_UNKNOWN": 0,
"OPEN_NATIVE": 11,
}
)
func (x ExtendedContentMessage_CtaButtonType) Enum() *ExtendedContentMessage_CtaButtonType {
p := new(ExtendedContentMessage_CtaButtonType)
*p = x
return p
}
func (x ExtendedContentMessage_CtaButtonType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExtendedContentMessage_CtaButtonType) Descriptor() protoreflect.EnumDescriptor {
return file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[1].Descriptor()
}
func (ExtendedContentMessage_CtaButtonType) Type() protoreflect.EnumType {
return &file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[1]
}
func (x ExtendedContentMessage_CtaButtonType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExtendedContentMessage_CtaButtonType.Descriptor instead.
func (ExtendedContentMessage_CtaButtonType) EnumDescriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0, 1}
}
type ExtendedContentMessage_XmaLayoutType int32
const (
ExtendedContentMessage_SINGLE ExtendedContentMessage_XmaLayoutType = 0
ExtendedContentMessage_PORTRAIT ExtendedContentMessage_XmaLayoutType = 3
ExtendedContentMessage_STANDARD_DXMA ExtendedContentMessage_XmaLayoutType = 12
ExtendedContentMessage_LIST_DXMA ExtendedContentMessage_XmaLayoutType = 15
)
// Enum value maps for ExtendedContentMessage_XmaLayoutType.
var (
ExtendedContentMessage_XmaLayoutType_name = map[int32]string{
0: "SINGLE",
3: "PORTRAIT",
12: "STANDARD_DXMA",
15: "LIST_DXMA",
}
ExtendedContentMessage_XmaLayoutType_value = map[string]int32{
"SINGLE": 0,
"PORTRAIT": 3,
"STANDARD_DXMA": 12,
"LIST_DXMA": 15,
}
)
func (x ExtendedContentMessage_XmaLayoutType) Enum() *ExtendedContentMessage_XmaLayoutType {
p := new(ExtendedContentMessage_XmaLayoutType)
*p = x
return p
}
func (x ExtendedContentMessage_XmaLayoutType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExtendedContentMessage_XmaLayoutType) Descriptor() protoreflect.EnumDescriptor {
return file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[2].Descriptor()
}
func (ExtendedContentMessage_XmaLayoutType) Type() protoreflect.EnumType {
return &file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[2]
}
func (x ExtendedContentMessage_XmaLayoutType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExtendedContentMessage_XmaLayoutType.Descriptor instead.
func (ExtendedContentMessage_XmaLayoutType) EnumDescriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0, 2}
}
type ExtendedContentMessage_ExtendedContentType int32
const (
ExtendedContentMessage_EXTENDEDCONTENTTYPE_UNKNOWN ExtendedContentMessage_ExtendedContentType = 0
ExtendedContentMessage_IG_STORY_PHOTO_MENTION ExtendedContentMessage_ExtendedContentType = 4
ExtendedContentMessage_IG_SINGLE_IMAGE_POST_SHARE ExtendedContentMessage_ExtendedContentType = 9
ExtendedContentMessage_IG_MULTIPOST_SHARE ExtendedContentMessage_ExtendedContentType = 10
ExtendedContentMessage_IG_SINGLE_VIDEO_POST_SHARE ExtendedContentMessage_ExtendedContentType = 11
ExtendedContentMessage_IG_STORY_PHOTO_SHARE ExtendedContentMessage_ExtendedContentType = 12
ExtendedContentMessage_IG_STORY_VIDEO_SHARE ExtendedContentMessage_ExtendedContentType = 13
ExtendedContentMessage_IG_CLIPS_SHARE ExtendedContentMessage_ExtendedContentType = 14
ExtendedContentMessage_IG_IGTV_SHARE ExtendedContentMessage_ExtendedContentType = 15
ExtendedContentMessage_IG_SHOP_SHARE ExtendedContentMessage_ExtendedContentType = 16
ExtendedContentMessage_IG_PROFILE_SHARE ExtendedContentMessage_ExtendedContentType = 19
ExtendedContentMessage_IG_STORY_PHOTO_HIGHLIGHT_SHARE ExtendedContentMessage_ExtendedContentType = 20
ExtendedContentMessage_IG_STORY_VIDEO_HIGHLIGHT_SHARE ExtendedContentMessage_ExtendedContentType = 21
ExtendedContentMessage_IG_STORY_REPLY ExtendedContentMessage_ExtendedContentType = 22
ExtendedContentMessage_IG_STORY_REACTION ExtendedContentMessage_ExtendedContentType = 23
ExtendedContentMessage_IG_STORY_VIDEO_MENTION ExtendedContentMessage_ExtendedContentType = 24
ExtendedContentMessage_IG_STORY_HIGHLIGHT_REPLY ExtendedContentMessage_ExtendedContentType = 25
ExtendedContentMessage_IG_STORY_HIGHLIGHT_REACTION ExtendedContentMessage_ExtendedContentType = 26
ExtendedContentMessage_IG_EXTERNAL_LINK ExtendedContentMessage_ExtendedContentType = 27
ExtendedContentMessage_IG_RECEIVER_FETCH ExtendedContentMessage_ExtendedContentType = 28
ExtendedContentMessage_FB_FEED_SHARE ExtendedContentMessage_ExtendedContentType = 1000
ExtendedContentMessage_FB_STORY_REPLY ExtendedContentMessage_ExtendedContentType = 1001
ExtendedContentMessage_FB_STORY_SHARE ExtendedContentMessage_ExtendedContentType = 1002
ExtendedContentMessage_FB_STORY_MENTION ExtendedContentMessage_ExtendedContentType = 1003
ExtendedContentMessage_FB_FEED_VIDEO_SHARE ExtendedContentMessage_ExtendedContentType = 1004
ExtendedContentMessage_FB_GAMING_CUSTOM_UPDATE ExtendedContentMessage_ExtendedContentType = 1005
ExtendedContentMessage_FB_PRODUCER_STORY_REPLY ExtendedContentMessage_ExtendedContentType = 1006
ExtendedContentMessage_FB_EVENT ExtendedContentMessage_ExtendedContentType = 1007
ExtendedContentMessage_FB_FEED_POST_PRIVATE_REPLY ExtendedContentMessage_ExtendedContentType = 1008
ExtendedContentMessage_FB_SHORT ExtendedContentMessage_ExtendedContentType = 1009
ExtendedContentMessage_FB_COMMENT_MENTION_SHARE ExtendedContentMessage_ExtendedContentType = 1010
ExtendedContentMessage_MSG_EXTERNAL_LINK_SHARE ExtendedContentMessage_ExtendedContentType = 2000
ExtendedContentMessage_MSG_P2P_PAYMENT ExtendedContentMessage_ExtendedContentType = 2001
ExtendedContentMessage_MSG_LOCATION_SHARING ExtendedContentMessage_ExtendedContentType = 2002
ExtendedContentMessage_MSG_LOCATION_SHARING_V2 ExtendedContentMessage_ExtendedContentType = 2003
ExtendedContentMessage_MSG_HIGHLIGHTS_TAB_FRIEND_UPDATES_REPLY ExtendedContentMessage_ExtendedContentType = 2004
ExtendedContentMessage_MSG_HIGHLIGHTS_TAB_LOCAL_EVENT_REPLY ExtendedContentMessage_ExtendedContentType = 2005
ExtendedContentMessage_MSG_RECEIVER_FETCH ExtendedContentMessage_ExtendedContentType = 2006
ExtendedContentMessage_MSG_IG_MEDIA_SHARE ExtendedContentMessage_ExtendedContentType = 2007
ExtendedContentMessage_MSG_GEN_AI_SEARCH_PLUGIN_RESPONSE ExtendedContentMessage_ExtendedContentType = 2008
ExtendedContentMessage_MSG_REELS_LIST ExtendedContentMessage_ExtendedContentType = 2009
ExtendedContentMessage_MSG_CONTACT ExtendedContentMessage_ExtendedContentType = 2010
ExtendedContentMessage_RTC_AUDIO_CALL ExtendedContentMessage_ExtendedContentType = 3000
ExtendedContentMessage_RTC_VIDEO_CALL ExtendedContentMessage_ExtendedContentType = 3001
ExtendedContentMessage_RTC_MISSED_AUDIO_CALL ExtendedContentMessage_ExtendedContentType = 3002
ExtendedContentMessage_RTC_MISSED_VIDEO_CALL ExtendedContentMessage_ExtendedContentType = 3003
ExtendedContentMessage_RTC_GROUP_AUDIO_CALL ExtendedContentMessage_ExtendedContentType = 3004
ExtendedContentMessage_RTC_GROUP_VIDEO_CALL ExtendedContentMessage_ExtendedContentType = 3005
ExtendedContentMessage_RTC_MISSED_GROUP_AUDIO_CALL ExtendedContentMessage_ExtendedContentType = 3006
ExtendedContentMessage_RTC_MISSED_GROUP_VIDEO_CALL ExtendedContentMessage_ExtendedContentType = 3007
ExtendedContentMessage_DATACLASS_SENDER_COPY ExtendedContentMessage_ExtendedContentType = 4000
)
// Enum value maps for ExtendedContentMessage_ExtendedContentType.
var (
ExtendedContentMessage_ExtendedContentType_name = map[int32]string{
0: "EXTENDEDCONTENTTYPE_UNKNOWN",
4: "IG_STORY_PHOTO_MENTION",
9: "IG_SINGLE_IMAGE_POST_SHARE",
10: "IG_MULTIPOST_SHARE",
11: "IG_SINGLE_VIDEO_POST_SHARE",
12: "IG_STORY_PHOTO_SHARE",
13: "IG_STORY_VIDEO_SHARE",
14: "IG_CLIPS_SHARE",
15: "IG_IGTV_SHARE",
16: "IG_SHOP_SHARE",
19: "IG_PROFILE_SHARE",
20: "IG_STORY_PHOTO_HIGHLIGHT_SHARE",
21: "IG_STORY_VIDEO_HIGHLIGHT_SHARE",
22: "IG_STORY_REPLY",
23: "IG_STORY_REACTION",
24: "IG_STORY_VIDEO_MENTION",
25: "IG_STORY_HIGHLIGHT_REPLY",
26: "IG_STORY_HIGHLIGHT_REACTION",
27: "IG_EXTERNAL_LINK",
28: "IG_RECEIVER_FETCH",
1000: "FB_FEED_SHARE",
1001: "FB_STORY_REPLY",
1002: "FB_STORY_SHARE",
1003: "FB_STORY_MENTION",
1004: "FB_FEED_VIDEO_SHARE",
1005: "FB_GAMING_CUSTOM_UPDATE",
1006: "FB_PRODUCER_STORY_REPLY",
1007: "FB_EVENT",
1008: "FB_FEED_POST_PRIVATE_REPLY",
1009: "FB_SHORT",
1010: "FB_COMMENT_MENTION_SHARE",
2000: "MSG_EXTERNAL_LINK_SHARE",
2001: "MSG_P2P_PAYMENT",
2002: "MSG_LOCATION_SHARING",
2003: "MSG_LOCATION_SHARING_V2",
2004: "MSG_HIGHLIGHTS_TAB_FRIEND_UPDATES_REPLY",
2005: "MSG_HIGHLIGHTS_TAB_LOCAL_EVENT_REPLY",
2006: "MSG_RECEIVER_FETCH",
2007: "MSG_IG_MEDIA_SHARE",
2008: "MSG_GEN_AI_SEARCH_PLUGIN_RESPONSE",
2009: "MSG_REELS_LIST",
2010: "MSG_CONTACT",
3000: "RTC_AUDIO_CALL",
3001: "RTC_VIDEO_CALL",
3002: "RTC_MISSED_AUDIO_CALL",
3003: "RTC_MISSED_VIDEO_CALL",
3004: "RTC_GROUP_AUDIO_CALL",
3005: "RTC_GROUP_VIDEO_CALL",
3006: "RTC_MISSED_GROUP_AUDIO_CALL",
3007: "RTC_MISSED_GROUP_VIDEO_CALL",
4000: "DATACLASS_SENDER_COPY",
}
ExtendedContentMessage_ExtendedContentType_value = map[string]int32{
"EXTENDEDCONTENTTYPE_UNKNOWN": 0,
"IG_STORY_PHOTO_MENTION": 4,
"IG_SINGLE_IMAGE_POST_SHARE": 9,
"IG_MULTIPOST_SHARE": 10,
"IG_SINGLE_VIDEO_POST_SHARE": 11,
"IG_STORY_PHOTO_SHARE": 12,
"IG_STORY_VIDEO_SHARE": 13,
"IG_CLIPS_SHARE": 14,
"IG_IGTV_SHARE": 15,
"IG_SHOP_SHARE": 16,
"IG_PROFILE_SHARE": 19,
"IG_STORY_PHOTO_HIGHLIGHT_SHARE": 20,
"IG_STORY_VIDEO_HIGHLIGHT_SHARE": 21,
"IG_STORY_REPLY": 22,
"IG_STORY_REACTION": 23,
"IG_STORY_VIDEO_MENTION": 24,
"IG_STORY_HIGHLIGHT_REPLY": 25,
"IG_STORY_HIGHLIGHT_REACTION": 26,
"IG_EXTERNAL_LINK": 27,
"IG_RECEIVER_FETCH": 28,
"FB_FEED_SHARE": 1000,
"FB_STORY_REPLY": 1001,
"FB_STORY_SHARE": 1002,
"FB_STORY_MENTION": 1003,
"FB_FEED_VIDEO_SHARE": 1004,
"FB_GAMING_CUSTOM_UPDATE": 1005,
"FB_PRODUCER_STORY_REPLY": 1006,
"FB_EVENT": 1007,
"FB_FEED_POST_PRIVATE_REPLY": 1008,
"FB_SHORT": 1009,
"FB_COMMENT_MENTION_SHARE": 1010,
"MSG_EXTERNAL_LINK_SHARE": 2000,
"MSG_P2P_PAYMENT": 2001,
"MSG_LOCATION_SHARING": 2002,
"MSG_LOCATION_SHARING_V2": 2003,
"MSG_HIGHLIGHTS_TAB_FRIEND_UPDATES_REPLY": 2004,
"MSG_HIGHLIGHTS_TAB_LOCAL_EVENT_REPLY": 2005,
"MSG_RECEIVER_FETCH": 2006,
"MSG_IG_MEDIA_SHARE": 2007,
"MSG_GEN_AI_SEARCH_PLUGIN_RESPONSE": 2008,
"MSG_REELS_LIST": 2009,
"MSG_CONTACT": 2010,
"RTC_AUDIO_CALL": 3000,
"RTC_VIDEO_CALL": 3001,
"RTC_MISSED_AUDIO_CALL": 3002,
"RTC_MISSED_VIDEO_CALL": 3003,
"RTC_GROUP_AUDIO_CALL": 3004,
"RTC_GROUP_VIDEO_CALL": 3005,
"RTC_MISSED_GROUP_AUDIO_CALL": 3006,
"RTC_MISSED_GROUP_VIDEO_CALL": 3007,
"DATACLASS_SENDER_COPY": 4000,
}
)
func (x ExtendedContentMessage_ExtendedContentType) Enum() *ExtendedContentMessage_ExtendedContentType {
p := new(ExtendedContentMessage_ExtendedContentType)
*p = x
return p
}
func (x ExtendedContentMessage_ExtendedContentType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExtendedContentMessage_ExtendedContentType) Descriptor() protoreflect.EnumDescriptor {
return file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[3].Descriptor()
}
func (ExtendedContentMessage_ExtendedContentType) Type() protoreflect.EnumType {
return &file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes[3]
}
func (x ExtendedContentMessage_ExtendedContentType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExtendedContentMessage_ExtendedContentType.Descriptor instead.
func (ExtendedContentMessage_ExtendedContentType) EnumDescriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0, 3}
}
type ExtendedContentMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AssociatedMessage *waCommon.SubProtocol `protobuf:"bytes,1,opt,name=associatedMessage,proto3" json:"associatedMessage,omitempty"`
TargetType ExtendedContentMessage_ExtendedContentType `protobuf:"varint,2,opt,name=targetType,proto3,enum=WAArmadilloXMA.ExtendedContentMessage_ExtendedContentType" json:"targetType,omitempty"`
TargetUsername string `protobuf:"bytes,3,opt,name=targetUsername,proto3" json:"targetUsername,omitempty"`
TargetID string `protobuf:"bytes,4,opt,name=targetID,proto3" json:"targetID,omitempty"`
TargetExpiringAtSec int64 `protobuf:"varint,5,opt,name=targetExpiringAtSec,proto3" json:"targetExpiringAtSec,omitempty"`
XmaLayoutType ExtendedContentMessage_XmaLayoutType `protobuf:"varint,6,opt,name=xmaLayoutType,proto3,enum=WAArmadilloXMA.ExtendedContentMessage_XmaLayoutType" json:"xmaLayoutType,omitempty"`
Ctas []*ExtendedContentMessage_CTA `protobuf:"bytes,7,rep,name=ctas,proto3" json:"ctas,omitempty"`
Previews []*waCommon.SubProtocol `protobuf:"bytes,8,rep,name=previews,proto3" json:"previews,omitempty"`
TitleText string `protobuf:"bytes,9,opt,name=titleText,proto3" json:"titleText,omitempty"`
SubtitleText string `protobuf:"bytes,10,opt,name=subtitleText,proto3" json:"subtitleText,omitempty"`
MaxTitleNumOfLines uint32 `protobuf:"varint,11,opt,name=maxTitleNumOfLines,proto3" json:"maxTitleNumOfLines,omitempty"`
MaxSubtitleNumOfLines uint32 `protobuf:"varint,12,opt,name=maxSubtitleNumOfLines,proto3" json:"maxSubtitleNumOfLines,omitempty"`
Favicon *waCommon.SubProtocol `protobuf:"bytes,13,opt,name=favicon,proto3" json:"favicon,omitempty"`
HeaderImage *waCommon.SubProtocol `protobuf:"bytes,14,opt,name=headerImage,proto3" json:"headerImage,omitempty"`
HeaderTitle string `protobuf:"bytes,15,opt,name=headerTitle,proto3" json:"headerTitle,omitempty"`
OverlayIconGlyph ExtendedContentMessage_OverlayIconGlyph `protobuf:"varint,16,opt,name=overlayIconGlyph,proto3,enum=WAArmadilloXMA.ExtendedContentMessage_OverlayIconGlyph" json:"overlayIconGlyph,omitempty"`
OverlayTitle string `protobuf:"bytes,17,opt,name=overlayTitle,proto3" json:"overlayTitle,omitempty"`
OverlayDescription string `protobuf:"bytes,18,opt,name=overlayDescription,proto3" json:"overlayDescription,omitempty"`
SentWithMessageID string `protobuf:"bytes,19,opt,name=sentWithMessageID,proto3" json:"sentWithMessageID,omitempty"`
MessageText string `protobuf:"bytes,20,opt,name=messageText,proto3" json:"messageText,omitempty"`
HeaderSubtitle string `protobuf:"bytes,21,opt,name=headerSubtitle,proto3" json:"headerSubtitle,omitempty"`
XmaDataclass string `protobuf:"bytes,22,opt,name=xmaDataclass,proto3" json:"xmaDataclass,omitempty"`
ContentRef string `protobuf:"bytes,23,opt,name=contentRef,proto3" json:"contentRef,omitempty"`
}
func (x *ExtendedContentMessage) Reset() {
*x = ExtendedContentMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExtendedContentMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtendedContentMessage) ProtoMessage() {}
func (x *ExtendedContentMessage) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtendedContentMessage.ProtoReflect.Descriptor instead.
func (*ExtendedContentMessage) Descriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0}
}
func (x *ExtendedContentMessage) GetAssociatedMessage() *waCommon.SubProtocol {
if x != nil {
return x.AssociatedMessage
}
return nil
}
func (x *ExtendedContentMessage) GetTargetType() ExtendedContentMessage_ExtendedContentType {
if x != nil {
return x.TargetType
}
return ExtendedContentMessage_EXTENDEDCONTENTTYPE_UNKNOWN
}
func (x *ExtendedContentMessage) GetTargetUsername() string {
if x != nil {
return x.TargetUsername
}
return ""
}
func (x *ExtendedContentMessage) GetTargetID() string {
if x != nil {
return x.TargetID
}
return ""
}
func (x *ExtendedContentMessage) GetTargetExpiringAtSec() int64 {
if x != nil {
return x.TargetExpiringAtSec
}
return 0
}
func (x *ExtendedContentMessage) GetXmaLayoutType() ExtendedContentMessage_XmaLayoutType {
if x != nil {
return x.XmaLayoutType
}
return ExtendedContentMessage_SINGLE
}
func (x *ExtendedContentMessage) GetCtas() []*ExtendedContentMessage_CTA {
if x != nil {
return x.Ctas
}
return nil
}
func (x *ExtendedContentMessage) GetPreviews() []*waCommon.SubProtocol {
if x != nil {
return x.Previews
}
return nil
}
func (x *ExtendedContentMessage) GetTitleText() string {
if x != nil {
return x.TitleText
}
return ""
}
func (x *ExtendedContentMessage) GetSubtitleText() string {
if x != nil {
return x.SubtitleText
}
return ""
}
func (x *ExtendedContentMessage) GetMaxTitleNumOfLines() uint32 {
if x != nil {
return x.MaxTitleNumOfLines
}
return 0
}
func (x *ExtendedContentMessage) GetMaxSubtitleNumOfLines() uint32 {
if x != nil {
return x.MaxSubtitleNumOfLines
}
return 0
}
func (x *ExtendedContentMessage) GetFavicon() *waCommon.SubProtocol {
if x != nil {
return x.Favicon
}
return nil
}
func (x *ExtendedContentMessage) GetHeaderImage() *waCommon.SubProtocol {
if x != nil {
return x.HeaderImage
}
return nil
}
func (x *ExtendedContentMessage) GetHeaderTitle() string {
if x != nil {
return x.HeaderTitle
}
return ""
}
func (x *ExtendedContentMessage) GetOverlayIconGlyph() ExtendedContentMessage_OverlayIconGlyph {
if x != nil {
return x.OverlayIconGlyph
}
return ExtendedContentMessage_INFO
}
func (x *ExtendedContentMessage) GetOverlayTitle() string {
if x != nil {
return x.OverlayTitle
}
return ""
}
func (x *ExtendedContentMessage) GetOverlayDescription() string {
if x != nil {
return x.OverlayDescription
}
return ""
}
func (x *ExtendedContentMessage) GetSentWithMessageID() string {
if x != nil {
return x.SentWithMessageID
}
return ""
}
func (x *ExtendedContentMessage) GetMessageText() string {
if x != nil {
return x.MessageText
}
return ""
}
func (x *ExtendedContentMessage) GetHeaderSubtitle() string {
if x != nil {
return x.HeaderSubtitle
}
return ""
}
func (x *ExtendedContentMessage) GetXmaDataclass() string {
if x != nil {
return x.XmaDataclass
}
return ""
}
func (x *ExtendedContentMessage) GetContentRef() string {
if x != nil {
return x.ContentRef
}
return ""
}
type ExtendedContentMessage_CTA struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ButtonType ExtendedContentMessage_CtaButtonType `protobuf:"varint,1,opt,name=buttonType,proto3,enum=WAArmadilloXMA.ExtendedContentMessage_CtaButtonType" json:"buttonType,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
ActionURL string `protobuf:"bytes,3,opt,name=actionURL,proto3" json:"actionURL,omitempty"`
NativeURL string `protobuf:"bytes,4,opt,name=nativeURL,proto3" json:"nativeURL,omitempty"`
CtaType string `protobuf:"bytes,5,opt,name=ctaType,proto3" json:"ctaType,omitempty"`
}
func (x *ExtendedContentMessage_CTA) Reset() {
*x = ExtendedContentMessage_CTA{}
if protoimpl.UnsafeEnabled {
mi := &file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExtendedContentMessage_CTA) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtendedContentMessage_CTA) ProtoMessage() {}
func (x *ExtendedContentMessage_CTA) ProtoReflect() protoreflect.Message {
mi := &file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtendedContentMessage_CTA.ProtoReflect.Descriptor instead.
func (*ExtendedContentMessage_CTA) Descriptor() ([]byte, []int) {
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP(), []int{0, 0}
}
func (x *ExtendedContentMessage_CTA) GetButtonType() ExtendedContentMessage_CtaButtonType {
if x != nil {
return x.ButtonType
}
return ExtendedContentMessage_CTABUTTONTYPE_UNKNOWN
}
func (x *ExtendedContentMessage_CTA) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *ExtendedContentMessage_CTA) GetActionURL() string {
if x != nil {
return x.ActionURL
}
return ""
}
func (x *ExtendedContentMessage_CTA) GetNativeURL() string {
if x != nil {
return x.NativeURL
}
return ""
}
func (x *ExtendedContentMessage_CTA) GetCtaType() string {
if x != nil {
return x.CtaType
}
return ""
}
var File_waArmadilloXMA_WAArmadilloXMA_proto protoreflect.FileDescriptor
//go:embed WAArmadilloXMA.pb.raw
var file_waArmadilloXMA_WAArmadilloXMA_proto_rawDesc []byte
var (
file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescOnce sync.Once
file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescData = file_waArmadilloXMA_WAArmadilloXMA_proto_rawDesc
)
func file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescGZIP() []byte {
file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescOnce.Do(func() {
file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescData = protoimpl.X.CompressGZIP(file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescData)
})
return file_waArmadilloXMA_WAArmadilloXMA_proto_rawDescData
}
var file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
var file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_waArmadilloXMA_WAArmadilloXMA_proto_goTypes = []interface{}{
(ExtendedContentMessage_OverlayIconGlyph)(0), // 0: WAArmadilloXMA.ExtendedContentMessage.OverlayIconGlyph
(ExtendedContentMessage_CtaButtonType)(0), // 1: WAArmadilloXMA.ExtendedContentMessage.CtaButtonType
(ExtendedContentMessage_XmaLayoutType)(0), // 2: WAArmadilloXMA.ExtendedContentMessage.XmaLayoutType
(ExtendedContentMessage_ExtendedContentType)(0), // 3: WAArmadilloXMA.ExtendedContentMessage.ExtendedContentType
(*ExtendedContentMessage)(nil), // 4: WAArmadilloXMA.ExtendedContentMessage
(*ExtendedContentMessage_CTA)(nil), // 5: WAArmadilloXMA.ExtendedContentMessage.CTA
(*waCommon.SubProtocol)(nil), // 6: WACommon.SubProtocol
}
var file_waArmadilloXMA_WAArmadilloXMA_proto_depIdxs = []int32{
6, // 0: WAArmadilloXMA.ExtendedContentMessage.associatedMessage:type_name -> WACommon.SubProtocol
3, // 1: WAArmadilloXMA.ExtendedContentMessage.targetType:type_name -> WAArmadilloXMA.ExtendedContentMessage.ExtendedContentType
2, // 2: WAArmadilloXMA.ExtendedContentMessage.xmaLayoutType:type_name -> WAArmadilloXMA.ExtendedContentMessage.XmaLayoutType
5, // 3: WAArmadilloXMA.ExtendedContentMessage.ctas:type_name -> WAArmadilloXMA.ExtendedContentMessage.CTA
6, // 4: WAArmadilloXMA.ExtendedContentMessage.previews:type_name -> WACommon.SubProtocol
6, // 5: WAArmadilloXMA.ExtendedContentMessage.favicon:type_name -> WACommon.SubProtocol
6, // 6: WAArmadilloXMA.ExtendedContentMessage.headerImage:type_name -> WACommon.SubProtocol
0, // 7: WAArmadilloXMA.ExtendedContentMessage.overlayIconGlyph:type_name -> WAArmadilloXMA.ExtendedContentMessage.OverlayIconGlyph
1, // 8: WAArmadilloXMA.ExtendedContentMessage.CTA.buttonType:type_name -> WAArmadilloXMA.ExtendedContentMessage.CtaButtonType
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_waArmadilloXMA_WAArmadilloXMA_proto_init() }
func file_waArmadilloXMA_WAArmadilloXMA_proto_init() {
if File_waArmadilloXMA_WAArmadilloXMA_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExtendedContentMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExtendedContentMessage_CTA); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waArmadilloXMA_WAArmadilloXMA_proto_rawDesc,
NumEnums: 4,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waArmadilloXMA_WAArmadilloXMA_proto_goTypes,
DependencyIndexes: file_waArmadilloXMA_WAArmadilloXMA_proto_depIdxs,
EnumInfos: file_waArmadilloXMA_WAArmadilloXMA_proto_enumTypes,
MessageInfos: file_waArmadilloXMA_WAArmadilloXMA_proto_msgTypes,
}.Build()
File_waArmadilloXMA_WAArmadilloXMA_proto = out.File
file_waArmadilloXMA_WAArmadilloXMA_proto_rawDesc = nil
file_waArmadilloXMA_WAArmadilloXMA_proto_goTypes = nil
file_waArmadilloXMA_WAArmadilloXMA_proto_depIdxs = nil
}

@ -0,0 +1,118 @@
syntax = "proto3";
package WAArmadilloXMA;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waArmadilloXMA";
import "waCommon/WACommon.proto";
message ExtendedContentMessage {
enum OverlayIconGlyph {
INFO = 0;
EYE_OFF = 1;
NEWS_OFF = 2;
WARNING = 3;
PRIVATE = 4;
NONE = 5;
MEDIA_LABEL = 6;
POST_COVER = 7;
POST_LABEL = 8;
WARNING_SCREENS = 9;
}
enum CtaButtonType {
CTABUTTONTYPE_UNKNOWN = 0;
OPEN_NATIVE = 11;
}
enum XmaLayoutType {
SINGLE = 0;
PORTRAIT = 3;
STANDARD_DXMA = 12;
LIST_DXMA = 15;
}
enum ExtendedContentType {
EXTENDEDCONTENTTYPE_UNKNOWN = 0;
IG_STORY_PHOTO_MENTION = 4;
IG_SINGLE_IMAGE_POST_SHARE = 9;
IG_MULTIPOST_SHARE = 10;
IG_SINGLE_VIDEO_POST_SHARE = 11;
IG_STORY_PHOTO_SHARE = 12;
IG_STORY_VIDEO_SHARE = 13;
IG_CLIPS_SHARE = 14;
IG_IGTV_SHARE = 15;
IG_SHOP_SHARE = 16;
IG_PROFILE_SHARE = 19;
IG_STORY_PHOTO_HIGHLIGHT_SHARE = 20;
IG_STORY_VIDEO_HIGHLIGHT_SHARE = 21;
IG_STORY_REPLY = 22;
IG_STORY_REACTION = 23;
IG_STORY_VIDEO_MENTION = 24;
IG_STORY_HIGHLIGHT_REPLY = 25;
IG_STORY_HIGHLIGHT_REACTION = 26;
IG_EXTERNAL_LINK = 27;
IG_RECEIVER_FETCH = 28;
FB_FEED_SHARE = 1000;
FB_STORY_REPLY = 1001;
FB_STORY_SHARE = 1002;
FB_STORY_MENTION = 1003;
FB_FEED_VIDEO_SHARE = 1004;
FB_GAMING_CUSTOM_UPDATE = 1005;
FB_PRODUCER_STORY_REPLY = 1006;
FB_EVENT = 1007;
FB_FEED_POST_PRIVATE_REPLY = 1008;
FB_SHORT = 1009;
FB_COMMENT_MENTION_SHARE = 1010;
MSG_EXTERNAL_LINK_SHARE = 2000;
MSG_P2P_PAYMENT = 2001;
MSG_LOCATION_SHARING = 2002;
MSG_LOCATION_SHARING_V2 = 2003;
MSG_HIGHLIGHTS_TAB_FRIEND_UPDATES_REPLY = 2004;
MSG_HIGHLIGHTS_TAB_LOCAL_EVENT_REPLY = 2005;
MSG_RECEIVER_FETCH = 2006;
MSG_IG_MEDIA_SHARE = 2007;
MSG_GEN_AI_SEARCH_PLUGIN_RESPONSE = 2008;
MSG_REELS_LIST = 2009;
MSG_CONTACT = 2010;
RTC_AUDIO_CALL = 3000;
RTC_VIDEO_CALL = 3001;
RTC_MISSED_AUDIO_CALL = 3002;
RTC_MISSED_VIDEO_CALL = 3003;
RTC_GROUP_AUDIO_CALL = 3004;
RTC_GROUP_VIDEO_CALL = 3005;
RTC_MISSED_GROUP_AUDIO_CALL = 3006;
RTC_MISSED_GROUP_VIDEO_CALL = 3007;
DATACLASS_SENDER_COPY = 4000;
}
message CTA {
CtaButtonType buttonType = 1;
string title = 2;
string actionURL = 3;
string nativeURL = 4;
string ctaType = 5;
}
WACommon.SubProtocol associatedMessage = 1;
ExtendedContentType targetType = 2;
string targetUsername = 3;
string targetID = 4;
int64 targetExpiringAtSec = 5;
XmaLayoutType xmaLayoutType = 6;
repeated CTA ctas = 7;
repeated WACommon.SubProtocol previews = 8;
string titleText = 9;
string subtitleText = 10;
uint32 maxTitleNumOfLines = 11;
uint32 maxSubtitleNumOfLines = 12;
WACommon.SubProtocol favicon = 13;
WACommon.SubProtocol headerImage = 14;
string headerTitle = 15;
OverlayIconGlyph overlayIconGlyph = 16;
string overlayTitle = 17;
string overlayDescription = 18;
string sentWithMessageID = 19;
string messageText = 20;
string headerSubtitle = 21;
string xmaDataclass = 22;
string contentRef = 23;
}

@ -0,0 +1,469 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waCert/WACert.proto
package waCert
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type NoiseCertificate struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}
func (x *NoiseCertificate) Reset() {
*x = NoiseCertificate{}
if protoimpl.UnsafeEnabled {
mi := &file_waCert_WACert_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NoiseCertificate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NoiseCertificate) ProtoMessage() {}
func (x *NoiseCertificate) ProtoReflect() protoreflect.Message {
mi := &file_waCert_WACert_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NoiseCertificate.ProtoReflect.Descriptor instead.
func (*NoiseCertificate) Descriptor() ([]byte, []int) {
return file_waCert_WACert_proto_rawDescGZIP(), []int{0}
}
func (x *NoiseCertificate) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *NoiseCertificate) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
type CertChain struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Leaf *CertChain_NoiseCertificate `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty"`
Intermediate *CertChain_NoiseCertificate `protobuf:"bytes,2,opt,name=intermediate,proto3" json:"intermediate,omitempty"`
}
func (x *CertChain) Reset() {
*x = CertChain{}
if protoimpl.UnsafeEnabled {
mi := &file_waCert_WACert_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertChain) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertChain) ProtoMessage() {}
func (x *CertChain) ProtoReflect() protoreflect.Message {
mi := &file_waCert_WACert_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertChain.ProtoReflect.Descriptor instead.
func (*CertChain) Descriptor() ([]byte, []int) {
return file_waCert_WACert_proto_rawDescGZIP(), []int{1}
}
func (x *CertChain) GetLeaf() *CertChain_NoiseCertificate {
if x != nil {
return x.Leaf
}
return nil
}
func (x *CertChain) GetIntermediate() *CertChain_NoiseCertificate {
if x != nil {
return x.Intermediate
}
return nil
}
type NoiseCertificate_Details struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Serial uint32 `protobuf:"varint,1,opt,name=serial,proto3" json:"serial,omitempty"`
Issuer string `protobuf:"bytes,2,opt,name=issuer,proto3" json:"issuer,omitempty"`
Expires uint64 `protobuf:"varint,3,opt,name=expires,proto3" json:"expires,omitempty"`
Subject string `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
Key []byte `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"`
}
func (x *NoiseCertificate_Details) Reset() {
*x = NoiseCertificate_Details{}
if protoimpl.UnsafeEnabled {
mi := &file_waCert_WACert_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NoiseCertificate_Details) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NoiseCertificate_Details) ProtoMessage() {}
func (x *NoiseCertificate_Details) ProtoReflect() protoreflect.Message {
mi := &file_waCert_WACert_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NoiseCertificate_Details.ProtoReflect.Descriptor instead.
func (*NoiseCertificate_Details) Descriptor() ([]byte, []int) {
return file_waCert_WACert_proto_rawDescGZIP(), []int{0, 0}
}
func (x *NoiseCertificate_Details) GetSerial() uint32 {
if x != nil {
return x.Serial
}
return 0
}
func (x *NoiseCertificate_Details) GetIssuer() string {
if x != nil {
return x.Issuer
}
return ""
}
func (x *NoiseCertificate_Details) GetExpires() uint64 {
if x != nil {
return x.Expires
}
return 0
}
func (x *NoiseCertificate_Details) GetSubject() string {
if x != nil {
return x.Subject
}
return ""
}
func (x *NoiseCertificate_Details) GetKey() []byte {
if x != nil {
return x.Key
}
return nil
}
type CertChain_NoiseCertificate struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Details []byte `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}
func (x *CertChain_NoiseCertificate) Reset() {
*x = CertChain_NoiseCertificate{}
if protoimpl.UnsafeEnabled {
mi := &file_waCert_WACert_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertChain_NoiseCertificate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertChain_NoiseCertificate) ProtoMessage() {}
func (x *CertChain_NoiseCertificate) ProtoReflect() protoreflect.Message {
mi := &file_waCert_WACert_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertChain_NoiseCertificate.ProtoReflect.Descriptor instead.
func (*CertChain_NoiseCertificate) Descriptor() ([]byte, []int) {
return file_waCert_WACert_proto_rawDescGZIP(), []int{1, 0}
}
func (x *CertChain_NoiseCertificate) GetDetails() []byte {
if x != nil {
return x.Details
}
return nil
}
func (x *CertChain_NoiseCertificate) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
type CertChain_NoiseCertificate_Details struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Serial uint32 `protobuf:"varint,1,opt,name=serial,proto3" json:"serial,omitempty"`
IssuerSerial uint32 `protobuf:"varint,2,opt,name=issuerSerial,proto3" json:"issuerSerial,omitempty"`
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
NotBefore uint64 `protobuf:"varint,4,opt,name=notBefore,proto3" json:"notBefore,omitempty"`
NotAfter uint64 `protobuf:"varint,5,opt,name=notAfter,proto3" json:"notAfter,omitempty"`
}
func (x *CertChain_NoiseCertificate_Details) Reset() {
*x = CertChain_NoiseCertificate_Details{}
if protoimpl.UnsafeEnabled {
mi := &file_waCert_WACert_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertChain_NoiseCertificate_Details) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertChain_NoiseCertificate_Details) ProtoMessage() {}
func (x *CertChain_NoiseCertificate_Details) ProtoReflect() protoreflect.Message {
mi := &file_waCert_WACert_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertChain_NoiseCertificate_Details.ProtoReflect.Descriptor instead.
func (*CertChain_NoiseCertificate_Details) Descriptor() ([]byte, []int) {
return file_waCert_WACert_proto_rawDescGZIP(), []int{1, 0, 0}
}
func (x *CertChain_NoiseCertificate_Details) GetSerial() uint32 {
if x != nil {
return x.Serial
}
return 0
}
func (x *CertChain_NoiseCertificate_Details) GetIssuerSerial() uint32 {
if x != nil {
return x.IssuerSerial
}
return 0
}
func (x *CertChain_NoiseCertificate_Details) GetKey() []byte {
if x != nil {
return x.Key
}
return nil
}
func (x *CertChain_NoiseCertificate_Details) GetNotBefore() uint64 {
if x != nil {
return x.NotBefore
}
return 0
}
func (x *CertChain_NoiseCertificate_Details) GetNotAfter() uint64 {
if x != nil {
return x.NotAfter
}
return 0
}
var File_waCert_WACert_proto protoreflect.FileDescriptor
//go:embed WACert.pb.raw
var file_waCert_WACert_proto_rawDesc []byte
var (
file_waCert_WACert_proto_rawDescOnce sync.Once
file_waCert_WACert_proto_rawDescData = file_waCert_WACert_proto_rawDesc
)
func file_waCert_WACert_proto_rawDescGZIP() []byte {
file_waCert_WACert_proto_rawDescOnce.Do(func() {
file_waCert_WACert_proto_rawDescData = protoimpl.X.CompressGZIP(file_waCert_WACert_proto_rawDescData)
})
return file_waCert_WACert_proto_rawDescData
}
var file_waCert_WACert_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_waCert_WACert_proto_goTypes = []interface{}{
(*NoiseCertificate)(nil), // 0: WACert.NoiseCertificate
(*CertChain)(nil), // 1: WACert.CertChain
(*NoiseCertificate_Details)(nil), // 2: WACert.NoiseCertificate.Details
(*CertChain_NoiseCertificate)(nil), // 3: WACert.CertChain.NoiseCertificate
(*CertChain_NoiseCertificate_Details)(nil), // 4: WACert.CertChain.NoiseCertificate.Details
}
var file_waCert_WACert_proto_depIdxs = []int32{
3, // 0: WACert.CertChain.leaf:type_name -> WACert.CertChain.NoiseCertificate
3, // 1: WACert.CertChain.intermediate:type_name -> WACert.CertChain.NoiseCertificate
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_waCert_WACert_proto_init() }
func file_waCert_WACert_proto_init() {
if File_waCert_WACert_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waCert_WACert_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NoiseCertificate); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCert_WACert_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertChain); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCert_WACert_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NoiseCertificate_Details); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCert_WACert_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertChain_NoiseCertificate); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCert_WACert_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertChain_NoiseCertificate_Details); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waCert_WACert_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waCert_WACert_proto_goTypes,
DependencyIndexes: file_waCert_WACert_proto_depIdxs,
MessageInfos: file_waCert_WACert_proto_msgTypes,
}.Build()
File_waCert_WACert_proto = out.File
file_waCert_WACert_proto_rawDesc = nil
file_waCert_WACert_proto_goTypes = nil
file_waCert_WACert_proto_depIdxs = nil
}

@ -0,0 +1,23 @@
waCert/WACert.protoWACert"Ë
NoiseCertificate
details ( Rdetails
signature ( R signature
Details
serial ( Rserial
issuer ( Rissuer
expires (Rexpires
subject ( Rsubject
key ( Rkey"ì
CertChain6
leaf ( 2".WACert.CertChain.NoiseCertificateRleafF
intermediate ( 2".WACert.CertChain.NoiseCertificateR intermediateÞ
NoiseCertificate
details ( Rdetails
signature ( R signature
Details
serial ( Rserial"
issuerSerial ( R issuerSerial
key ( Rkey
notBefore (R notBefore
notAfter (RnotAfterB-Z+go.mau.fi/whatsmeow/binary/armadillo/waCertbproto3

@ -0,0 +1,34 @@
syntax = "proto3";
package WACert;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waCert";
message NoiseCertificate {
message Details {
uint32 serial = 1;
string issuer = 2;
uint64 expires = 3;
string subject = 4;
bytes key = 5;
}
bytes details = 1;
bytes signature = 2;
}
message CertChain {
message NoiseCertificate {
message Details {
uint32 serial = 1;
uint32 issuerSerial = 2;
bytes key = 3;
uint64 notBefore = 4;
uint64 notAfter = 5;
}
bytes details = 1;
bytes signature = 2;
}
NoiseCertificate leaf = 1;
NoiseCertificate intermediate = 2;
}

@ -0,0 +1,498 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waCommon/WACommon.proto
package waCommon
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type FutureProofBehavior int32
const (
FutureProofBehavior_PLACEHOLDER FutureProofBehavior = 0
FutureProofBehavior_NO_PLACEHOLDER FutureProofBehavior = 1
FutureProofBehavior_IGNORE FutureProofBehavior = 2
)
// Enum value maps for FutureProofBehavior.
var (
FutureProofBehavior_name = map[int32]string{
0: "PLACEHOLDER",
1: "NO_PLACEHOLDER",
2: "IGNORE",
}
FutureProofBehavior_value = map[string]int32{
"PLACEHOLDER": 0,
"NO_PLACEHOLDER": 1,
"IGNORE": 2,
}
)
func (x FutureProofBehavior) Enum() *FutureProofBehavior {
p := new(FutureProofBehavior)
*p = x
return p
}
func (x FutureProofBehavior) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (FutureProofBehavior) Descriptor() protoreflect.EnumDescriptor {
return file_waCommon_WACommon_proto_enumTypes[0].Descriptor()
}
func (FutureProofBehavior) Type() protoreflect.EnumType {
return &file_waCommon_WACommon_proto_enumTypes[0]
}
func (x FutureProofBehavior) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use FutureProofBehavior.Descriptor instead.
func (FutureProofBehavior) EnumDescriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{0}
}
type Command_CommandType int32
const (
Command_COMMANDTYPE_UNKNOWN Command_CommandType = 0
Command_EVERYONE Command_CommandType = 1
Command_SILENT Command_CommandType = 2
Command_AI Command_CommandType = 3
)
// Enum value maps for Command_CommandType.
var (
Command_CommandType_name = map[int32]string{
0: "COMMANDTYPE_UNKNOWN",
1: "EVERYONE",
2: "SILENT",
3: "AI",
}
Command_CommandType_value = map[string]int32{
"COMMANDTYPE_UNKNOWN": 0,
"EVERYONE": 1,
"SILENT": 2,
"AI": 3,
}
)
func (x Command_CommandType) Enum() *Command_CommandType {
p := new(Command_CommandType)
*p = x
return p
}
func (x Command_CommandType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Command_CommandType) Descriptor() protoreflect.EnumDescriptor {
return file_waCommon_WACommon_proto_enumTypes[1].Descriptor()
}
func (Command_CommandType) Type() protoreflect.EnumType {
return &file_waCommon_WACommon_proto_enumTypes[1]
}
func (x Command_CommandType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Command_CommandType.Descriptor instead.
func (Command_CommandType) EnumDescriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{1, 0}
}
type MessageKey struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RemoteJID string `protobuf:"bytes,1,opt,name=remoteJID,proto3" json:"remoteJID,omitempty"`
FromMe bool `protobuf:"varint,2,opt,name=fromMe,proto3" json:"fromMe,omitempty"`
ID string `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"`
Participant string `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"`
}
func (x *MessageKey) Reset() {
*x = MessageKey{}
if protoimpl.UnsafeEnabled {
mi := &file_waCommon_WACommon_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageKey) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageKey) ProtoMessage() {}
func (x *MessageKey) ProtoReflect() protoreflect.Message {
mi := &file_waCommon_WACommon_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageKey.ProtoReflect.Descriptor instead.
func (*MessageKey) Descriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{0}
}
func (x *MessageKey) GetRemoteJID() string {
if x != nil {
return x.RemoteJID
}
return ""
}
func (x *MessageKey) GetFromMe() bool {
if x != nil {
return x.FromMe
}
return false
}
func (x *MessageKey) GetID() string {
if x != nil {
return x.ID
}
return ""
}
func (x *MessageKey) GetParticipant() string {
if x != nil {
return x.Participant
}
return ""
}
type Command struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CommandType Command_CommandType `protobuf:"varint,1,opt,name=commandType,proto3,enum=WACommon.Command_CommandType" json:"commandType,omitempty"`
Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
Length uint32 `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"`
ValidationToken string `protobuf:"bytes,4,opt,name=validationToken,proto3" json:"validationToken,omitempty"`
}
func (x *Command) Reset() {
*x = Command{}
if protoimpl.UnsafeEnabled {
mi := &file_waCommon_WACommon_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Command) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Command) ProtoMessage() {}
func (x *Command) ProtoReflect() protoreflect.Message {
mi := &file_waCommon_WACommon_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Command.ProtoReflect.Descriptor instead.
func (*Command) Descriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{1}
}
func (x *Command) GetCommandType() Command_CommandType {
if x != nil {
return x.CommandType
}
return Command_COMMANDTYPE_UNKNOWN
}
func (x *Command) GetOffset() uint32 {
if x != nil {
return x.Offset
}
return 0
}
func (x *Command) GetLength() uint32 {
if x != nil {
return x.Length
}
return 0
}
func (x *Command) GetValidationToken() string {
if x != nil {
return x.ValidationToken
}
return ""
}
type MessageText struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
MentionedJID []string `protobuf:"bytes,2,rep,name=mentionedJID,proto3" json:"mentionedJID,omitempty"`
Commands []*Command `protobuf:"bytes,3,rep,name=commands,proto3" json:"commands,omitempty"`
}
func (x *MessageText) Reset() {
*x = MessageText{}
if protoimpl.UnsafeEnabled {
mi := &file_waCommon_WACommon_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageText) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageText) ProtoMessage() {}
func (x *MessageText) ProtoReflect() protoreflect.Message {
mi := &file_waCommon_WACommon_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageText.ProtoReflect.Descriptor instead.
func (*MessageText) Descriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{2}
}
func (x *MessageText) GetText() string {
if x != nil {
return x.Text
}
return ""
}
func (x *MessageText) GetMentionedJID() []string {
if x != nil {
return x.MentionedJID
}
return nil
}
func (x *MessageText) GetCommands() []*Command {
if x != nil {
return x.Commands
}
return nil
}
type SubProtocol struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}
func (x *SubProtocol) Reset() {
*x = SubProtocol{}
if protoimpl.UnsafeEnabled {
mi := &file_waCommon_WACommon_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SubProtocol) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubProtocol) ProtoMessage() {}
func (x *SubProtocol) ProtoReflect() protoreflect.Message {
mi := &file_waCommon_WACommon_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubProtocol.ProtoReflect.Descriptor instead.
func (*SubProtocol) Descriptor() ([]byte, []int) {
return file_waCommon_WACommon_proto_rawDescGZIP(), []int{3}
}
func (x *SubProtocol) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
func (x *SubProtocol) GetVersion() int32 {
if x != nil {
return x.Version
}
return 0
}
var File_waCommon_WACommon_proto protoreflect.FileDescriptor
//go:embed WACommon.pb.raw
var file_waCommon_WACommon_proto_rawDesc []byte
var (
file_waCommon_WACommon_proto_rawDescOnce sync.Once
file_waCommon_WACommon_proto_rawDescData = file_waCommon_WACommon_proto_rawDesc
)
func file_waCommon_WACommon_proto_rawDescGZIP() []byte {
file_waCommon_WACommon_proto_rawDescOnce.Do(func() {
file_waCommon_WACommon_proto_rawDescData = protoimpl.X.CompressGZIP(file_waCommon_WACommon_proto_rawDescData)
})
return file_waCommon_WACommon_proto_rawDescData
}
var file_waCommon_WACommon_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_waCommon_WACommon_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_waCommon_WACommon_proto_goTypes = []interface{}{
(FutureProofBehavior)(0), // 0: WACommon.FutureProofBehavior
(Command_CommandType)(0), // 1: WACommon.Command.CommandType
(*MessageKey)(nil), // 2: WACommon.MessageKey
(*Command)(nil), // 3: WACommon.Command
(*MessageText)(nil), // 4: WACommon.MessageText
(*SubProtocol)(nil), // 5: WACommon.SubProtocol
}
var file_waCommon_WACommon_proto_depIdxs = []int32{
1, // 0: WACommon.Command.commandType:type_name -> WACommon.Command.CommandType
3, // 1: WACommon.MessageText.commands:type_name -> WACommon.Command
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_waCommon_WACommon_proto_init() }
func file_waCommon_WACommon_proto_init() {
if File_waCommon_WACommon_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waCommon_WACommon_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageKey); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCommon_WACommon_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Command); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCommon_WACommon_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageText); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waCommon_WACommon_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubProtocol); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waCommon_WACommon_proto_rawDesc,
NumEnums: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waCommon_WACommon_proto_goTypes,
DependencyIndexes: file_waCommon_WACommon_proto_depIdxs,
EnumInfos: file_waCommon_WACommon_proto_enumTypes,
MessageInfos: file_waCommon_WACommon_proto_msgTypes,
}.Build()
File_waCommon_WACommon_proto = out.File
file_waCommon_WACommon_proto_rawDesc = nil
file_waCommon_WACommon_proto_goTypes = nil
file_waCommon_WACommon_proto_depIdxs = nil
}

@ -0,0 +1,41 @@
syntax = "proto3";
package WACommon;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waCommon";
enum FutureProofBehavior {
PLACEHOLDER = 0;
NO_PLACEHOLDER = 1;
IGNORE = 2;
}
message MessageKey {
string remoteJID = 1;
bool fromMe = 2;
string ID = 3;
string participant = 4;
}
message Command {
enum CommandType {
COMMANDTYPE_UNKNOWN = 0;
EVERYONE = 1;
SILENT = 2;
AI = 3;
}
CommandType commandType = 1;
uint32 offset = 2;
uint32 length = 3;
string validationToken = 4;
}
message MessageText {
string text = 1;
repeated string mentionedJID = 2;
repeated Command commands = 3;
}
message SubProtocol {
bytes payload = 1;
int32 version = 2;
}

@ -0,0 +1,234 @@
syntax = "proto3";
package WAConsumerApplication;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waConsumerApplication";
import "waCommon/WACommon.proto";
message ConsumerApplication {
message Payload {
oneof payload {
Content content = 1;
ApplicationData applicationData = 2;
Signal signal = 3;
SubProtocolPayload subProtocol = 4;
}
}
message SubProtocolPayload {
WACommon.FutureProofBehavior futureProof = 1;
}
message Metadata {
enum SpecialTextSize {
SPECIALTEXTSIZE_UNKNOWN = 0;
SMALL = 1;
MEDIUM = 2;
LARGE = 3;
}
SpecialTextSize specialTextSize = 1;
}
message Signal {
}
message ApplicationData {
oneof applicationContent {
RevokeMessage revoke = 1;
}
}
message Content {
oneof content {
WACommon.MessageText messageText = 1;
ImageMessage imageMessage = 2;
ContactMessage contactMessage = 3;
LocationMessage locationMessage = 4;
ExtendedTextMessage extendedTextMessage = 5;
StatusTextMesage statusTextMessage = 6;
DocumentMessage documentMessage = 7;
AudioMessage audioMessage = 8;
VideoMessage videoMessage = 9;
ContactsArrayMessage contactsArrayMessage = 10;
LiveLocationMessage liveLocationMessage = 11;
StickerMessage stickerMessage = 12;
GroupInviteMessage groupInviteMessage = 13;
ViewOnceMessage viewOnceMessage = 14;
ReactionMessage reactionMessage = 16;
PollCreationMessage pollCreationMessage = 17;
PollUpdateMessage pollUpdateMessage = 18;
EditMessage editMessage = 19;
}
}
message EditMessage {
WACommon.MessageKey key = 1;
WACommon.MessageText message = 2;
int64 timestampMS = 3;
}
message PollAddOptionMessage {
repeated Option pollOption = 1;
}
message PollVoteMessage {
repeated bytes selectedOptions = 1;
int64 senderTimestampMS = 2;
}
message PollEncValue {
bytes encPayload = 1;
bytes encIV = 2;
}
message PollUpdateMessage {
WACommon.MessageKey pollCreationMessageKey = 1;
PollEncValue vote = 2;
PollEncValue addOption = 3;
}
message PollCreationMessage {
bytes encKey = 1;
string name = 2;
repeated Option options = 3;
uint32 selectableOptionsCount = 4;
}
message Option {
string optionName = 1;
}
message ReactionMessage {
WACommon.MessageKey key = 1;
string text = 2;
string groupingKey = 3;
int64 senderTimestampMS = 4;
string reactionMetadataDataclassData = 5;
int32 style = 6;
}
message RevokeMessage {
WACommon.MessageKey key = 1;
}
message ViewOnceMessage {
oneof viewOnceContent {
ImageMessage imageMessage = 1;
VideoMessage videoMessage = 2;
}
}
message GroupInviteMessage {
string groupJID = 1;
string inviteCode = 2;
int64 inviteExpiration = 3;
string groupName = 4;
bytes JPEGThumbnail = 5;
WACommon.MessageText caption = 6;
}
message LiveLocationMessage {
Location location = 1;
uint32 accuracyInMeters = 2;
float speedInMps = 3;
uint32 degreesClockwiseFromMagneticNorth = 4;
WACommon.MessageText caption = 5;
int64 sequenceNumber = 6;
uint32 timeOffset = 7;
}
message ContactsArrayMessage {
string displayName = 1;
repeated ContactMessage contacts = 2;
}
message ContactMessage {
WACommon.SubProtocol contact = 1;
}
message StatusTextMesage {
enum FontType {
SANS_SERIF = 0;
SERIF = 1;
NORICAN_REGULAR = 2;
BRYNDAN_WRITE = 3;
BEBASNEUE_REGULAR = 4;
OSWALD_HEAVY = 5;
}
ExtendedTextMessage text = 1;
fixed32 textArgb = 6;
fixed32 backgroundArgb = 7;
FontType font = 8;
}
message ExtendedTextMessage {
enum PreviewType {
NONE = 0;
VIDEO = 1;
}
WACommon.MessageText text = 1;
string matchedText = 2;
string canonicalURL = 3;
string description = 4;
string title = 5;
WACommon.SubProtocol thumbnail = 6;
PreviewType previewType = 7;
}
message LocationMessage {
Location location = 1;
string address = 2;
}
message StickerMessage {
WACommon.SubProtocol sticker = 1;
}
message DocumentMessage {
WACommon.SubProtocol document = 1;
string fileName = 2;
}
message VideoMessage {
WACommon.SubProtocol video = 1;
WACommon.MessageText caption = 2;
}
message AudioMessage {
WACommon.SubProtocol audio = 1;
bool PTT = 2;
}
message ImageMessage {
WACommon.SubProtocol image = 1;
WACommon.MessageText caption = 2;
}
message InteractiveAnnotation {
oneof action {
Location location = 2;
}
repeated Point polygonVertices = 1;
}
message Point {
double x = 1;
double y = 2;
}
message Location {
double degreesLatitude = 1;
double degreesLongitude = 2;
string name = 3;
}
message MediaPayload {
WACommon.SubProtocol protocol = 1;
}
Payload payload = 1;
Metadata metadata = 2;
}

@ -0,0 +1,82 @@
package waConsumerApplication
import (
"go.mau.fi/whatsmeow/binary/armadillo/armadilloutil"
"go.mau.fi/whatsmeow/binary/armadillo/waMediaTransport"
)
type ConsumerApplication_Content_Content = isConsumerApplication_Content_Content
func (*ConsumerApplication) IsMessageApplicationSub() {}
const (
ImageTransportVersion = 1
StickerTransportVersion = 1
VideoTransportVersion = 1
AudioTransportVersion = 1
DocumentTransportVersion = 1
ContactTransportVersion = 1
)
func (msg *ConsumerApplication_ImageMessage) Decode() (dec *waMediaTransport.ImageTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.ImageTransport{}, msg.GetImage(), ImageTransportVersion)
}
func (msg *ConsumerApplication_ImageMessage) Set(payload *waMediaTransport.ImageTransport) (err error) {
msg.Image, err = armadilloutil.Marshal(payload, ImageTransportVersion)
return
}
func (msg *ConsumerApplication_StickerMessage) Decode() (dec *waMediaTransport.StickerTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.StickerTransport{}, msg.GetSticker(), StickerTransportVersion)
}
func (msg *ConsumerApplication_StickerMessage) Set(payload *waMediaTransport.StickerTransport) (err error) {
msg.Sticker, err = armadilloutil.Marshal(payload, StickerTransportVersion)
return
}
func (msg *ConsumerApplication_ExtendedTextMessage) DecodeThumbnail() (dec *waMediaTransport.ImageTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.ImageTransport{}, msg.GetThumbnail(), ImageTransportVersion)
}
func (msg *ConsumerApplication_ExtendedTextMessage) SetThumbnail(payload *waMediaTransport.ImageTransport) (err error) {
msg.Thumbnail, err = armadilloutil.Marshal(payload, ImageTransportVersion)
return
}
func (msg *ConsumerApplication_VideoMessage) Decode() (dec *waMediaTransport.VideoTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.VideoTransport{}, msg.GetVideo(), VideoTransportVersion)
}
func (msg *ConsumerApplication_VideoMessage) Set(payload *waMediaTransport.VideoTransport) (err error) {
msg.Video, err = armadilloutil.Marshal(payload, VideoTransportVersion)
return
}
func (msg *ConsumerApplication_AudioMessage) Decode() (dec *waMediaTransport.AudioTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.AudioTransport{}, msg.GetAudio(), AudioTransportVersion)
}
func (msg *ConsumerApplication_AudioMessage) Set(payload *waMediaTransport.AudioTransport) (err error) {
msg.Audio, err = armadilloutil.Marshal(payload, AudioTransportVersion)
return
}
func (msg *ConsumerApplication_DocumentMessage) Decode() (dec *waMediaTransport.DocumentTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.DocumentTransport{}, msg.GetDocument(), DocumentTransportVersion)
}
func (msg *ConsumerApplication_DocumentMessage) Set(payload *waMediaTransport.DocumentTransport) (err error) {
msg.Document, err = armadilloutil.Marshal(payload, DocumentTransportVersion)
return
}
func (msg *ConsumerApplication_ContactMessage) Decode() (dec *waMediaTransport.ContactTransport, err error) {
return armadilloutil.Unmarshal(&waMediaTransport.ContactTransport{}, msg.GetContact(), ContactTransportVersion)
}
func (msg *ConsumerApplication_ContactMessage) Set(payload *waMediaTransport.ContactTransport) (err error) {
msg.Contact, err = armadilloutil.Marshal(payload, ContactTransportVersion)
return
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,421 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waMediaEntryData/WAMediaEntryData.proto
package waMediaEntryData
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MediaEntry struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FileSHA256 []byte `protobuf:"bytes,1,opt,name=fileSHA256,proto3" json:"fileSHA256,omitempty"`
MediaKey []byte `protobuf:"bytes,2,opt,name=mediaKey,proto3" json:"mediaKey,omitempty"`
FileEncSHA256 []byte `protobuf:"bytes,3,opt,name=fileEncSHA256,proto3" json:"fileEncSHA256,omitempty"`
DirectPath string `protobuf:"bytes,4,opt,name=directPath,proto3" json:"directPath,omitempty"`
MediaKeyTimestamp int64 `protobuf:"varint,5,opt,name=mediaKeyTimestamp,proto3" json:"mediaKeyTimestamp,omitempty"`
ServerMediaType string `protobuf:"bytes,6,opt,name=serverMediaType,proto3" json:"serverMediaType,omitempty"`
UploadToken []byte `protobuf:"bytes,7,opt,name=uploadToken,proto3" json:"uploadToken,omitempty"`
ValidatedTimestamp []byte `protobuf:"bytes,8,opt,name=validatedTimestamp,proto3" json:"validatedTimestamp,omitempty"`
Sidecar []byte `protobuf:"bytes,9,opt,name=sidecar,proto3" json:"sidecar,omitempty"`
ObjectID string `protobuf:"bytes,10,opt,name=objectID,proto3" json:"objectID,omitempty"`
FBID string `protobuf:"bytes,11,opt,name=FBID,proto3" json:"FBID,omitempty"`
DownloadableThumbnail *MediaEntry_DownloadableThumbnail `protobuf:"bytes,12,opt,name=downloadableThumbnail,proto3" json:"downloadableThumbnail,omitempty"`
Handle string `protobuf:"bytes,13,opt,name=handle,proto3" json:"handle,omitempty"`
Filename string `protobuf:"bytes,14,opt,name=filename,proto3" json:"filename,omitempty"`
ProgressiveJPEGDetails *MediaEntry_ProgressiveJpegDetails `protobuf:"bytes,15,opt,name=progressiveJPEGDetails,proto3" json:"progressiveJPEGDetails,omitempty"`
}
func (x *MediaEntry) Reset() {
*x = MediaEntry{}
if protoimpl.UnsafeEnabled {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MediaEntry) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MediaEntry) ProtoMessage() {}
func (x *MediaEntry) ProtoReflect() protoreflect.Message {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MediaEntry.ProtoReflect.Descriptor instead.
func (*MediaEntry) Descriptor() ([]byte, []int) {
return file_waMediaEntryData_WAMediaEntryData_proto_rawDescGZIP(), []int{0}
}
func (x *MediaEntry) GetFileSHA256() []byte {
if x != nil {
return x.FileSHA256
}
return nil
}
func (x *MediaEntry) GetMediaKey() []byte {
if x != nil {
return x.MediaKey
}
return nil
}
func (x *MediaEntry) GetFileEncSHA256() []byte {
if x != nil {
return x.FileEncSHA256
}
return nil
}
func (x *MediaEntry) GetDirectPath() string {
if x != nil {
return x.DirectPath
}
return ""
}
func (x *MediaEntry) GetMediaKeyTimestamp() int64 {
if x != nil {
return x.MediaKeyTimestamp
}
return 0
}
func (x *MediaEntry) GetServerMediaType() string {
if x != nil {
return x.ServerMediaType
}
return ""
}
func (x *MediaEntry) GetUploadToken() []byte {
if x != nil {
return x.UploadToken
}
return nil
}
func (x *MediaEntry) GetValidatedTimestamp() []byte {
if x != nil {
return x.ValidatedTimestamp
}
return nil
}
func (x *MediaEntry) GetSidecar() []byte {
if x != nil {
return x.Sidecar
}
return nil
}
func (x *MediaEntry) GetObjectID() string {
if x != nil {
return x.ObjectID
}
return ""
}
func (x *MediaEntry) GetFBID() string {
if x != nil {
return x.FBID
}
return ""
}
func (x *MediaEntry) GetDownloadableThumbnail() *MediaEntry_DownloadableThumbnail {
if x != nil {
return x.DownloadableThumbnail
}
return nil
}
func (x *MediaEntry) GetHandle() string {
if x != nil {
return x.Handle
}
return ""
}
func (x *MediaEntry) GetFilename() string {
if x != nil {
return x.Filename
}
return ""
}
func (x *MediaEntry) GetProgressiveJPEGDetails() *MediaEntry_ProgressiveJpegDetails {
if x != nil {
return x.ProgressiveJPEGDetails
}
return nil
}
type MediaEntry_ProgressiveJpegDetails struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ScanLengths []int64 `protobuf:"varint,1,rep,packed,name=scanLengths,proto3" json:"scanLengths,omitempty"`
Sidecar []byte `protobuf:"bytes,2,opt,name=sidecar,proto3" json:"sidecar,omitempty"`
}
func (x *MediaEntry_ProgressiveJpegDetails) Reset() {
*x = MediaEntry_ProgressiveJpegDetails{}
if protoimpl.UnsafeEnabled {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MediaEntry_ProgressiveJpegDetails) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MediaEntry_ProgressiveJpegDetails) ProtoMessage() {}
func (x *MediaEntry_ProgressiveJpegDetails) ProtoReflect() protoreflect.Message {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MediaEntry_ProgressiveJpegDetails.ProtoReflect.Descriptor instead.
func (*MediaEntry_ProgressiveJpegDetails) Descriptor() ([]byte, []int) {
return file_waMediaEntryData_WAMediaEntryData_proto_rawDescGZIP(), []int{0, 0}
}
func (x *MediaEntry_ProgressiveJpegDetails) GetScanLengths() []int64 {
if x != nil {
return x.ScanLengths
}
return nil
}
func (x *MediaEntry_ProgressiveJpegDetails) GetSidecar() []byte {
if x != nil {
return x.Sidecar
}
return nil
}
type MediaEntry_DownloadableThumbnail struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FileSHA256 []byte `protobuf:"bytes,1,opt,name=fileSHA256,proto3" json:"fileSHA256,omitempty"`
FileEncSHA256 []byte `protobuf:"bytes,2,opt,name=fileEncSHA256,proto3" json:"fileEncSHA256,omitempty"`
DirectPath string `protobuf:"bytes,3,opt,name=directPath,proto3" json:"directPath,omitempty"`
MediaKey []byte `protobuf:"bytes,4,opt,name=mediaKey,proto3" json:"mediaKey,omitempty"`
MediaKeyTimestamp int64 `protobuf:"varint,5,opt,name=mediaKeyTimestamp,proto3" json:"mediaKeyTimestamp,omitempty"`
ObjectID string `protobuf:"bytes,6,opt,name=objectID,proto3" json:"objectID,omitempty"`
}
func (x *MediaEntry_DownloadableThumbnail) Reset() {
*x = MediaEntry_DownloadableThumbnail{}
if protoimpl.UnsafeEnabled {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MediaEntry_DownloadableThumbnail) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MediaEntry_DownloadableThumbnail) ProtoMessage() {}
func (x *MediaEntry_DownloadableThumbnail) ProtoReflect() protoreflect.Message {
mi := &file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MediaEntry_DownloadableThumbnail.ProtoReflect.Descriptor instead.
func (*MediaEntry_DownloadableThumbnail) Descriptor() ([]byte, []int) {
return file_waMediaEntryData_WAMediaEntryData_proto_rawDescGZIP(), []int{0, 1}
}
func (x *MediaEntry_DownloadableThumbnail) GetFileSHA256() []byte {
if x != nil {
return x.FileSHA256
}
return nil
}
func (x *MediaEntry_DownloadableThumbnail) GetFileEncSHA256() []byte {
if x != nil {
return x.FileEncSHA256
}
return nil
}
func (x *MediaEntry_DownloadableThumbnail) GetDirectPath() string {
if x != nil {
return x.DirectPath
}
return ""
}
func (x *MediaEntry_DownloadableThumbnail) GetMediaKey() []byte {
if x != nil {
return x.MediaKey
}
return nil
}
func (x *MediaEntry_DownloadableThumbnail) GetMediaKeyTimestamp() int64 {
if x != nil {
return x.MediaKeyTimestamp
}
return 0
}
func (x *MediaEntry_DownloadableThumbnail) GetObjectID() string {
if x != nil {
return x.ObjectID
}
return ""
}
var File_waMediaEntryData_WAMediaEntryData_proto protoreflect.FileDescriptor
//go:embed WAMediaEntryData.pb.raw
var file_waMediaEntryData_WAMediaEntryData_proto_rawDesc []byte
var (
file_waMediaEntryData_WAMediaEntryData_proto_rawDescOnce sync.Once
file_waMediaEntryData_WAMediaEntryData_proto_rawDescData = file_waMediaEntryData_WAMediaEntryData_proto_rawDesc
)
func file_waMediaEntryData_WAMediaEntryData_proto_rawDescGZIP() []byte {
file_waMediaEntryData_WAMediaEntryData_proto_rawDescOnce.Do(func() {
file_waMediaEntryData_WAMediaEntryData_proto_rawDescData = protoimpl.X.CompressGZIP(file_waMediaEntryData_WAMediaEntryData_proto_rawDescData)
})
return file_waMediaEntryData_WAMediaEntryData_proto_rawDescData
}
var file_waMediaEntryData_WAMediaEntryData_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_waMediaEntryData_WAMediaEntryData_proto_goTypes = []interface{}{
(*MediaEntry)(nil), // 0: WAMediaEntryData.MediaEntry
(*MediaEntry_ProgressiveJpegDetails)(nil), // 1: WAMediaEntryData.MediaEntry.ProgressiveJpegDetails
(*MediaEntry_DownloadableThumbnail)(nil), // 2: WAMediaEntryData.MediaEntry.DownloadableThumbnail
}
var file_waMediaEntryData_WAMediaEntryData_proto_depIdxs = []int32{
2, // 0: WAMediaEntryData.MediaEntry.downloadableThumbnail:type_name -> WAMediaEntryData.MediaEntry.DownloadableThumbnail
1, // 1: WAMediaEntryData.MediaEntry.progressiveJPEGDetails:type_name -> WAMediaEntryData.MediaEntry.ProgressiveJpegDetails
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_waMediaEntryData_WAMediaEntryData_proto_init() }
func file_waMediaEntryData_WAMediaEntryData_proto_init() {
if File_waMediaEntryData_WAMediaEntryData_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MediaEntry); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MediaEntry_ProgressiveJpegDetails); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMediaEntryData_WAMediaEntryData_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MediaEntry_DownloadableThumbnail); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waMediaEntryData_WAMediaEntryData_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waMediaEntryData_WAMediaEntryData_proto_goTypes,
DependencyIndexes: file_waMediaEntryData_WAMediaEntryData_proto_depIdxs,
MessageInfos: file_waMediaEntryData_WAMediaEntryData_proto_msgTypes,
}.Build()
File_waMediaEntryData_WAMediaEntryData_proto = out.File
file_waMediaEntryData_WAMediaEntryData_proto_rawDesc = nil
file_waMediaEntryData_WAMediaEntryData_proto_goTypes = nil
file_waMediaEntryData_WAMediaEntryData_proto_depIdxs = nil
}

@ -0,0 +1,38 @@
'waMediaEntryData/WAMediaEntryData.protoWAMediaEntryData"É
MediaEntry
fileSHA256 ( R
fileSHA256
mediaKey ( RmediaKey$
fileEncSHA256 ( R fileEncSHA256
directPath ( R
directPath,
mediaKeyTimestamp (RmediaKeyTimestamp(
serverMediaType ( RserverMediaType
uploadToken ( R uploadToken.
validatedTimestamp ( RvalidatedTimestamp
sidecar ( Rsidecar
objectID
( RobjectID
FBID ( RFBIDh
downloadableThumbnail ( 22.WAMediaEntryData.MediaEntry.DownloadableThumbnailRdownloadableThumbnail
handle ( Rhandle
filename ( Rfilenamek
progressiveJPEGDetails ( 23.WAMediaEntryData.MediaEntry.ProgressiveJpegDetailsRprogressiveJPEGDetailsT
ProgressiveJpegDetails
scanLengths (R scanLengths
sidecar ( Rsidecarã
DownloadableThumbnail
fileSHA256 ( R
fileSHA256$
fileEncSHA256 ( R fileEncSHA256
directPath ( R
directPath
mediaKey ( RmediaKey,
mediaKeyTimestamp (RmediaKeyTimestamp
objectID ( RobjectIDB7Z5go.mau.fi/whatsmeow/binary/armadillo/waMediaEntryDatabproto3

@ -0,0 +1,35 @@
syntax = "proto3";
package WAMediaEntryData;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMediaEntryData";
message MediaEntry {
message ProgressiveJpegDetails {
repeated int64 scanLengths = 1;
bytes sidecar = 2;
}
message DownloadableThumbnail {
bytes fileSHA256 = 1;
bytes fileEncSHA256 = 2;
string directPath = 3;
bytes mediaKey = 4;
int64 mediaKeyTimestamp = 5;
string objectID = 6;
}
bytes fileSHA256 = 1;
bytes mediaKey = 2;
bytes fileEncSHA256 = 3;
string directPath = 4;
int64 mediaKeyTimestamp = 5;
string serverMediaType = 6;
bytes uploadToken = 7;
bytes validatedTimestamp = 8;
bytes sidecar = 9;
string objectID = 10;
string FBID = 11;
DownloadableThumbnail downloadableThumbnail = 12;
string handle = 13;
string filename = 14;
ProgressiveJpegDetails progressiveJPEGDetails = 15;
}

@ -0,0 +1,154 @@
syntax = "proto3";
package WAMediaTransport;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMediaTransport";
import "waCommon/WACommon.proto";
message WAMediaTransport {
message Ancillary {
message Thumbnail {
message DownloadableThumbnail {
bytes fileSHA256 = 1;
bytes fileEncSHA256 = 2;
string directPath = 3;
bytes mediaKey = 4;
int64 mediaKeyTimestamp = 5;
string objectID = 6;
}
bytes JPEGThumbnail = 1;
DownloadableThumbnail downloadableThumbnail = 2;
uint32 thumbnailWidth = 3;
uint32 thumbnailHeight = 4;
}
uint64 fileLength = 1;
string mimetype = 2;
Thumbnail thumbnail = 3;
string objectID = 4;
}
message Integral {
bytes fileSHA256 = 1;
bytes mediaKey = 2;
bytes fileEncSHA256 = 3;
string directPath = 4;
int64 mediaKeyTimestamp = 5;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message ImageTransport {
message Ancillary {
enum HdType {
NONE = 0;
LQ_4K = 1;
HQ_4K = 2;
}
uint32 height = 1;
uint32 width = 2;
bytes scansSidecar = 3;
repeated uint32 scanLengths = 4;
bytes midQualityFileSHA256 = 5;
HdType hdType = 6;
}
message Integral {
WAMediaTransport transport = 1;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message VideoTransport {
message Ancillary {
enum Attribution {
NONE = 0;
GIPHY = 1;
TENOR = 2;
}
uint32 seconds = 1;
WACommon.MessageText caption = 2;
bool gifPlayback = 3;
uint32 height = 4;
uint32 width = 5;
bytes sidecar = 6;
Attribution gifAttribution = 7;
}
message Integral {
WAMediaTransport transport = 1;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message AudioTransport {
message Ancillary {
uint32 seconds = 1;
}
message Integral {
WAMediaTransport transport = 1;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message DocumentTransport {
message Ancillary {
uint32 pageCount = 1;
}
message Integral {
WAMediaTransport transport = 1;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message StickerTransport {
message Ancillary {
uint32 pageCount = 1;
uint32 height = 2;
uint32 width = 3;
uint32 firstFrameLength = 4;
bytes firstFrameSidecar = 5;
string mustacheText = 6;
bool isThirdParty = 7;
string receiverFetchID = 8;
}
message Integral {
WAMediaTransport transport = 1;
bool isAnimated = 2;
string receiverFetchID = 3;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
message ContactTransport {
message Ancillary {
string displayName = 1;
}
message Integral {
oneof contact {
string vcard = 1;
WAMediaTransport downloadableVcard = 2;
}
}
Integral integral = 1;
Ancillary ancillary = 2;
}

@ -0,0 +1,271 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waMmsRetry/WAMmsRetry.proto
package waMmsRetry
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MediaRetryNotification_ResultType int32
const (
MediaRetryNotification_GENERAL_ERROR MediaRetryNotification_ResultType = 0
MediaRetryNotification_SUCCESS MediaRetryNotification_ResultType = 1
MediaRetryNotification_NOT_FOUND MediaRetryNotification_ResultType = 2
MediaRetryNotification_DECRYPTION_ERROR MediaRetryNotification_ResultType = 3
)
// Enum value maps for MediaRetryNotification_ResultType.
var (
MediaRetryNotification_ResultType_name = map[int32]string{
0: "GENERAL_ERROR",
1: "SUCCESS",
2: "NOT_FOUND",
3: "DECRYPTION_ERROR",
}
MediaRetryNotification_ResultType_value = map[string]int32{
"GENERAL_ERROR": 0,
"SUCCESS": 1,
"NOT_FOUND": 2,
"DECRYPTION_ERROR": 3,
}
)
func (x MediaRetryNotification_ResultType) Enum() *MediaRetryNotification_ResultType {
p := new(MediaRetryNotification_ResultType)
*p = x
return p
}
func (x MediaRetryNotification_ResultType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MediaRetryNotification_ResultType) Descriptor() protoreflect.EnumDescriptor {
return file_waMmsRetry_WAMmsRetry_proto_enumTypes[0].Descriptor()
}
func (MediaRetryNotification_ResultType) Type() protoreflect.EnumType {
return &file_waMmsRetry_WAMmsRetry_proto_enumTypes[0]
}
func (x MediaRetryNotification_ResultType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MediaRetryNotification_ResultType.Descriptor instead.
func (MediaRetryNotification_ResultType) EnumDescriptor() ([]byte, []int) {
return file_waMmsRetry_WAMmsRetry_proto_rawDescGZIP(), []int{0, 0}
}
type MediaRetryNotification struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StanzaID string `protobuf:"bytes,1,opt,name=stanzaID,proto3" json:"stanzaID,omitempty"`
DirectPath string `protobuf:"bytes,2,opt,name=directPath,proto3" json:"directPath,omitempty"`
Result MediaRetryNotification_ResultType `protobuf:"varint,3,opt,name=result,proto3,enum=WAMmsRetry.MediaRetryNotification_ResultType" json:"result,omitempty"`
}
func (x *MediaRetryNotification) Reset() {
*x = MediaRetryNotification{}
if protoimpl.UnsafeEnabled {
mi := &file_waMmsRetry_WAMmsRetry_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MediaRetryNotification) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MediaRetryNotification) ProtoMessage() {}
func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message {
mi := &file_waMmsRetry_WAMmsRetry_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MediaRetryNotification.ProtoReflect.Descriptor instead.
func (*MediaRetryNotification) Descriptor() ([]byte, []int) {
return file_waMmsRetry_WAMmsRetry_proto_rawDescGZIP(), []int{0}
}
func (x *MediaRetryNotification) GetStanzaID() string {
if x != nil {
return x.StanzaID
}
return ""
}
func (x *MediaRetryNotification) GetDirectPath() string {
if x != nil {
return x.DirectPath
}
return ""
}
func (x *MediaRetryNotification) GetResult() MediaRetryNotification_ResultType {
if x != nil {
return x.Result
}
return MediaRetryNotification_GENERAL_ERROR
}
type ServerErrorReceipt struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StanzaID string `protobuf:"bytes,1,opt,name=stanzaID,proto3" json:"stanzaID,omitempty"`
}
func (x *ServerErrorReceipt) Reset() {
*x = ServerErrorReceipt{}
if protoimpl.UnsafeEnabled {
mi := &file_waMmsRetry_WAMmsRetry_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ServerErrorReceipt) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServerErrorReceipt) ProtoMessage() {}
func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message {
mi := &file_waMmsRetry_WAMmsRetry_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServerErrorReceipt.ProtoReflect.Descriptor instead.
func (*ServerErrorReceipt) Descriptor() ([]byte, []int) {
return file_waMmsRetry_WAMmsRetry_proto_rawDescGZIP(), []int{1}
}
func (x *ServerErrorReceipt) GetStanzaID() string {
if x != nil {
return x.StanzaID
}
return ""
}
var File_waMmsRetry_WAMmsRetry_proto protoreflect.FileDescriptor
//go:embed WAMmsRetry.pb.raw
var file_waMmsRetry_WAMmsRetry_proto_rawDesc []byte
var (
file_waMmsRetry_WAMmsRetry_proto_rawDescOnce sync.Once
file_waMmsRetry_WAMmsRetry_proto_rawDescData = file_waMmsRetry_WAMmsRetry_proto_rawDesc
)
func file_waMmsRetry_WAMmsRetry_proto_rawDescGZIP() []byte {
file_waMmsRetry_WAMmsRetry_proto_rawDescOnce.Do(func() {
file_waMmsRetry_WAMmsRetry_proto_rawDescData = protoimpl.X.CompressGZIP(file_waMmsRetry_WAMmsRetry_proto_rawDescData)
})
return file_waMmsRetry_WAMmsRetry_proto_rawDescData
}
var file_waMmsRetry_WAMmsRetry_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_waMmsRetry_WAMmsRetry_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_waMmsRetry_WAMmsRetry_proto_goTypes = []interface{}{
(MediaRetryNotification_ResultType)(0), // 0: WAMmsRetry.MediaRetryNotification.ResultType
(*MediaRetryNotification)(nil), // 1: WAMmsRetry.MediaRetryNotification
(*ServerErrorReceipt)(nil), // 2: WAMmsRetry.ServerErrorReceipt
}
var file_waMmsRetry_WAMmsRetry_proto_depIdxs = []int32{
0, // 0: WAMmsRetry.MediaRetryNotification.result:type_name -> WAMmsRetry.MediaRetryNotification.ResultType
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_waMmsRetry_WAMmsRetry_proto_init() }
func file_waMmsRetry_WAMmsRetry_proto_init() {
if File_waMmsRetry_WAMmsRetry_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waMmsRetry_WAMmsRetry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MediaRetryNotification); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMmsRetry_WAMmsRetry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ServerErrorReceipt); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waMmsRetry_WAMmsRetry_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waMmsRetry_WAMmsRetry_proto_goTypes,
DependencyIndexes: file_waMmsRetry_WAMmsRetry_proto_depIdxs,
EnumInfos: file_waMmsRetry_WAMmsRetry_proto_enumTypes,
MessageInfos: file_waMmsRetry_WAMmsRetry_proto_msgTypes,
}.Build()
File_waMmsRetry_WAMmsRetry_proto = out.File
file_waMmsRetry_WAMmsRetry_proto_rawDesc = nil
file_waMmsRetry_WAMmsRetry_proto_goTypes = nil
file_waMmsRetry_WAMmsRetry_proto_depIdxs = nil
}

@ -0,0 +1,20 @@
syntax = "proto3";
package WAMmsRetry;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMmsRetry";
message MediaRetryNotification {
enum ResultType {
GENERAL_ERROR = 0;
SUCCESS = 1;
NOT_FOUND = 2;
DECRYPTION_ERROR = 3;
}
string stanzaID = 1;
string directPath = 2;
ResultType result = 3;
}
message ServerErrorReceipt {
string stanzaID = 1;
}

@ -0,0 +1,87 @@
syntax = "proto3";
package WAMsgApplication;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMsgApplication";
import "waCommon/WACommon.proto";
message MessageApplication {
message Metadata {
enum ThreadType {
DEFAULT = 0;
VANISH_MODE = 1;
DISAPPEARING_MESSAGES = 2;
}
message QuotedMessage {
string stanzaID = 1;
string remoteJID = 2;
string participant = 3;
Payload payload = 4;
}
message EphemeralSettingMap {
string chatJID = 1;
EphemeralSetting ephemeralSetting = 2;
}
oneof ephemeral {
EphemeralSetting chatEphemeralSetting = 1;
EphemeralSettingMap ephemeralSettingList = 2;
bytes ephemeralSharedSecret = 3;
}
uint32 forwardingScore = 5;
bool isForwarded = 6;
WACommon.SubProtocol businessMetadata = 7;
bytes frankingKey = 8;
int32 frankingVersion = 9;
QuotedMessage quotedMessage = 10;
ThreadType threadType = 11;
string readonlyMetadataDataclass = 12;
string groupID = 13;
uint32 groupSize = 14;
uint32 groupIndex = 15;
string botResponseID = 16;
string collapsibleID = 17;
}
message Payload {
oneof content {
Content coreContent = 1;
Signal signal = 2;
ApplicationData applicationData = 3;
SubProtocolPayload subProtocol = 4;
}
}
message SubProtocolPayload {
oneof subProtocol {
WACommon.SubProtocol consumerMessage = 2;
WACommon.SubProtocol businessMessage = 3;
WACommon.SubProtocol paymentMessage = 4;
WACommon.SubProtocol multiDevice = 5;
WACommon.SubProtocol voip = 6;
WACommon.SubProtocol armadillo = 7;
}
WACommon.FutureProofBehavior futureProof = 1;
}
message ApplicationData {
}
message Signal {
}
message Content {
}
message EphemeralSetting {
uint32 ephemeralExpiration = 2;
int64 ephemeralSettingTimestamp = 3;
bool isEphemeralSettingReset = 4;
}
Payload payload = 1;
Metadata metadata = 2;
}

@ -0,0 +1,41 @@
package waMsgApplication
import (
"go.mau.fi/whatsmeow/binary/armadillo/armadilloutil"
"go.mau.fi/whatsmeow/binary/armadillo/waArmadilloApplication"
"go.mau.fi/whatsmeow/binary/armadillo/waConsumerApplication"
"go.mau.fi/whatsmeow/binary/armadillo/waMultiDevice"
)
const (
ConsumerApplicationVersion = 1
ArmadilloApplicationVersion = 1
MultiDeviceApplicationVersion = 1 // TODO: check
)
func (msg *MessageApplication_SubProtocolPayload_ConsumerMessage) Decode() (*waConsumerApplication.ConsumerApplication, error) {
return armadilloutil.Unmarshal(&waConsumerApplication.ConsumerApplication{}, msg.ConsumerMessage, ConsumerApplicationVersion)
}
func (msg *MessageApplication_SubProtocolPayload_ConsumerMessage) Set(payload *waConsumerApplication.ConsumerApplication) (err error) {
msg.ConsumerMessage, err = armadilloutil.Marshal(payload, ConsumerApplicationVersion)
return
}
func (msg *MessageApplication_SubProtocolPayload_Armadillo) Decode() (*waArmadilloApplication.Armadillo, error) {
return armadilloutil.Unmarshal(&waArmadilloApplication.Armadillo{}, msg.Armadillo, ArmadilloApplicationVersion)
}
func (msg *MessageApplication_SubProtocolPayload_Armadillo) Set(payload *waArmadilloApplication.Armadillo) (err error) {
msg.Armadillo, err = armadilloutil.Marshal(payload, ArmadilloApplicationVersion)
return
}
func (msg *MessageApplication_SubProtocolPayload_MultiDevice) Decode() (*waMultiDevice.MultiDevice, error) {
return armadilloutil.Unmarshal(&waMultiDevice.MultiDevice{}, msg.MultiDevice, MultiDeviceApplicationVersion)
}
func (msg *MessageApplication_SubProtocolPayload_MultiDevice) Set(payload *waMultiDevice.MultiDevice) (err error) {
msg.MultiDevice, err = armadilloutil.Marshal(payload, MultiDeviceApplicationVersion)
return
}

@ -0,0 +1,964 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waMsgTransport/WAMsgTransport.proto
package waMsgTransport
import (
reflect "reflect"
sync "sync"
waCommon "go.mau.fi/whatsmeow/binary/armadillo/waCommon"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MessageTransport_Protocol_Ancillary_BackupDirective_ActionType int32
const (
MessageTransport_Protocol_Ancillary_BackupDirective_NOOP MessageTransport_Protocol_Ancillary_BackupDirective_ActionType = 0
MessageTransport_Protocol_Ancillary_BackupDirective_UPSERT MessageTransport_Protocol_Ancillary_BackupDirective_ActionType = 1
MessageTransport_Protocol_Ancillary_BackupDirective_DELETE MessageTransport_Protocol_Ancillary_BackupDirective_ActionType = 2
MessageTransport_Protocol_Ancillary_BackupDirective_UPSERT_AND_DELETE MessageTransport_Protocol_Ancillary_BackupDirective_ActionType = 3
)
// Enum value maps for MessageTransport_Protocol_Ancillary_BackupDirective_ActionType.
var (
MessageTransport_Protocol_Ancillary_BackupDirective_ActionType_name = map[int32]string{
0: "NOOP",
1: "UPSERT",
2: "DELETE",
3: "UPSERT_AND_DELETE",
}
MessageTransport_Protocol_Ancillary_BackupDirective_ActionType_value = map[string]int32{
"NOOP": 0,
"UPSERT": 1,
"DELETE": 2,
"UPSERT_AND_DELETE": 3,
}
)
func (x MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) Enum() *MessageTransport_Protocol_Ancillary_BackupDirective_ActionType {
p := new(MessageTransport_Protocol_Ancillary_BackupDirective_ActionType)
*p = x
return p
}
func (x MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) Descriptor() protoreflect.EnumDescriptor {
return file_waMsgTransport_WAMsgTransport_proto_enumTypes[0].Descriptor()
}
func (MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) Type() protoreflect.EnumType {
return &file_waMsgTransport_WAMsgTransport_proto_enumTypes[0]
}
func (x MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary_BackupDirective_ActionType.Descriptor instead.
func (MessageTransport_Protocol_Ancillary_BackupDirective_ActionType) EnumDescriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0, 0, 0}
}
type MessageTransport struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Payload *MessageTransport_Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Protocol *MessageTransport_Protocol `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
}
func (x *MessageTransport) Reset() {
*x = MessageTransport{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport) ProtoMessage() {}
func (x *MessageTransport) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport.ProtoReflect.Descriptor instead.
func (*MessageTransport) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0}
}
func (x *MessageTransport) GetPayload() *MessageTransport_Payload {
if x != nil {
return x.Payload
}
return nil
}
func (x *MessageTransport) GetProtocol() *MessageTransport_Protocol {
if x != nil {
return x.Protocol
}
return nil
}
type DeviceListMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SenderKeyHash []byte `protobuf:"bytes,1,opt,name=senderKeyHash,proto3" json:"senderKeyHash,omitempty"`
SenderTimestamp uint64 `protobuf:"varint,2,opt,name=senderTimestamp,proto3" json:"senderTimestamp,omitempty"`
RecipientKeyHash []byte `protobuf:"bytes,8,opt,name=recipientKeyHash,proto3" json:"recipientKeyHash,omitempty"`
RecipientTimestamp uint64 `protobuf:"varint,9,opt,name=recipientTimestamp,proto3" json:"recipientTimestamp,omitempty"`
}
func (x *DeviceListMetadata) Reset() {
*x = DeviceListMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeviceListMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeviceListMetadata) ProtoMessage() {}
func (x *DeviceListMetadata) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeviceListMetadata.ProtoReflect.Descriptor instead.
func (*DeviceListMetadata) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{1}
}
func (x *DeviceListMetadata) GetSenderKeyHash() []byte {
if x != nil {
return x.SenderKeyHash
}
return nil
}
func (x *DeviceListMetadata) GetSenderTimestamp() uint64 {
if x != nil {
return x.SenderTimestamp
}
return 0
}
func (x *DeviceListMetadata) GetRecipientKeyHash() []byte {
if x != nil {
return x.RecipientKeyHash
}
return nil
}
func (x *DeviceListMetadata) GetRecipientTimestamp() uint64 {
if x != nil {
return x.RecipientTimestamp
}
return 0
}
type MessageTransport_Payload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ApplicationPayload *waCommon.SubProtocol `protobuf:"bytes,1,opt,name=applicationPayload,proto3" json:"applicationPayload,omitempty"`
FutureProof waCommon.FutureProofBehavior `protobuf:"varint,3,opt,name=futureProof,proto3,enum=WACommon.FutureProofBehavior" json:"futureProof,omitempty"`
}
func (x *MessageTransport_Payload) Reset() {
*x = MessageTransport_Payload{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Payload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Payload) ProtoMessage() {}
func (x *MessageTransport_Payload) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Payload.ProtoReflect.Descriptor instead.
func (*MessageTransport_Payload) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 0}
}
func (x *MessageTransport_Payload) GetApplicationPayload() *waCommon.SubProtocol {
if x != nil {
return x.ApplicationPayload
}
return nil
}
func (x *MessageTransport_Payload) GetFutureProof() waCommon.FutureProofBehavior {
if x != nil {
return x.FutureProof
}
return waCommon.FutureProofBehavior(0)
}
type MessageTransport_Protocol struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Integral *MessageTransport_Protocol_Integral `protobuf:"bytes,1,opt,name=integral,proto3" json:"integral,omitempty"`
Ancillary *MessageTransport_Protocol_Ancillary `protobuf:"bytes,2,opt,name=ancillary,proto3" json:"ancillary,omitempty"`
}
func (x *MessageTransport_Protocol) Reset() {
*x = MessageTransport_Protocol{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol) ProtoMessage() {}
func (x *MessageTransport_Protocol) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1}
}
func (x *MessageTransport_Protocol) GetIntegral() *MessageTransport_Protocol_Integral {
if x != nil {
return x.Integral
}
return nil
}
func (x *MessageTransport_Protocol) GetAncillary() *MessageTransport_Protocol_Ancillary {
if x != nil {
return x.Ancillary
}
return nil
}
type MessageTransport_Protocol_Ancillary struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Skdm *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage `protobuf:"bytes,2,opt,name=skdm,proto3" json:"skdm,omitempty"`
DeviceListMetadata *DeviceListMetadata `protobuf:"bytes,3,opt,name=deviceListMetadata,proto3" json:"deviceListMetadata,omitempty"`
Icdc *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices `protobuf:"bytes,4,opt,name=icdc,proto3" json:"icdc,omitempty"`
BackupDirective *MessageTransport_Protocol_Ancillary_BackupDirective `protobuf:"bytes,5,opt,name=backupDirective,proto3" json:"backupDirective,omitempty"`
}
func (x *MessageTransport_Protocol_Ancillary) Reset() {
*x = MessageTransport_Protocol_Ancillary{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Ancillary) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Ancillary) ProtoMessage() {}
func (x *MessageTransport_Protocol_Ancillary) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Ancillary) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0}
}
func (x *MessageTransport_Protocol_Ancillary) GetSkdm() *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage {
if x != nil {
return x.Skdm
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary) GetDeviceListMetadata() *DeviceListMetadata {
if x != nil {
return x.DeviceListMetadata
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary) GetIcdc() *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices {
if x != nil {
return x.Icdc
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary) GetBackupDirective() *MessageTransport_Protocol_Ancillary_BackupDirective {
if x != nil {
return x.BackupDirective
}
return nil
}
type MessageTransport_Protocol_Integral struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Padding []byte `protobuf:"bytes,1,opt,name=padding,proto3" json:"padding,omitempty"`
DSM *MessageTransport_Protocol_Integral_DeviceSentMessage `protobuf:"bytes,2,opt,name=DSM,proto3" json:"DSM,omitempty"`
}
func (x *MessageTransport_Protocol_Integral) Reset() {
*x = MessageTransport_Protocol_Integral{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Integral) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Integral) ProtoMessage() {}
func (x *MessageTransport_Protocol_Integral) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Integral.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Integral) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 1}
}
func (x *MessageTransport_Protocol_Integral) GetPadding() []byte {
if x != nil {
return x.Padding
}
return nil
}
func (x *MessageTransport_Protocol_Integral) GetDSM() *MessageTransport_Protocol_Integral_DeviceSentMessage {
if x != nil {
return x.DSM
}
return nil
}
type MessageTransport_Protocol_Ancillary_BackupDirective struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MessageID string `protobuf:"bytes,1,opt,name=messageID,proto3" json:"messageID,omitempty"`
ActionType MessageTransport_Protocol_Ancillary_BackupDirective_ActionType `protobuf:"varint,2,opt,name=actionType,proto3,enum=WAMsgTransport.MessageTransport_Protocol_Ancillary_BackupDirective_ActionType" json:"actionType,omitempty"`
SupplementalKey string `protobuf:"bytes,3,opt,name=supplementalKey,proto3" json:"supplementalKey,omitempty"`
}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) Reset() {
*x = MessageTransport_Protocol_Ancillary_BackupDirective{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Ancillary_BackupDirective) ProtoMessage() {}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary_BackupDirective.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Ancillary_BackupDirective) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0, 0}
}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) GetMessageID() string {
if x != nil {
return x.MessageID
}
return ""
}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) GetActionType() MessageTransport_Protocol_Ancillary_BackupDirective_ActionType {
if x != nil {
return x.ActionType
}
return MessageTransport_Protocol_Ancillary_BackupDirective_NOOP
}
func (x *MessageTransport_Protocol_Ancillary_BackupDirective) GetSupplementalKey() string {
if x != nil {
return x.SupplementalKey
}
return ""
}
type MessageTransport_Protocol_Ancillary_ICDCParticipantDevices struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SenderIdentity *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription `protobuf:"bytes,1,opt,name=senderIdentity,proto3" json:"senderIdentity,omitempty"`
RecipientIdentities []*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription `protobuf:"bytes,2,rep,name=recipientIdentities,proto3" json:"recipientIdentities,omitempty"`
RecipientUserJIDs []string `protobuf:"bytes,3,rep,name=recipientUserJIDs,proto3" json:"recipientUserJIDs,omitempty"`
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) Reset() {
*x = MessageTransport_Protocol_Ancillary_ICDCParticipantDevices{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) ProtoMessage() {}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary_ICDCParticipantDevices.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0, 1}
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) GetSenderIdentity() *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription {
if x != nil {
return x.SenderIdentity
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) GetRecipientIdentities() []*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription {
if x != nil {
return x.RecipientIdentities
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices) GetRecipientUserJIDs() []string {
if x != nil {
return x.RecipientUserJIDs
}
return nil
}
type MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID,omitempty"`
AxolotlSenderKeyDistributionMessage []byte `protobuf:"bytes,2,opt,name=axolotlSenderKeyDistributionMessage,proto3" json:"axolotlSenderKeyDistributionMessage,omitempty"`
}
func (x *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) Reset() {
*x = MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) ProtoMessage() {}
func (x *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0, 2}
}
func (x *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) GetGroupID() string {
if x != nil {
return x.GroupID
}
return ""
}
func (x *MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage) GetAxolotlSenderKeyDistributionMessage() []byte {
if x != nil {
return x.AxolotlSenderKeyDistributionMessage
}
return nil
}
type MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Seq int32 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
SigningDevice []byte `protobuf:"bytes,2,opt,name=signingDevice,proto3" json:"signingDevice,omitempty"`
UnknownDevices [][]byte `protobuf:"bytes,3,rep,name=unknownDevices,proto3" json:"unknownDevices,omitempty"`
UnknownDeviceIDs []int32 `protobuf:"varint,4,rep,packed,name=unknownDeviceIDs,proto3" json:"unknownDeviceIDs,omitempty"`
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) Reset() {
*x = MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) ProtoMessage() {
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 0, 1, 0}
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) GetSeq() int32 {
if x != nil {
return x.Seq
}
return 0
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) GetSigningDevice() []byte {
if x != nil {
return x.SigningDevice
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) GetUnknownDevices() [][]byte {
if x != nil {
return x.UnknownDevices
}
return nil
}
func (x *MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription) GetUnknownDeviceIDs() []int32 {
if x != nil {
return x.UnknownDeviceIDs
}
return nil
}
type MessageTransport_Protocol_Integral_DeviceSentMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DestinationJID string `protobuf:"bytes,1,opt,name=destinationJID,proto3" json:"destinationJID,omitempty"`
Phash string `protobuf:"bytes,2,opt,name=phash,proto3" json:"phash,omitempty"`
}
func (x *MessageTransport_Protocol_Integral_DeviceSentMessage) Reset() {
*x = MessageTransport_Protocol_Integral_DeviceSentMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageTransport_Protocol_Integral_DeviceSentMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageTransport_Protocol_Integral_DeviceSentMessage) ProtoMessage() {}
func (x *MessageTransport_Protocol_Integral_DeviceSentMessage) ProtoReflect() protoreflect.Message {
mi := &file_waMsgTransport_WAMsgTransport_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageTransport_Protocol_Integral_DeviceSentMessage.ProtoReflect.Descriptor instead.
func (*MessageTransport_Protocol_Integral_DeviceSentMessage) Descriptor() ([]byte, []int) {
return file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP(), []int{0, 1, 1, 0}
}
func (x *MessageTransport_Protocol_Integral_DeviceSentMessage) GetDestinationJID() string {
if x != nil {
return x.DestinationJID
}
return ""
}
func (x *MessageTransport_Protocol_Integral_DeviceSentMessage) GetPhash() string {
if x != nil {
return x.Phash
}
return ""
}
var File_waMsgTransport_WAMsgTransport_proto protoreflect.FileDescriptor
//go:embed WAMsgTransport.pb.raw
var file_waMsgTransport_WAMsgTransport_proto_rawDesc []byte
var (
file_waMsgTransport_WAMsgTransport_proto_rawDescOnce sync.Once
file_waMsgTransport_WAMsgTransport_proto_rawDescData = file_waMsgTransport_WAMsgTransport_proto_rawDesc
)
func file_waMsgTransport_WAMsgTransport_proto_rawDescGZIP() []byte {
file_waMsgTransport_WAMsgTransport_proto_rawDescOnce.Do(func() {
file_waMsgTransport_WAMsgTransport_proto_rawDescData = protoimpl.X.CompressGZIP(file_waMsgTransport_WAMsgTransport_proto_rawDescData)
})
return file_waMsgTransport_WAMsgTransport_proto_rawDescData
}
var file_waMsgTransport_WAMsgTransport_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_waMsgTransport_WAMsgTransport_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_waMsgTransport_WAMsgTransport_proto_goTypes = []interface{}{
(MessageTransport_Protocol_Ancillary_BackupDirective_ActionType)(0), // 0: WAMsgTransport.MessageTransport.Protocol.Ancillary.BackupDirective.ActionType
(*MessageTransport)(nil), // 1: WAMsgTransport.MessageTransport
(*DeviceListMetadata)(nil), // 2: WAMsgTransport.DeviceListMetadata
(*MessageTransport_Payload)(nil), // 3: WAMsgTransport.MessageTransport.Payload
(*MessageTransport_Protocol)(nil), // 4: WAMsgTransport.MessageTransport.Protocol
(*MessageTransport_Protocol_Ancillary)(nil), // 5: WAMsgTransport.MessageTransport.Protocol.Ancillary
(*MessageTransport_Protocol_Integral)(nil), // 6: WAMsgTransport.MessageTransport.Protocol.Integral
(*MessageTransport_Protocol_Ancillary_BackupDirective)(nil), // 7: WAMsgTransport.MessageTransport.Protocol.Ancillary.BackupDirective
(*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices)(nil), // 8: WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices
(*MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage)(nil), // 9: WAMsgTransport.MessageTransport.Protocol.Ancillary.SenderKeyDistributionMessage
(*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription)(nil), // 10: WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices.ICDCIdentityListDescription
(*MessageTransport_Protocol_Integral_DeviceSentMessage)(nil), // 11: WAMsgTransport.MessageTransport.Protocol.Integral.DeviceSentMessage
(*waCommon.SubProtocol)(nil), // 12: WACommon.SubProtocol
(waCommon.FutureProofBehavior)(0), // 13: WACommon.FutureProofBehavior
}
var file_waMsgTransport_WAMsgTransport_proto_depIdxs = []int32{
3, // 0: WAMsgTransport.MessageTransport.payload:type_name -> WAMsgTransport.MessageTransport.Payload
4, // 1: WAMsgTransport.MessageTransport.protocol:type_name -> WAMsgTransport.MessageTransport.Protocol
12, // 2: WAMsgTransport.MessageTransport.Payload.applicationPayload:type_name -> WACommon.SubProtocol
13, // 3: WAMsgTransport.MessageTransport.Payload.futureProof:type_name -> WACommon.FutureProofBehavior
6, // 4: WAMsgTransport.MessageTransport.Protocol.integral:type_name -> WAMsgTransport.MessageTransport.Protocol.Integral
5, // 5: WAMsgTransport.MessageTransport.Protocol.ancillary:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary
9, // 6: WAMsgTransport.MessageTransport.Protocol.Ancillary.skdm:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.SenderKeyDistributionMessage
2, // 7: WAMsgTransport.MessageTransport.Protocol.Ancillary.deviceListMetadata:type_name -> WAMsgTransport.DeviceListMetadata
8, // 8: WAMsgTransport.MessageTransport.Protocol.Ancillary.icdc:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices
7, // 9: WAMsgTransport.MessageTransport.Protocol.Ancillary.backupDirective:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.BackupDirective
11, // 10: WAMsgTransport.MessageTransport.Protocol.Integral.DSM:type_name -> WAMsgTransport.MessageTransport.Protocol.Integral.DeviceSentMessage
0, // 11: WAMsgTransport.MessageTransport.Protocol.Ancillary.BackupDirective.actionType:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.BackupDirective.ActionType
10, // 12: WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices.senderIdentity:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices.ICDCIdentityListDescription
10, // 13: WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices.recipientIdentities:type_name -> WAMsgTransport.MessageTransport.Protocol.Ancillary.ICDCParticipantDevices.ICDCIdentityListDescription
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_waMsgTransport_WAMsgTransport_proto_init() }
func file_waMsgTransport_WAMsgTransport_proto_init() {
if File_waMsgTransport_WAMsgTransport_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waMsgTransport_WAMsgTransport_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeviceListMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Payload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Ancillary); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Integral); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Ancillary_BackupDirective); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Ancillary_SenderKeyDistributionMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Ancillary_ICDCParticipantDevices_ICDCIdentityListDescription); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMsgTransport_WAMsgTransport_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageTransport_Protocol_Integral_DeviceSentMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waMsgTransport_WAMsgTransport_proto_rawDesc,
NumEnums: 1,
NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waMsgTransport_WAMsgTransport_proto_goTypes,
DependencyIndexes: file_waMsgTransport_WAMsgTransport_proto_depIdxs,
EnumInfos: file_waMsgTransport_WAMsgTransport_proto_enumTypes,
MessageInfos: file_waMsgTransport_WAMsgTransport_proto_msgTypes,
}.Build()
File_waMsgTransport_WAMsgTransport_proto = out.File
file_waMsgTransport_WAMsgTransport_proto_rawDesc = nil
file_waMsgTransport_WAMsgTransport_proto_goTypes = nil
file_waMsgTransport_WAMsgTransport_proto_depIdxs = nil
}

@ -0,0 +1,75 @@
syntax = "proto3";
package WAMsgTransport;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMsgTransport";
import "waCommon/WACommon.proto";
message MessageTransport {
message Payload {
WACommon.SubProtocol applicationPayload = 1;
WACommon.FutureProofBehavior futureProof = 3;
}
message Protocol {
message Ancillary {
message BackupDirective {
enum ActionType {
NOOP = 0;
UPSERT = 1;
DELETE = 2;
UPSERT_AND_DELETE = 3;
}
string messageID = 1;
ActionType actionType = 2;
string supplementalKey = 3;
}
message ICDCParticipantDevices {
message ICDCIdentityListDescription {
int32 seq = 1;
bytes signingDevice = 2;
repeated bytes unknownDevices = 3;
repeated int32 unknownDeviceIDs = 4;
}
ICDCIdentityListDescription senderIdentity = 1;
repeated ICDCIdentityListDescription recipientIdentities = 2;
repeated string recipientUserJIDs = 3;
}
message SenderKeyDistributionMessage {
string groupID = 1;
bytes axolotlSenderKeyDistributionMessage = 2;
}
SenderKeyDistributionMessage skdm = 2;
DeviceListMetadata deviceListMetadata = 3;
ICDCParticipantDevices icdc = 4;
BackupDirective backupDirective = 5;
}
message Integral {
message DeviceSentMessage {
string destinationJID = 1;
string phash = 2;
}
bytes padding = 1;
DeviceSentMessage DSM = 2;
}
Integral integral = 1;
Ancillary ancillary = 2;
}
Payload payload = 1;
Protocol protocol = 2;
}
message DeviceListMetadata {
bytes senderKeyHash = 1;
uint64 senderTimestamp = 2;
bytes recipientKeyHash = 8;
uint64 recipientTimestamp = 9;
}

@ -0,0 +1,19 @@
package waMsgTransport
import (
"go.mau.fi/whatsmeow/binary/armadillo/armadilloutil"
"go.mau.fi/whatsmeow/binary/armadillo/waMsgApplication"
)
const (
MessageApplicationVersion = 2
)
func (msg *MessageTransport_Payload) Decode() (*waMsgApplication.MessageApplication, error) {
return armadilloutil.Unmarshal(&waMsgApplication.MessageApplication{}, msg.GetApplicationPayload(), MessageApplicationVersion)
}
func (msg *MessageTransport_Payload) Set(payload *waMsgApplication.MessageApplication) (err error) {
msg.ApplicationPayload, err = armadilloutil.Marshal(payload, MessageApplicationVersion)
return
}

@ -0,0 +1,859 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waMultiDevice/WAMultiDevice.proto
package waMultiDevice
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MultiDevice struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Payload *MultiDevice_Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Metadata *MultiDevice_Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
func (x *MultiDevice) Reset() {
*x = MultiDevice{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice) ProtoMessage() {}
func (x *MultiDevice) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice.ProtoReflect.Descriptor instead.
func (*MultiDevice) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0}
}
func (x *MultiDevice) GetPayload() *MultiDevice_Payload {
if x != nil {
return x.Payload
}
return nil
}
func (x *MultiDevice) GetMetadata() *MultiDevice_Metadata {
if x != nil {
return x.Metadata
}
return nil
}
type MultiDevice_Metadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *MultiDevice_Metadata) Reset() {
*x = MultiDevice_Metadata{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_Metadata) ProtoMessage() {}
func (x *MultiDevice_Metadata) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_Metadata.ProtoReflect.Descriptor instead.
func (*MultiDevice_Metadata) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 0}
}
type MultiDevice_Payload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Payload:
//
// *MultiDevice_Payload_ApplicationData
// *MultiDevice_Payload_Signal
Payload isMultiDevice_Payload_Payload `protobuf_oneof:"payload"`
}
func (x *MultiDevice_Payload) Reset() {
*x = MultiDevice_Payload{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_Payload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_Payload) ProtoMessage() {}
func (x *MultiDevice_Payload) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_Payload.ProtoReflect.Descriptor instead.
func (*MultiDevice_Payload) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 1}
}
func (m *MultiDevice_Payload) GetPayload() isMultiDevice_Payload_Payload {
if m != nil {
return m.Payload
}
return nil
}
func (x *MultiDevice_Payload) GetApplicationData() *MultiDevice_ApplicationData {
if x, ok := x.GetPayload().(*MultiDevice_Payload_ApplicationData); ok {
return x.ApplicationData
}
return nil
}
func (x *MultiDevice_Payload) GetSignal() *MultiDevice_Signal {
if x, ok := x.GetPayload().(*MultiDevice_Payload_Signal); ok {
return x.Signal
}
return nil
}
type isMultiDevice_Payload_Payload interface {
isMultiDevice_Payload_Payload()
}
type MultiDevice_Payload_ApplicationData struct {
ApplicationData *MultiDevice_ApplicationData `protobuf:"bytes,1,opt,name=applicationData,proto3,oneof"`
}
type MultiDevice_Payload_Signal struct {
Signal *MultiDevice_Signal `protobuf:"bytes,2,opt,name=signal,proto3,oneof"`
}
func (*MultiDevice_Payload_ApplicationData) isMultiDevice_Payload_Payload() {}
func (*MultiDevice_Payload_Signal) isMultiDevice_Payload_Payload() {}
type MultiDevice_ApplicationData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to ApplicationData:
//
// *MultiDevice_ApplicationData_AppStateSyncKeyShare
// *MultiDevice_ApplicationData_AppStateSyncKeyRequest
ApplicationData isMultiDevice_ApplicationData_ApplicationData `protobuf_oneof:"applicationData"`
}
func (x *MultiDevice_ApplicationData) Reset() {
*x = MultiDevice_ApplicationData{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData) ProtoMessage() {}
func (x *MultiDevice_ApplicationData) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2}
}
func (m *MultiDevice_ApplicationData) GetApplicationData() isMultiDevice_ApplicationData_ApplicationData {
if m != nil {
return m.ApplicationData
}
return nil
}
func (x *MultiDevice_ApplicationData) GetAppStateSyncKeyShare() *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage {
if x, ok := x.GetApplicationData().(*MultiDevice_ApplicationData_AppStateSyncKeyShare); ok {
return x.AppStateSyncKeyShare
}
return nil
}
func (x *MultiDevice_ApplicationData) GetAppStateSyncKeyRequest() *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage {
if x, ok := x.GetApplicationData().(*MultiDevice_ApplicationData_AppStateSyncKeyRequest); ok {
return x.AppStateSyncKeyRequest
}
return nil
}
type isMultiDevice_ApplicationData_ApplicationData interface {
isMultiDevice_ApplicationData_ApplicationData()
}
type MultiDevice_ApplicationData_AppStateSyncKeyShare struct {
AppStateSyncKeyShare *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage `protobuf:"bytes,1,opt,name=appStateSyncKeyShare,proto3,oneof"`
}
type MultiDevice_ApplicationData_AppStateSyncKeyRequest struct {
AppStateSyncKeyRequest *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage `protobuf:"bytes,2,opt,name=appStateSyncKeyRequest,proto3,oneof"`
}
func (*MultiDevice_ApplicationData_AppStateSyncKeyShare) isMultiDevice_ApplicationData_ApplicationData() {
}
func (*MultiDevice_ApplicationData_AppStateSyncKeyRequest) isMultiDevice_ApplicationData_ApplicationData() {
}
type MultiDevice_Signal struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *MultiDevice_Signal) Reset() {
*x = MultiDevice_Signal{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_Signal) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_Signal) ProtoMessage() {}
func (x *MultiDevice_Signal) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_Signal.ProtoReflect.Descriptor instead.
func (*MultiDevice_Signal) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 3}
}
type MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeyIDs []*MultiDevice_ApplicationData_AppStateSyncKeyId `protobuf:"bytes,1,rep,name=keyIDs,proto3" json:"keyIDs,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) ProtoMessage() {}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 0}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage) GetKeyIDs() []*MultiDevice_ApplicationData_AppStateSyncKeyId {
if x != nil {
return x.KeyIDs
}
return nil
}
type MultiDevice_ApplicationData_AppStateSyncKeyShareMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Keys []*MultiDevice_ApplicationData_AppStateSyncKey `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKeyShareMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) ProtoMessage() {}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKeyShareMessage.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 1}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyShareMessage) GetKeys() []*MultiDevice_ApplicationData_AppStateSyncKey {
if x != nil {
return x.Keys
}
return nil
}
type MultiDevice_ApplicationData_AppStateSyncKey struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeyID *MultiDevice_ApplicationData_AppStateSyncKeyId `protobuf:"bytes,1,opt,name=keyID,proto3" json:"keyID,omitempty"`
KeyData *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData `protobuf:"bytes,2,opt,name=keyData,proto3" json:"keyData,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKey{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKey) ProtoMessage() {}
func (x *MultiDevice_ApplicationData_AppStateSyncKey) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKey.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKey) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 2}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey) GetKeyID() *MultiDevice_ApplicationData_AppStateSyncKeyId {
if x != nil {
return x.KeyID
}
return nil
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey) GetKeyData() *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData {
if x != nil {
return x.KeyData
}
return nil
}
type MultiDevice_ApplicationData_AppStateSyncKeyId struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeyID []byte `protobuf:"bytes,1,opt,name=keyID,proto3" json:"keyID,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyId) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKeyId{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyId) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKeyId) ProtoMessage() {}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyId) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKeyId.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKeyId) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 3}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKeyId) GetKeyID() []byte {
if x != nil {
return x.KeyID
}
return nil
}
type MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeyData []byte `protobuf:"bytes,1,opt,name=keyData,proto3" json:"keyData,omitempty"`
Fingerprint *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint `protobuf:"bytes,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"`
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) ProtoMessage() {}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 2, 0}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) GetKeyData() []byte {
if x != nil {
return x.KeyData
}
return nil
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) GetFingerprint() *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint {
if x != nil {
return x.Fingerprint
}
return nil
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
type MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RawID uint32 `protobuf:"varint,1,opt,name=rawID,proto3" json:"rawID,omitempty"`
CurrentIndex uint32 `protobuf:"varint,2,opt,name=currentIndex,proto3" json:"currentIndex,omitempty"`
DeviceIndexes []uint32 `protobuf:"varint,3,rep,packed,name=deviceIndexes,proto3" json:"deviceIndexes,omitempty"`
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) Reset() {
*x = MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint{}
if protoimpl.UnsafeEnabled {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) ProtoMessage() {
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) ProtoReflect() protoreflect.Message {
mi := &file_waMultiDevice_WAMultiDevice_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint.ProtoReflect.Descriptor instead.
func (*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) Descriptor() ([]byte, []int) {
return file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP(), []int{0, 2, 2, 0, 0}
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) GetRawID() uint32 {
if x != nil {
return x.RawID
}
return 0
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) GetCurrentIndex() uint32 {
if x != nil {
return x.CurrentIndex
}
return 0
}
func (x *MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint) GetDeviceIndexes() []uint32 {
if x != nil {
return x.DeviceIndexes
}
return nil
}
var File_waMultiDevice_WAMultiDevice_proto protoreflect.FileDescriptor
//go:embed WAMultiDevice.pb.raw
var file_waMultiDevice_WAMultiDevice_proto_rawDesc []byte
var (
file_waMultiDevice_WAMultiDevice_proto_rawDescOnce sync.Once
file_waMultiDevice_WAMultiDevice_proto_rawDescData = file_waMultiDevice_WAMultiDevice_proto_rawDesc
)
func file_waMultiDevice_WAMultiDevice_proto_rawDescGZIP() []byte {
file_waMultiDevice_WAMultiDevice_proto_rawDescOnce.Do(func() {
file_waMultiDevice_WAMultiDevice_proto_rawDescData = protoimpl.X.CompressGZIP(file_waMultiDevice_WAMultiDevice_proto_rawDescData)
})
return file_waMultiDevice_WAMultiDevice_proto_rawDescData
}
var file_waMultiDevice_WAMultiDevice_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_waMultiDevice_WAMultiDevice_proto_goTypes = []interface{}{
(*MultiDevice)(nil), // 0: WAMultiDevice.MultiDevice
(*MultiDevice_Metadata)(nil), // 1: WAMultiDevice.MultiDevice.Metadata
(*MultiDevice_Payload)(nil), // 2: WAMultiDevice.MultiDevice.Payload
(*MultiDevice_ApplicationData)(nil), // 3: WAMultiDevice.MultiDevice.ApplicationData
(*MultiDevice_Signal)(nil), // 4: WAMultiDevice.MultiDevice.Signal
(*MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage)(nil), // 5: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyRequestMessage
(*MultiDevice_ApplicationData_AppStateSyncKeyShareMessage)(nil), // 6: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyShareMessage
(*MultiDevice_ApplicationData_AppStateSyncKey)(nil), // 7: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey
(*MultiDevice_ApplicationData_AppStateSyncKeyId)(nil), // 8: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyId
(*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData)(nil), // 9: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.AppStateSyncKeyData
(*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint)(nil), // 10: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.AppStateSyncKeyData.AppStateSyncKeyFingerprint
}
var file_waMultiDevice_WAMultiDevice_proto_depIdxs = []int32{
2, // 0: WAMultiDevice.MultiDevice.payload:type_name -> WAMultiDevice.MultiDevice.Payload
1, // 1: WAMultiDevice.MultiDevice.metadata:type_name -> WAMultiDevice.MultiDevice.Metadata
3, // 2: WAMultiDevice.MultiDevice.Payload.applicationData:type_name -> WAMultiDevice.MultiDevice.ApplicationData
4, // 3: WAMultiDevice.MultiDevice.Payload.signal:type_name -> WAMultiDevice.MultiDevice.Signal
6, // 4: WAMultiDevice.MultiDevice.ApplicationData.appStateSyncKeyShare:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyShareMessage
5, // 5: WAMultiDevice.MultiDevice.ApplicationData.appStateSyncKeyRequest:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyRequestMessage
8, // 6: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyRequestMessage.keyIDs:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyId
7, // 7: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyShareMessage.keys:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey
8, // 8: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.keyID:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKeyId
9, // 9: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.keyData:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.AppStateSyncKeyData
10, // 10: WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.AppStateSyncKeyData.fingerprint:type_name -> WAMultiDevice.MultiDevice.ApplicationData.AppStateSyncKey.AppStateSyncKeyData.AppStateSyncKeyFingerprint
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
}
func init() { file_waMultiDevice_WAMultiDevice_proto_init() }
func file_waMultiDevice_WAMultiDevice_proto_init() {
if File_waMultiDevice_WAMultiDevice_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waMultiDevice_WAMultiDevice_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_Metadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_Payload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_Signal); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKeyRequestMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKeyShareMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKey); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKeyId); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MultiDevice_ApplicationData_AppStateSyncKey_AppStateSyncKeyData_AppStateSyncKeyFingerprint); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[2].OneofWrappers = []interface{}{
(*MultiDevice_Payload_ApplicationData)(nil),
(*MultiDevice_Payload_Signal)(nil),
}
file_waMultiDevice_WAMultiDevice_proto_msgTypes[3].OneofWrappers = []interface{}{
(*MultiDevice_ApplicationData_AppStateSyncKeyShare)(nil),
(*MultiDevice_ApplicationData_AppStateSyncKeyRequest)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waMultiDevice_WAMultiDevice_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waMultiDevice_WAMultiDevice_proto_goTypes,
DependencyIndexes: file_waMultiDevice_WAMultiDevice_proto_depIdxs,
MessageInfos: file_waMultiDevice_WAMultiDevice_proto_msgTypes,
}.Build()
File_waMultiDevice_WAMultiDevice_proto = out.File
file_waMultiDevice_WAMultiDevice_proto_rawDesc = nil
file_waMultiDevice_WAMultiDevice_proto_goTypes = nil
file_waMultiDevice_WAMultiDevice_proto_depIdxs = nil
}

@ -0,0 +1,57 @@
syntax = "proto3";
package WAMultiDevice;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waMultiDevice";
message MultiDevice {
message Metadata {
}
message Payload {
oneof payload {
ApplicationData applicationData = 1;
Signal signal = 2;
}
}
message ApplicationData {
message AppStateSyncKeyRequestMessage {
repeated AppStateSyncKeyId keyIDs = 1;
}
message AppStateSyncKeyShareMessage {
repeated AppStateSyncKey keys = 1;
}
message AppStateSyncKey {
message AppStateSyncKeyData {
message AppStateSyncKeyFingerprint {
uint32 rawID = 1;
uint32 currentIndex = 2;
repeated uint32 deviceIndexes = 3 [packed=true];
}
bytes keyData = 1;
AppStateSyncKeyFingerprint fingerprint = 2;
int64 timestamp = 3;
}
AppStateSyncKeyId keyID = 1;
AppStateSyncKeyData keyData = 2;
}
message AppStateSyncKeyId {
bytes keyID = 1;
}
oneof applicationData {
AppStateSyncKeyShareMessage appStateSyncKeyShare = 1;
AppStateSyncKeyRequestMessage appStateSyncKeyRequest = 2;
}
}
message Signal {
}
Payload payload = 1;
Metadata metadata = 2;
}

@ -0,0 +1,3 @@
package waMultiDevice
func (*MultiDevice) IsMessageApplicationSub() {}

@ -0,0 +1,163 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waProtocol/WAProtocol.proto
package waProtocol
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MessageKey struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RemoteJID string `protobuf:"bytes,1,opt,name=remoteJID,proto3" json:"remoteJID,omitempty"`
FromMe bool `protobuf:"varint,2,opt,name=fromMe,proto3" json:"fromMe,omitempty"`
ID string `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"`
Participant string `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"`
}
func (x *MessageKey) Reset() {
*x = MessageKey{}
if protoimpl.UnsafeEnabled {
mi := &file_waProtocol_WAProtocol_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageKey) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageKey) ProtoMessage() {}
func (x *MessageKey) ProtoReflect() protoreflect.Message {
mi := &file_waProtocol_WAProtocol_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageKey.ProtoReflect.Descriptor instead.
func (*MessageKey) Descriptor() ([]byte, []int) {
return file_waProtocol_WAProtocol_proto_rawDescGZIP(), []int{0}
}
func (x *MessageKey) GetRemoteJID() string {
if x != nil {
return x.RemoteJID
}
return ""
}
func (x *MessageKey) GetFromMe() bool {
if x != nil {
return x.FromMe
}
return false
}
func (x *MessageKey) GetID() string {
if x != nil {
return x.ID
}
return ""
}
func (x *MessageKey) GetParticipant() string {
if x != nil {
return x.Participant
}
return ""
}
var File_waProtocol_WAProtocol_proto protoreflect.FileDescriptor
//go:embed WAProtocol.pb.raw
var file_waProtocol_WAProtocol_proto_rawDesc []byte
var (
file_waProtocol_WAProtocol_proto_rawDescOnce sync.Once
file_waProtocol_WAProtocol_proto_rawDescData = file_waProtocol_WAProtocol_proto_rawDesc
)
func file_waProtocol_WAProtocol_proto_rawDescGZIP() []byte {
file_waProtocol_WAProtocol_proto_rawDescOnce.Do(func() {
file_waProtocol_WAProtocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_waProtocol_WAProtocol_proto_rawDescData)
})
return file_waProtocol_WAProtocol_proto_rawDescData
}
var file_waProtocol_WAProtocol_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_waProtocol_WAProtocol_proto_goTypes = []interface{}{
(*MessageKey)(nil), // 0: WAProtocol.MessageKey
}
var file_waProtocol_WAProtocol_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_waProtocol_WAProtocol_proto_init() }
func file_waProtocol_WAProtocol_proto_init() {
if File_waProtocol_WAProtocol_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waProtocol_WAProtocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageKey); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waProtocol_WAProtocol_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waProtocol_WAProtocol_proto_goTypes,
DependencyIndexes: file_waProtocol_WAProtocol_proto_depIdxs,
MessageInfos: file_waProtocol_WAProtocol_proto_msgTypes,
}.Build()
File_waProtocol_WAProtocol_proto = out.File
file_waProtocol_WAProtocol_proto_rawDesc = nil
file_waProtocol_WAProtocol_proto_goTypes = nil
file_waProtocol_WAProtocol_proto_depIdxs = nil
}

@ -0,0 +1,9 @@
waProtocol/WAProtocol.proto
WAProtocol"t
MessageKey
remoteJID ( R remoteJID
fromMe (RfromMe
ID ( RID
participant ( R participantB1Z/go.mau.fi/whatsmeow/binary/armadillo/waProtocolbproto3

@ -0,0 +1,10 @@
syntax = "proto3";
package WAProtocol;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waProtocol";
message MessageKey {
string remoteJID = 1;
bool fromMe = 2;
string ID = 3;
string participant = 4;
}

@ -0,0 +1,962 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v3.21.12
// source: waServerSync/WAServerSync.proto
package waServerSync
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "embed"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type SyncdMutation_SyncdOperation int32
const (
SyncdMutation_SET SyncdMutation_SyncdOperation = 0
SyncdMutation_REMOVE SyncdMutation_SyncdOperation = 1
)
// Enum value maps for SyncdMutation_SyncdOperation.
var (
SyncdMutation_SyncdOperation_name = map[int32]string{
0: "SET",
1: "REMOVE",
}
SyncdMutation_SyncdOperation_value = map[string]int32{
"SET": 0,
"REMOVE": 1,
}
)
func (x SyncdMutation_SyncdOperation) Enum() *SyncdMutation_SyncdOperation {
p := new(SyncdMutation_SyncdOperation)
*p = x
return p
}
func (x SyncdMutation_SyncdOperation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (SyncdMutation_SyncdOperation) Descriptor() protoreflect.EnumDescriptor {
return file_waServerSync_WAServerSync_proto_enumTypes[0].Descriptor()
}
func (SyncdMutation_SyncdOperation) Type() protoreflect.EnumType {
return &file_waServerSync_WAServerSync_proto_enumTypes[0]
}
func (x SyncdMutation_SyncdOperation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use SyncdMutation_SyncdOperation.Descriptor instead.
func (SyncdMutation_SyncdOperation) EnumDescriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{0, 0}
}
type SyncdMutation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Operation SyncdMutation_SyncdOperation `protobuf:"varint,1,opt,name=operation,proto3,enum=WAServerSync.SyncdMutation_SyncdOperation" json:"operation,omitempty"`
Record *SyncdRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"`
}
func (x *SyncdMutation) Reset() {
*x = SyncdMutation{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdMutation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdMutation) ProtoMessage() {}
func (x *SyncdMutation) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdMutation.ProtoReflect.Descriptor instead.
func (*SyncdMutation) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{0}
}
func (x *SyncdMutation) GetOperation() SyncdMutation_SyncdOperation {
if x != nil {
return x.Operation
}
return SyncdMutation_SET
}
func (x *SyncdMutation) GetRecord() *SyncdRecord {
if x != nil {
return x.Record
}
return nil
}
type SyncdVersion struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
}
func (x *SyncdVersion) Reset() {
*x = SyncdVersion{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdVersion) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdVersion) ProtoMessage() {}
func (x *SyncdVersion) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdVersion.ProtoReflect.Descriptor instead.
func (*SyncdVersion) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{1}
}
func (x *SyncdVersion) GetVersion() uint64 {
if x != nil {
return x.Version
}
return 0
}
type ExitCode struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code uint64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
}
func (x *ExitCode) Reset() {
*x = ExitCode{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExitCode) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExitCode) ProtoMessage() {}
func (x *ExitCode) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExitCode.ProtoReflect.Descriptor instead.
func (*ExitCode) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{2}
}
func (x *ExitCode) GetCode() uint64 {
if x != nil {
return x.Code
}
return 0
}
func (x *ExitCode) GetText() string {
if x != nil {
return x.Text
}
return ""
}
type SyncdIndex struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"`
}
func (x *SyncdIndex) Reset() {
*x = SyncdIndex{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdIndex) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdIndex) ProtoMessage() {}
func (x *SyncdIndex) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdIndex.ProtoReflect.Descriptor instead.
func (*SyncdIndex) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{3}
}
func (x *SyncdIndex) GetBlob() []byte {
if x != nil {
return x.Blob
}
return nil
}
type SyncdValue struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"`
}
func (x *SyncdValue) Reset() {
*x = SyncdValue{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdValue) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdValue) ProtoMessage() {}
func (x *SyncdValue) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdValue.ProtoReflect.Descriptor instead.
func (*SyncdValue) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{4}
}
func (x *SyncdValue) GetBlob() []byte {
if x != nil {
return x.Blob
}
return nil
}
type KeyId struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
}
func (x *KeyId) Reset() {
*x = KeyId{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *KeyId) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*KeyId) ProtoMessage() {}
func (x *KeyId) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use KeyId.ProtoReflect.Descriptor instead.
func (*KeyId) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{5}
}
func (x *KeyId) GetID() []byte {
if x != nil {
return x.ID
}
return nil
}
type SyncdRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Index *SyncdIndex `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
Value *SyncdValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
KeyID *KeyId `protobuf:"bytes,3,opt,name=keyID,proto3" json:"keyID,omitempty"`
}
func (x *SyncdRecord) Reset() {
*x = SyncdRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdRecord) ProtoMessage() {}
func (x *SyncdRecord) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdRecord.ProtoReflect.Descriptor instead.
func (*SyncdRecord) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{6}
}
func (x *SyncdRecord) GetIndex() *SyncdIndex {
if x != nil {
return x.Index
}
return nil
}
func (x *SyncdRecord) GetValue() *SyncdValue {
if x != nil {
return x.Value
}
return nil
}
func (x *SyncdRecord) GetKeyID() *KeyId {
if x != nil {
return x.KeyID
}
return nil
}
type ExternalBlobReference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MediaKey []byte `protobuf:"bytes,1,opt,name=mediaKey,proto3" json:"mediaKey,omitempty"`
DirectPath string `protobuf:"bytes,2,opt,name=directPath,proto3" json:"directPath,omitempty"`
Handle string `protobuf:"bytes,3,opt,name=handle,proto3" json:"handle,omitempty"`
FileSizeBytes uint64 `protobuf:"varint,4,opt,name=fileSizeBytes,proto3" json:"fileSizeBytes,omitempty"`
FileSHA256 []byte `protobuf:"bytes,5,opt,name=fileSHA256,proto3" json:"fileSHA256,omitempty"`
FileEncSHA256 []byte `protobuf:"bytes,6,opt,name=fileEncSHA256,proto3" json:"fileEncSHA256,omitempty"`
}
func (x *ExternalBlobReference) Reset() {
*x = ExternalBlobReference{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExternalBlobReference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExternalBlobReference) ProtoMessage() {}
func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExternalBlobReference.ProtoReflect.Descriptor instead.
func (*ExternalBlobReference) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{7}
}
func (x *ExternalBlobReference) GetMediaKey() []byte {
if x != nil {
return x.MediaKey
}
return nil
}
func (x *ExternalBlobReference) GetDirectPath() string {
if x != nil {
return x.DirectPath
}
return ""
}
func (x *ExternalBlobReference) GetHandle() string {
if x != nil {
return x.Handle
}
return ""
}
func (x *ExternalBlobReference) GetFileSizeBytes() uint64 {
if x != nil {
return x.FileSizeBytes
}
return 0
}
func (x *ExternalBlobReference) GetFileSHA256() []byte {
if x != nil {
return x.FileSHA256
}
return nil
}
func (x *ExternalBlobReference) GetFileEncSHA256() []byte {
if x != nil {
return x.FileEncSHA256
}
return nil
}
type SyncdSnapshot struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version *SyncdVersion `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
Records []*SyncdRecord `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"`
Mac []byte `protobuf:"bytes,3,opt,name=mac,proto3" json:"mac,omitempty"`
KeyID *KeyId `protobuf:"bytes,4,opt,name=keyID,proto3" json:"keyID,omitempty"`
}
func (x *SyncdSnapshot) Reset() {
*x = SyncdSnapshot{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdSnapshot) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdSnapshot) ProtoMessage() {}
func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdSnapshot.ProtoReflect.Descriptor instead.
func (*SyncdSnapshot) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{8}
}
func (x *SyncdSnapshot) GetVersion() *SyncdVersion {
if x != nil {
return x.Version
}
return nil
}
func (x *SyncdSnapshot) GetRecords() []*SyncdRecord {
if x != nil {
return x.Records
}
return nil
}
func (x *SyncdSnapshot) GetMac() []byte {
if x != nil {
return x.Mac
}
return nil
}
func (x *SyncdSnapshot) GetKeyID() *KeyId {
if x != nil {
return x.KeyID
}
return nil
}
type SyncdMutations struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Mutations []*SyncdMutation `protobuf:"bytes,1,rep,name=mutations,proto3" json:"mutations,omitempty"`
}
func (x *SyncdMutations) Reset() {
*x = SyncdMutations{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdMutations) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdMutations) ProtoMessage() {}
func (x *SyncdMutations) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdMutations.ProtoReflect.Descriptor instead.
func (*SyncdMutations) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{9}
}
func (x *SyncdMutations) GetMutations() []*SyncdMutation {
if x != nil {
return x.Mutations
}
return nil
}
type SyncdPatch struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version *SyncdVersion `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
Mutations []*SyncdMutation `protobuf:"bytes,2,rep,name=mutations,proto3" json:"mutations,omitempty"`
ExternalMutations *ExternalBlobReference `protobuf:"bytes,3,opt,name=externalMutations,proto3" json:"externalMutations,omitempty"`
SnapshotMAC []byte `protobuf:"bytes,4,opt,name=snapshotMAC,proto3" json:"snapshotMAC,omitempty"`
PatchMAC []byte `protobuf:"bytes,5,opt,name=patchMAC,proto3" json:"patchMAC,omitempty"`
KeyID *KeyId `protobuf:"bytes,6,opt,name=keyID,proto3" json:"keyID,omitempty"`
ExitCode *ExitCode `protobuf:"bytes,7,opt,name=exitCode,proto3" json:"exitCode,omitempty"`
DeviceIndex uint32 `protobuf:"varint,8,opt,name=deviceIndex,proto3" json:"deviceIndex,omitempty"`
ClientDebugData []byte `protobuf:"bytes,9,opt,name=clientDebugData,proto3" json:"clientDebugData,omitempty"`
}
func (x *SyncdPatch) Reset() {
*x = SyncdPatch{}
if protoimpl.UnsafeEnabled {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncdPatch) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncdPatch) ProtoMessage() {}
func (x *SyncdPatch) ProtoReflect() protoreflect.Message {
mi := &file_waServerSync_WAServerSync_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncdPatch.ProtoReflect.Descriptor instead.
func (*SyncdPatch) Descriptor() ([]byte, []int) {
return file_waServerSync_WAServerSync_proto_rawDescGZIP(), []int{10}
}
func (x *SyncdPatch) GetVersion() *SyncdVersion {
if x != nil {
return x.Version
}
return nil
}
func (x *SyncdPatch) GetMutations() []*SyncdMutation {
if x != nil {
return x.Mutations
}
return nil
}
func (x *SyncdPatch) GetExternalMutations() *ExternalBlobReference {
if x != nil {
return x.ExternalMutations
}
return nil
}
func (x *SyncdPatch) GetSnapshotMAC() []byte {
if x != nil {
return x.SnapshotMAC
}
return nil
}
func (x *SyncdPatch) GetPatchMAC() []byte {
if x != nil {
return x.PatchMAC
}
return nil
}
func (x *SyncdPatch) GetKeyID() *KeyId {
if x != nil {
return x.KeyID
}
return nil
}
func (x *SyncdPatch) GetExitCode() *ExitCode {
if x != nil {
return x.ExitCode
}
return nil
}
func (x *SyncdPatch) GetDeviceIndex() uint32 {
if x != nil {
return x.DeviceIndex
}
return 0
}
func (x *SyncdPatch) GetClientDebugData() []byte {
if x != nil {
return x.ClientDebugData
}
return nil
}
var File_waServerSync_WAServerSync_proto protoreflect.FileDescriptor
//go:embed WAServerSync.pb.raw
var file_waServerSync_WAServerSync_proto_rawDesc []byte
var (
file_waServerSync_WAServerSync_proto_rawDescOnce sync.Once
file_waServerSync_WAServerSync_proto_rawDescData = file_waServerSync_WAServerSync_proto_rawDesc
)
func file_waServerSync_WAServerSync_proto_rawDescGZIP() []byte {
file_waServerSync_WAServerSync_proto_rawDescOnce.Do(func() {
file_waServerSync_WAServerSync_proto_rawDescData = protoimpl.X.CompressGZIP(file_waServerSync_WAServerSync_proto_rawDescData)
})
return file_waServerSync_WAServerSync_proto_rawDescData
}
var file_waServerSync_WAServerSync_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_waServerSync_WAServerSync_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_waServerSync_WAServerSync_proto_goTypes = []interface{}{
(SyncdMutation_SyncdOperation)(0), // 0: WAServerSync.SyncdMutation.SyncdOperation
(*SyncdMutation)(nil), // 1: WAServerSync.SyncdMutation
(*SyncdVersion)(nil), // 2: WAServerSync.SyncdVersion
(*ExitCode)(nil), // 3: WAServerSync.ExitCode
(*SyncdIndex)(nil), // 4: WAServerSync.SyncdIndex
(*SyncdValue)(nil), // 5: WAServerSync.SyncdValue
(*KeyId)(nil), // 6: WAServerSync.KeyId
(*SyncdRecord)(nil), // 7: WAServerSync.SyncdRecord
(*ExternalBlobReference)(nil), // 8: WAServerSync.ExternalBlobReference
(*SyncdSnapshot)(nil), // 9: WAServerSync.SyncdSnapshot
(*SyncdMutations)(nil), // 10: WAServerSync.SyncdMutations
(*SyncdPatch)(nil), // 11: WAServerSync.SyncdPatch
}
var file_waServerSync_WAServerSync_proto_depIdxs = []int32{
0, // 0: WAServerSync.SyncdMutation.operation:type_name -> WAServerSync.SyncdMutation.SyncdOperation
7, // 1: WAServerSync.SyncdMutation.record:type_name -> WAServerSync.SyncdRecord
4, // 2: WAServerSync.SyncdRecord.index:type_name -> WAServerSync.SyncdIndex
5, // 3: WAServerSync.SyncdRecord.value:type_name -> WAServerSync.SyncdValue
6, // 4: WAServerSync.SyncdRecord.keyID:type_name -> WAServerSync.KeyId
2, // 5: WAServerSync.SyncdSnapshot.version:type_name -> WAServerSync.SyncdVersion
7, // 6: WAServerSync.SyncdSnapshot.records:type_name -> WAServerSync.SyncdRecord
6, // 7: WAServerSync.SyncdSnapshot.keyID:type_name -> WAServerSync.KeyId
1, // 8: WAServerSync.SyncdMutations.mutations:type_name -> WAServerSync.SyncdMutation
2, // 9: WAServerSync.SyncdPatch.version:type_name -> WAServerSync.SyncdVersion
1, // 10: WAServerSync.SyncdPatch.mutations:type_name -> WAServerSync.SyncdMutation
8, // 11: WAServerSync.SyncdPatch.externalMutations:type_name -> WAServerSync.ExternalBlobReference
6, // 12: WAServerSync.SyncdPatch.keyID:type_name -> WAServerSync.KeyId
3, // 13: WAServerSync.SyncdPatch.exitCode:type_name -> WAServerSync.ExitCode
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_waServerSync_WAServerSync_proto_init() }
func file_waServerSync_WAServerSync_proto_init() {
if File_waServerSync_WAServerSync_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_waServerSync_WAServerSync_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdMutation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdVersion); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExitCode); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdIndex); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdValue); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeyId); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdRecord); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExternalBlobReference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdSnapshot); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdMutations); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_waServerSync_WAServerSync_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncdPatch); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_waServerSync_WAServerSync_proto_rawDesc,
NumEnums: 1,
NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_waServerSync_WAServerSync_proto_goTypes,
DependencyIndexes: file_waServerSync_WAServerSync_proto_depIdxs,
EnumInfos: file_waServerSync_WAServerSync_proto_enumTypes,
MessageInfos: file_waServerSync_WAServerSync_proto_msgTypes,
}.Build()
File_waServerSync_WAServerSync_proto = out.File
file_waServerSync_WAServerSync_proto_rawDesc = nil
file_waServerSync_WAServerSync_proto_goTypes = nil
file_waServerSync_WAServerSync_proto_depIdxs = nil
}

@ -0,0 +1,72 @@
syntax = "proto3";
package WAServerSync;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waServerSync";
message SyncdMutation {
enum SyncdOperation {
SET = 0;
REMOVE = 1;
}
SyncdOperation operation = 1;
SyncdRecord record = 2;
}
message SyncdVersion {
uint64 version = 1;
}
message ExitCode {
uint64 code = 1;
string text = 2;
}
message SyncdIndex {
bytes blob = 1;
}
message SyncdValue {
bytes blob = 1;
}
message KeyId {
bytes ID = 1;
}
message SyncdRecord {
SyncdIndex index = 1;
SyncdValue value = 2;
KeyId keyID = 3;
}
message ExternalBlobReference {
bytes mediaKey = 1;
string directPath = 2;
string handle = 3;
uint64 fileSizeBytes = 4;
bytes fileSHA256 = 5;
bytes fileEncSHA256 = 6;
}
message SyncdSnapshot {
SyncdVersion version = 1;
repeated SyncdRecord records = 2;
bytes mac = 3;
KeyId keyID = 4;
}
message SyncdMutations {
repeated SyncdMutation mutations = 1;
}
message SyncdPatch {
SyncdVersion version = 1;
repeated SyncdMutation mutations = 2;
ExternalBlobReference externalMutations = 3;
bytes snapshotMAC = 4;
bytes patchMAC = 5;
KeyId keyID = 6;
ExitCode exitCode = 7;
uint32 deviceIndex = 8;
bytes clientDebugData = 9;
}

@ -0,0 +1,375 @@
syntax = "proto3";
package WASyncAction;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waSyncAction";
import "waCommon/WACommon.proto";
message CallLogRecord {
enum CallType {
REGULAR = 0;
SCHEDULED_CALL = 1;
VOICE_CHAT = 2;
}
enum SilenceReason {
NONE = 0;
SCHEDULED = 1;
PRIVACY = 2;
LIGHTWEIGHT = 3;
}
enum CallResult {
CONNECTED = 0;
REJECTED = 1;
CANCELLED = 2;
ACCEPTEDELSEWHERE = 3;
MISSED = 4;
INVALID = 5;
UNAVAILABLE = 6;
UPCOMING = 7;
FAILED = 8;
ABANDONED = 9;
ONGOING = 10;
}
message ParticipantInfo {
string userJID = 1;
CallResult callResult = 2;
}
CallResult callResult = 1;
bool isDndMode = 2;
SilenceReason silenceReason = 3;
int64 duration = 4;
int64 startTime = 5;
bool isIncoming = 6;
bool isVideo = 7;
bool isCallLink = 8;
string callLinkToken = 9;
string scheduledCallID = 10;
string callID = 11;
string callCreatorJID = 12;
string groupJID = 13;
repeated ParticipantInfo participants = 14;
CallType callType = 15;
}
message SyncActionValue {
message StatusPrivacyAction {
enum StatusDistributionMode {
ALLOW_LIST = 0;
DENY_LIST = 1;
CONTACTS = 2;
}
StatusDistributionMode mode = 1;
repeated string userJID = 2;
}
message MarketingMessageAction {
enum MarketingMessagePrototypeType {
PERSONALIZED = 0;
}
string name = 1;
string message = 2;
MarketingMessagePrototypeType type = 3;
int64 createdAt = 4;
int64 lastSentAt = 5;
bool isDeleted = 6;
string mediaID = 7;
}
message CustomPaymentMethodsAction {
repeated CustomPaymentMethod customPaymentMethods = 1;
}
message CustomPaymentMethod {
string credentialID = 1;
string country = 2;
string type = 3;
repeated CustomPaymentMethodMetadata metadata = 4;
}
message CustomPaymentMethodMetadata {
string key = 1;
string value = 2;
}
message PaymentInfoAction {
string cpi = 1;
}
message LabelReorderingAction {
repeated int32 sortedLabelIDs = 1;
}
message DeleteIndividualCallLogAction {
string peerJID = 1;
bool isIncoming = 2;
}
message BotWelcomeRequestAction {
bool isSent = 1;
}
message CallLogAction {
CallLogRecord callLogRecord = 1;
}
message PrivacySettingRelayAllCalls {
bool isEnabled = 1;
}
message ExternalWebBetaAction {
bool isOptIn = 1;
}
message MarketingMessageBroadcastAction {
int32 repliedCount = 1;
}
message PnForLidChatAction {
string pnJID = 1;
}
message ChatAssignmentOpenedStatusAction {
bool chatOpened = 1;
}
message ChatAssignmentAction {
string deviceAgentID = 1;
}
message StickerAction {
string URL = 1;
bytes fileEncSHA256 = 2;
bytes mediaKey = 3;
string mimetype = 4;
uint32 height = 5;
uint32 width = 6;
string directPath = 7;
uint64 fileLength = 8;
bool isFavorite = 9;
uint32 deviceIDHint = 10;
}
message RemoveRecentStickerAction {
int64 lastStickerSentTS = 1;
}
message PrimaryVersionAction {
string version = 1;
}
message NuxAction {
bool acknowledged = 1;
}
message TimeFormatAction {
bool isTwentyFourHourFormatEnabled = 1;
}
message UserStatusMuteAction {
bool muted = 1;
}
message SubscriptionAction {
bool isDeactivated = 1;
bool isAutoRenewing = 2;
int64 expirationDate = 3;
}
message AgentAction {
string name = 1;
int32 deviceID = 2;
bool isDeleted = 3;
}
message AndroidUnsupportedActions {
bool allowed = 1;
}
message PrimaryFeature {
repeated string flags = 1;
}
message KeyExpiration {
int32 expiredKeyEpoch = 1;
}
message SyncActionMessage {
WACommon.MessageKey key = 1;
int64 timestamp = 2;
}
message SyncActionMessageRange {
int64 lastMessageTimestamp = 1;
int64 lastSystemMessageTimestamp = 2;
repeated SyncActionMessage messages = 3;
}
message UnarchiveChatsSetting {
bool unarchiveChats = 1;
}
message DeleteChatAction {
SyncActionMessageRange messageRange = 1;
}
message ClearChatAction {
SyncActionMessageRange messageRange = 1;
}
message MarkChatAsReadAction {
bool read = 1;
SyncActionMessageRange messageRange = 2;
}
message DeleteMessageForMeAction {
bool deleteMedia = 1;
int64 messageTimestamp = 2;
}
message ArchiveChatAction {
bool archived = 1;
SyncActionMessageRange messageRange = 2;
}
message RecentEmojiWeightsAction {
repeated RecentEmojiWeight weights = 1;
}
message LabelEditAction {
string name = 1;
int32 color = 2;
int32 predefinedID = 3;
bool deleted = 4;
int32 orderIndex = 5;
}
message LabelAssociationAction {
bool labeled = 1;
}
message QuickReplyAction {
string shortcut = 1;
string message = 2;
repeated string keywords = 3;
int32 count = 4;
bool deleted = 5;
}
message LocaleSetting {
string locale = 1;
}
message PushNameSetting {
string name = 1;
}
message SecurityNotificationSetting {
bool showNotification = 1;
}
message PinAction {
bool pinned = 1;
}
message MuteAction {
bool muted = 1;
int64 muteEndTimestamp = 2;
bool autoMuted = 3;
}
message ContactAction {
string fullName = 1;
string firstName = 2;
string lidJID = 3;
bool saveOnPrimaryAddressbook = 4;
}
message StarAction {
bool starred = 1;
}
int64 timestamp = 1;
StarAction starAction = 2;
ContactAction contactAction = 3;
MuteAction muteAction = 4;
PinAction pinAction = 5;
SecurityNotificationSetting securityNotificationSetting = 6;
PushNameSetting pushNameSetting = 7;
QuickReplyAction quickReplyAction = 8;
RecentEmojiWeightsAction recentEmojiWeightsAction = 11;
LabelEditAction labelEditAction = 14;
LabelAssociationAction labelAssociationAction = 15;
LocaleSetting localeSetting = 16;
ArchiveChatAction archiveChatAction = 17;
DeleteMessageForMeAction deleteMessageForMeAction = 18;
KeyExpiration keyExpiration = 19;
MarkChatAsReadAction markChatAsReadAction = 20;
ClearChatAction clearChatAction = 21;
DeleteChatAction deleteChatAction = 22;
UnarchiveChatsSetting unarchiveChatsSetting = 23;
PrimaryFeature primaryFeature = 24;
AndroidUnsupportedActions androidUnsupportedActions = 26;
AgentAction agentAction = 27;
SubscriptionAction subscriptionAction = 28;
UserStatusMuteAction userStatusMuteAction = 29;
TimeFormatAction timeFormatAction = 30;
NuxAction nuxAction = 31;
PrimaryVersionAction primaryVersionAction = 32;
StickerAction stickerAction = 33;
RemoveRecentStickerAction removeRecentStickerAction = 34;
ChatAssignmentAction chatAssignment = 35;
ChatAssignmentOpenedStatusAction chatAssignmentOpenedStatus = 36;
PnForLidChatAction pnForLidChatAction = 37;
MarketingMessageAction marketingMessageAction = 38;
MarketingMessageBroadcastAction marketingMessageBroadcastAction = 39;
ExternalWebBetaAction externalWebBetaAction = 40;
PrivacySettingRelayAllCalls privacySettingRelayAllCalls = 41;
CallLogAction callLogAction = 42;
StatusPrivacyAction statusPrivacy = 44;
BotWelcomeRequestAction botWelcomeRequestAction = 45;
DeleteIndividualCallLogAction deleteIndividualCallLog = 46;
LabelReorderingAction labelReorderingAction = 47;
PaymentInfoAction paymentInfoAction = 48;
CustomPaymentMethodsAction customPaymentMethodsAction = 49;
}
message PatchDebugData {
enum Platform {
ANDROID = 0;
SMBA = 1;
IPHONE = 2;
SMBI = 3;
WEB = 4;
UWP = 5;
DARWIN = 6;
}
bytes currentLthash = 1;
bytes newLthash = 2;
bytes patchVersion = 3;
bytes collectionName = 4;
bytes firstFourBytesFromAHashOfSnapshotMACKey = 5;
bytes newLthashSubtract = 6;
int32 numberAdd = 7;
int32 numberRemove = 8;
int32 numberOverride = 9;
Platform senderPlatform = 10;
bool isSenderPrimary = 11;
}
message RecentEmojiWeight {
string emoji = 1;
float weight = 2;
}
message SyncActionData {
bytes index = 1;
SyncActionValue value = 2;
bytes padding = 3;
int32 version = 4;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,227 @@
syntax = "proto3";
package WAWa5;
option go_package = "go.mau.fi/whatsmeow/binary/armadillo/waWa5";
message ClientPayload {
enum Product {
WHATSAPP = 0;
MESSENGER = 1;
}
enum ConnectType {
CELLULAR_UNKNOWN = 0;
WIFI_UNKNOWN = 1;
CELLULAR_EDGE = 100;
CELLULAR_IDEN = 101;
CELLULAR_UMTS = 102;
CELLULAR_EVDO = 103;
CELLULAR_GPRS = 104;
CELLULAR_HSDPA = 105;
CELLULAR_HSUPA = 106;
CELLULAR_HSPA = 107;
CELLULAR_CDMA = 108;
CELLULAR_1XRTT = 109;
CELLULAR_EHRPD = 110;
CELLULAR_LTE = 111;
CELLULAR_HSPAP = 112;
}
enum ConnectReason {
PUSH = 0;
USER_ACTIVATED = 1;
SCHEDULED = 2;
ERROR_RECONNECT = 3;
NETWORK_SWITCH = 4;
PING_RECONNECT = 5;
UNKNOWN = 6;
}
enum IOSAppExtension {
SHARE_EXTENSION = 0;
SERVICE_EXTENSION = 1;
INTENTS_EXTENSION = 2;
}
message DNSSource {
enum DNSResolutionMethod {
SYSTEM = 0;
GOOGLE = 1;
HARDCODED = 2;
OVERRIDE = 3;
FALLBACK = 4;
}
DNSResolutionMethod dnsMethod = 15;
bool appCached = 16;
}
message WebInfo {
enum WebSubPlatform {
WEB_BROWSER = 0;
APP_STORE = 1;
WIN_STORE = 2;
DARWIN = 3;
WIN32 = 4;
}
message WebdPayload {
bool usesParticipantInKey = 1;
bool supportsStarredMessages = 2;
bool supportsDocumentMessages = 3;
bool supportsURLMessages = 4;
bool supportsMediaRetry = 5;
bool supportsE2EImage = 6;
bool supportsE2EVideo = 7;
bool supportsE2EAudio = 8;
bool supportsE2EDocument = 9;
string documentTypes = 10;
bytes features = 11;
}
string refToken = 1;
string version = 2;
WebdPayload webdPayload = 3;
WebSubPlatform webSubPlatform = 4;
}
message UserAgent {
enum DeviceType {
PHONE = 0;
TABLET = 1;
DESKTOP = 2;
WEARABLE = 3;
VR = 4;
}
enum ReleaseChannel {
RELEASE = 0;
BETA = 1;
ALPHA = 2;
DEBUG = 3;
}
enum Platform {
ANDROID = 0;
IOS = 1;
WINDOWS_PHONE = 2;
BLACKBERRY = 3;
BLACKBERRYX = 4;
S40 = 5;
S60 = 6;
PYTHON_CLIENT = 7;
TIZEN = 8;
ENTERPRISE = 9;
SMB_ANDROID = 10;
KAIOS = 11;
SMB_IOS = 12;
WINDOWS = 13;
WEB = 14;
PORTAL = 15;
GREEN_ANDROID = 16;
GREEN_IPHONE = 17;
BLUE_ANDROID = 18;
BLUE_IPHONE = 19;
FBLITE_ANDROID = 20;
MLITE_ANDROID = 21;
IGLITE_ANDROID = 22;
PAGE = 23;
MACOS = 24;
OCULUS_MSG = 25;
OCULUS_CALL = 26;
MILAN = 27;
CAPI = 28;
WEAROS = 29;
ARDEVICE = 30;
VRDEVICE = 31;
BLUE_WEB = 32;
IPAD = 33;
TEST = 34;
SMART_GLASSES = 35;
}
message AppVersion {
uint32 primary = 1;
uint32 secondary = 2;
uint32 tertiary = 3;
uint32 quaternary = 4;
uint32 quinary = 5;
}
Platform platform = 1;
AppVersion appVersion = 2;
string mcc = 3;
string mnc = 4;
string osVersion = 5;
string manufacturer = 6;
string device = 7;
string osBuildNumber = 8;
string phoneID = 9;
ReleaseChannel releaseChannel = 10;
string localeLanguageIso6391 = 11;
string localeCountryIso31661Alpha2 = 12;
string deviceBoard = 13;
string deviceExpID = 14;
DeviceType deviceType = 15;
}
message DevicePairingRegistrationData {
bytes eRegid = 1;
bytes eKeytype = 2;
bytes eIdent = 3;
bytes eSkeyID = 4;
bytes eSkeyVal = 5;
bytes eSkeySig = 6;
bytes buildHash = 7;
bytes deviceProps = 8;
}
uint64 username = 1;
bool passive = 3;
UserAgent userAgent = 5;
WebInfo webInfo = 6;
string pushName = 7;
sfixed32 sessionID = 9;
bool shortConnect = 10;
ConnectType connectType = 12;
ConnectReason connectReason = 13;
repeated int32 shards = 14;
DNSSource dnsSource = 15;
uint32 connectAttemptCount = 16;
uint32 device = 18;
DevicePairingRegistrationData devicePairingData = 19;
Product product = 20;
bytes fbCat = 21;
bytes fbUserAgent = 22;
bool oc = 23;
int32 lc = 24;
IOSAppExtension iosAppExtension = 30;
uint64 fbAppID = 31;
bytes fbDeviceID = 32;
bool pull = 33;
bytes paddingBytes = 34;
int32 yearClass = 36;
int32 memClass = 37;
}
message HandshakeMessage {
message ClientFinish {
bytes static = 1;
bytes payload = 2;
}
message ServerHello {
bytes ephemeral = 1;
bytes static = 2;
bytes payload = 3;
}
message ClientHello {
bytes ephemeral = 1;
bytes static = 2;
bytes payload = 3;
}
ClientHello clientHello = 2;
ServerHello serverHello = 3;
ClientFinish clientFinish = 4;
}

@ -123,6 +123,16 @@ func (au *AttrUtility) GetUnixTime(key string, require bool) (time.Time, bool) {
}
}
func (au *AttrUtility) GetUnixMilli(key string, require bool) (time.Time, bool) {
if intVal, ok := au.GetInt64(key, require); !ok {
return time.Time{}, false
} else if intVal == 0 {
return time.Time{}, true
} else {
return time.UnixMilli(intVal), true
}
}
// OptionalString returns the string under the given key.
func (au *AttrUtility) OptionalString(key string) string {
strVal, _ := au.GetString(key, false)
@ -176,6 +186,16 @@ func (au *AttrUtility) UnixTime(key string) time.Time {
return val
}
func (au *AttrUtility) OptionalUnixMilli(key string) time.Time {
val, _ := au.GetUnixMilli(key, false)
return val
}
func (au *AttrUtility) UnixMilli(key string) time.Time {
val, _ := au.GetUnixMilli(key, true)
return val
}
// OK returns true if there are no errors.
func (au *AttrUtility) OK() bool {
return len(au.Errors) == 0

@ -204,6 +204,10 @@ func (r *binaryDecoder) read(string bool) (interface{}, error) {
}
return token.GetDoubleToken(tag-token.Dictionary0, i)
case token.FBJID:
return r.readFBJID()
case token.InteropJID:
return r.readInteropJID()
case token.JIDPair:
return r.readJIDPair()
case token.ADJID:
@ -234,6 +238,55 @@ func (r *binaryDecoder) readJIDPair() (interface{}, error) {
return types.NewJID(user.(string), server.(string)), nil
}
func (r *binaryDecoder) readInteropJID() (interface{}, error) {
user, err := r.read(true)
if err != nil {
return nil, err
}
device, err := r.readInt16(false)
if err != nil {
return nil, err
}
integrator, err := r.readInt16(false)
if err != nil {
return nil, err
}
server, err := r.read(true)
if err != nil {
return nil, err
} else if server != types.InteropServer {
return nil, fmt.Errorf("%w: expected %q, got %q", ErrInvalidJIDType, types.InteropServer, server)
}
return types.JID{
User: user.(string),
Device: uint16(device),
Integrator: uint16(integrator),
Server: types.InteropServer,
}, nil
}
func (r *binaryDecoder) readFBJID() (interface{}, error) {
user, err := r.read(true)
if err != nil {
return nil, err
}
device, err := r.readInt16(false)
if err != nil {
return nil, err
}
server, err := r.read(true)
if err != nil {
return nil, err
} else if server != types.MessengerServer {
return nil, fmt.Errorf("%w: expected %q, got %q", ErrInvalidJIDType, types.MessengerServer, server)
}
return types.JID{
User: user.(string),
Device: uint16(device),
Server: server.(string),
}, nil
}
func (r *binaryDecoder) readADJID() (interface{}, error) {
agent, err := r.readByte()
if err != nil {

@ -159,11 +159,22 @@ func (w *binaryEncoder) writeStringRaw(value string) {
}
func (w *binaryEncoder) writeJID(jid types.JID) {
if jid.AD {
if (jid.Server == types.DefaultUserServer && jid.Device > 0) || jid.Server == types.HiddenUserServer || jid.Server == types.HostedServer {
w.pushByte(token.ADJID)
w.pushByte(jid.Agent)
w.pushByte(jid.Device)
w.pushByte(jid.ActualAgent())
w.pushByte(uint8(jid.Device))
w.writeString(jid.User)
} else if jid.Server == types.MessengerServer {
w.pushByte(token.FBJID)
w.write(jid.User)
w.pushInt16(int(jid.Device))
w.write(jid.Server)
} else if jid.Server == types.InteropServer {
w.pushByte(token.InteropJID)
w.write(jid.User)
w.pushInt16(int(jid.Device))
w.pushInt16(int(jid.Integrator))
w.write(jid.Server)
} else {
w.pushByte(token.JIDPair)
if len(jid.User) == 0 {

@ -8,11 +8,14 @@
package binary
import (
"encoding/json"
"fmt"
"go.mau.fi/whatsmeow/types"
)
// Attrs is a type alias for the attributes of an XML element (Node).
type Attrs = map[string]interface{}
type Attrs = map[string]any
// Node represents an XML element.
type Node struct {
@ -21,6 +24,53 @@ type Node struct {
Content interface{} // The content inside the element. Can be nil, a list of Nodes, or a byte array.
}
type marshalableNode struct {
Tag string
Attrs Attrs
Content json.RawMessage
}
func (n *Node) UnmarshalJSON(data []byte) error {
var mn marshalableNode
err := json.Unmarshal(data, &mn)
if err != nil {
return err
}
for key, val := range mn.Attrs {
switch typedVal := val.(type) {
case string:
parsed, err := types.ParseJID(typedVal)
if err == nil && parsed.Server == types.DefaultUserServer || parsed.Server == types.NewsletterServer || parsed.Server == types.GroupServer || parsed.Server == types.BroadcastServer {
mn.Attrs[key] = parsed
}
case float64:
mn.Attrs[key] = int64(typedVal)
}
}
n.Tag = mn.Tag
n.Attrs = mn.Attrs
if len(mn.Content) > 0 {
if mn.Content[0] == '[' {
var nodes []Node
err = json.Unmarshal(mn.Content, &nodes)
if err != nil {
return err
}
n.Content = nodes
} else if mn.Content[0] == '"' {
var binaryContent []byte
err = json.Unmarshal(mn.Content, &binaryContent)
if err != nil {
return err
}
n.Content = binaryContent
} else {
return fmt.Errorf("node content must be an array of nodes or a base64 string")
}
}
return nil
}
// GetChildren returns the Content of the node as a list of nodes. If the content is not a list of nodes, this returns nil.
func (n *Node) GetChildren() []Node {
if n.Content == nil {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
# proto/extract
This is an updated version of the [protobuf extractor from sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng/tree/master/doc/spec/protobuf-extractor).
## Usage
1. Install dependencies with `yarn` (or `npm install`)
2. `node index.js`
3. The script will update `../def.proto` (except if something is broken)

@ -0,0 +1,349 @@
const request = require("request-promise-native")
const acorn = require("acorn")
const walk = require("acorn-walk")
const fs = require("fs/promises")
const addPrefix = (lines, prefix) => lines.map(line => prefix + line)
async function findAppModules(mods) {
const ua = {
headers: {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
"Sec-Fetch-Dest": "script",
"Sec-Fetch-Mode": "no-cors",
"Sec-Fetch-Site": "same-origin",
"Referer": "https://web.whatsapp.com/",
"Accept": "*/*", /**/
"Accept-Language": "en-US,en;q=0.5",
}
}
const baseURL = "https://web.whatsapp.com"
const index = await request.get(baseURL, ua)
const appID = index.match(/src="\/app.([0-9a-z]{10,}).js"/)[1]
const appURL = baseURL + "/app." + appID + ".js"
console.error("Found app.js URL:", appURL)
const qrData = await request.get(appURL, ua)
const waVersion = qrData.match(/VERSION_BASE="(\d\.\d+\.\d+)"/)[1]
console.log("Current version:", waVersion)
// This one list of types is so long that it's split into two JavaScript declarations.
// The module finder below can't handle it, so just patch it manually here.
const patchedQrData = qrData.replace("t.ActionLinkSpec=void 0,t.TemplateButtonSpec", "t.ActionLinkSpec=t.TemplateButtonSpec")
//const patchedQrData = qrData.replace("Spec=void 0,t.", "Spec=t.")
const qrModules = acorn.parse(patchedQrData).body[0].expression.arguments[0].elements[1].properties
return qrModules.filter(m => mods.includes(m.key.value))
}
(async () => {
// The module IDs that contain protobuf types
const wantedModules = [
962559, // ADVSignedKeyIndexList, ADVSignedDeviceIdentity, ADVSignedDeviceIdentityHMAC, ADVKeyIndexList, ADVDeviceIdentity
113259, // DeviceProps
533494, // Message, ..., RequestPaymentMessage, Reaction, QuickReplyButton, ..., ButtonsResponseMessage, ActionLink, ...
199931, // EphemeralSetting
60370, // WallpaperSettings, Pushname, MediaVisibility, HistorySync, ..., GroupParticipant, ...
//412744, // PollEncValue, MsgOpaqueData, MsgRowOpaqueData
229479, // ServerErrorReceipt, MediaRetryNotification, MediaRetryNotificationResult
933734, // MessageKey
557871, // Duplicate of MessageKey
679905, // SyncdVersion, SyncdValue, ..., SyncdPatch, SyncdMutation, ..., ExitCode
623420, // SyncActionValue, ..., UnarchiveChatsSetting, SyncActionData, StarAction, ...
//527796, // Duplicate of 623420, but without CallLogRecord
759089, // VerifiedNameCertificate, LocalizedName, ..., BizIdentityInfo, BizAccountLinkInfo, ...
614806, // HandshakeMessage, ..., ClientPayload, ..., AppVersion, UserAgent, WebdPayload ...
968923, // Reaction, UserReceipt, ..., PhotoChange, ..., WebFeatures, ..., WebMessageInfoStatus, ...
623641, // NoiseCertificate, CertChain
//867311, // ChatRowOpaqueData, ...
//2336, // SignalMessage, ...
//984661, // SessionStructure, ...
853721, // QP
//281698, // Duplicate of ChatLockSettings
913628, // ChatLockSettings
//144132, // Duplicate of DeviceCapabilities
988521, // DeviceCapabilities
//691721, // Duplicate of UserPassword
700584, // UserPassword
]
const unspecName = name => name.endsWith("Spec") ? name.slice(0, -4) : name
const unnestName = name => name
.replace("Message$", "").replace("SyncActionValue$", "") // Don't nest messages into Message, that's too much nesting
.replace("ContextInfo$ForwardedNewsletterMessageInfo", "ForwardedNewsletterMessageInfo") // Hack to unnest name used outside ContextInfo
const rename = name => unnestName(unspecName(name))
// The constructor IDs that can be used for enum types
const enumConstructorIDs = [76672, 654302]
const unsortedModules = await findAppModules(wantedModules)
if (unsortedModules.length !== wantedModules.length) {
console.error("did not find all wanted modules")
return
}
// Sort modules so that whatsapp module id changes don't change the order in the output protobuf schema
const modules = []
for (const mod of wantedModules) {
modules.push(unsortedModules.find(node => node.key.value === mod))
}
// find aliases of cross references between the wanted modules
let modulesInfo = {}
modules.forEach(({key, value}) => {
const requiringParam = value.params[2].name
modulesInfo[key.value] = {crossRefs: []}
walk.simple(value, {
VariableDeclarator(node) {
if (node.init && node.init.type === "CallExpression" && node.init.callee.name === requiringParam && node.init.arguments.length === 1 && wantedModules.indexOf(node.init.arguments[0].value) !== -1) {
modulesInfo[key.value].crossRefs.push({alias: node.id.name, module: node.init.arguments[0].value})
}
}
})
})
// find all identifiers and, for enums, their array of values
for (const mod of modules) {
const modInfo = modulesInfo[mod.key.value]
// all identifiers will be initialized to "void 0" (i.e. "undefined") at the start, so capture them here
walk.ancestor(mod, {
UnaryExpression(node, anc) {
if (!modInfo.identifiers && node.operator === "void") {
const assignments = []
let i = 1
anc.reverse()
while (anc[i].type === "AssignmentExpression") {
assignments.push(anc[i++].left)
}
const makeBlankIdent = a => {
const key = rename(a.property.name)
const value = {name: key}
return [key, value]
}
modInfo.identifiers = Object.fromEntries(assignments.map(makeBlankIdent).reverse())
}
}
})
const enumAliases = {}
// enums are defined directly, and both enums and messages get a one-letter alias
walk.simple(mod, {
AssignmentExpression(node) {
if (node.left.type === "MemberExpression" && modInfo.identifiers[rename(node.left.property.name)]) {
const ident = modInfo.identifiers[rename(node.left.property.name)]
ident.alias = node.right.name
ident.enumValues = enumAliases[ident.alias]
}
},
VariableDeclarator(node) {
if (node.init && node.init.type === "CallExpression" && enumConstructorIDs.includes(node.init.callee?.arguments?.[0]?.value) && node.init.arguments.length === 1 && node.init.arguments[0].type === "ObjectExpression") {
enumAliases[node.id.name] = node.init.arguments[0].properties.map(p => ({
name: p.key.name,
id: p.value.value
}))
}
}
})
}
// find the contents for all protobuf messages
for (const mod of modules) {
const modInfo = modulesInfo[mod.key.value]
// message specifications are stored in a "internalSpec" attribute of the respective identifier alias
walk.simple(mod, {
AssignmentExpression(node) {
if (node.left.type === "MemberExpression" && node.left.property.name === "internalSpec" && node.right.type === "ObjectExpression") {
const targetIdent = Object.values(modInfo.identifiers).find(v => v.alias === node.left.object.name)
if (!targetIdent) {
console.warn(`found message specification for unknown identifier alias: ${node.left.object.name}`)
return
}
// partition spec properties by normal members and constraints (like "__oneofs__") which will be processed afterwards
const constraints = []
let members = []
for (const p of node.right.properties) {
p.key.name = p.key.type === "Identifier" ? p.key.name : p.key.value
;(p.key.name.substr(0, 2) === "__" ? constraints : members).push(p)
}
members = members.map(({key: {name}, value: {elements}}) => {
let type
const flags = []
const unwrapBinaryOr = n => (n.type === "BinaryExpression" && n.operator === "|") ? [].concat(unwrapBinaryOr(n.left), unwrapBinaryOr(n.right)) : [n]
// find type and flags
unwrapBinaryOr(elements[1]).forEach(m => {
if (m.type === "MemberExpression" && m.object.type === "MemberExpression") {
if (m.object.property.name === "TYPES")
type = m.property.name.toLowerCase()
else if (m.object.property.name === "FLAGS")
flags.push(m.property.name.toLowerCase())
}
})
// determine cross reference name from alias if this member has type "message" or "enum"
if (type === "message" || type === "enum") {
const currLoc = ` from member '${name}' of message '${targetIdent.name}'`
if (elements[2].type === "Identifier") {
type = Object.values(modInfo.identifiers).find(v => v.alias === elements[2].name)?.name
if (!type) {
console.warn(`unable to find reference of alias '${elements[2].name}'` + currLoc)
}
} else if (elements[2].type === "MemberExpression") {
const crossRef = modInfo.crossRefs.find(r => r.alias === elements[2].object.name)
if (crossRef && modulesInfo[crossRef.module].identifiers[rename(elements[2].property.name)]) {
type = rename(elements[2].property.name)
} else {
console.warn(`unable to find reference of alias to other module '${elements[2].object.name}' or to message ${elements[2].property.name} of this module` + currLoc)
}
}
}
return {name, id: elements[0].value, type, flags}
})
// resolve constraints for members
constraints.forEach(c => {
if (c.key.name === "__oneofs__" && c.value.type === "ObjectExpression") {
const newOneOfs = c.value.properties.map(p => ({
name: p.key.name,
type: "__oneof__",
members: p.value.elements.map(e => {
const idx = members.findIndex(m => m.name === e.value)
const member = members[idx]
members.splice(idx, 1)
return member
})
}))
members.push(...newOneOfs)
}
})
targetIdent.members = members
targetIdent.children = []
}
}
})
}
const findNested = (items, path) => {
if (path.length === 0) {
return items
}
const item = items.find(v => (v.unnestedName ?? v.name) === path[0])
if (path.length === 1) {
return item
}
return findNested(item.children, path.slice(1))
}
for (const mod of modules) {
let hasMore = true
let loops = 0
const idents = modulesInfo[mod.key.value].identifiers
while (hasMore && loops < 5) {
hasMore = false
loops++
for (const ident of Object.values(idents)) {
if (!ident.name.includes("$")) {
continue
}
const parts = ident.name.split("$")
const parent = findNested(Object.values(idents), parts.slice(0, -1))
if (!parent) {
hasMore = true
continue
}
parent.children.push(ident)
delete idents[ident.name]
ident.unnestedName = parts[parts.length-1]
}
}
}
const addedMessages = new Set()
let decodedProto = [
'syntax = "proto2";',
"package proto;",
""
]
const sharesParent = (path1, path2) => {
for (let i = 0; i < path1.length - 1 && i < path2.length - 1; i++) {
if (path1[i] != path2[i]) {
return false
}
}
return true
}
const spaceIndent = " ".repeat(4)
for (const mod of modules) {
const modInfo = modulesInfo[mod.key.value]
// enum stringifying function
const stringifyEnum = (ident, overrideName = null) =>
[].concat(
[`enum ${overrideName ?? ident.unnestedName ?? ident.name} {`],
addPrefix(ident.enumValues.map(v => `${v.name} = ${v.id};`), spaceIndent),
["}"]
)
// message specification member stringifying function
const stringifyMessageSpecMember = (info, path, completeFlags = true) => {
if (info.type === "__oneof__") {
return [].concat(
[`oneof ${info.name} {`],
addPrefix([].concat(...info.members.map(m => stringifyMessageSpecMember(m, path, false))), spaceIndent),
["}"]
)
} else {
if (info.flags.includes("packed")) {
info.flags.splice(info.flags.indexOf("packed"))
info.packed = " [packed=true]"
}
if (completeFlags && info.flags.length === 0) {
info.flags.push("optional")
}
const ret = info.enumValues ? stringifyEnum(info, info.type) : []
const typeParts = info.type.split("$")
let unnestedType = typeParts[typeParts.length-1]
if (!sharesParent(typeParts, path.split("$"))) {
unnestedType = typeParts.join(".")
}
ret.push(`${info.flags.join(" ") + (info.flags.length === 0 ? "" : " ")}${unnestedType} ${info.name} = ${info.id}${info.packed || ""};`)
return ret
}
}
// message specification stringifying function
const stringifyMessageSpec = (ident) => {
let result = []
result.push(
`message ${ident.unnestedName ?? ident.name} {`,
...addPrefix([].concat(...ident.children.map(m => stringifyEntity(m))), spaceIndent),
...addPrefix([].concat(...ident.members.map(m => stringifyMessageSpecMember(m, ident.name))), spaceIndent),
"}",
)
if (addedMessages.has(ident.name)) {
result = addPrefix(result, "//")
result.unshift("// Duplicate type omitted")
} else {
addedMessages.add(ident.name)
}
result.push("")
return result
}
const stringifyEntity = v => {
if (v.members) {
return stringifyMessageSpec(v)
} else if (v.enumValues) {
return stringifyEnum(v)
} else {
console.error(v)
return "// Unknown entity"
}
}
decodedProto = decodedProto.concat(...Object.values(modInfo.identifiers).map(stringifyEntity))
}
const decodedProtoStr = decodedProto.join("\n") + "\n"
await fs.writeFile("../def.proto", decodedProtoStr)
console.log("Extracted protobuf schema to ../def.proto")
})()

@ -0,0 +1,18 @@
{
"name": "whatsapp-web-protobuf-extractor",
"version": "1.0.0",
"description": "A utility program for extracting the protobuf definitions of WhatsApp Web.",
"main": "index.js",
"scripts": {
"test": "node index.js"
},
"author": "sigalor",
"license": "ISC",
"dependencies": {
"acorn": "^6.4.1",
"acorn-walk": "^6.1.1",
"request": "^2.88.0",
"request-promise-core": "^1.1.2",
"request-promise-native": "^1.0.7"
}
}

@ -0,0 +1,357 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
acorn-walk@^6.1.1:
version "6.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c"
integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==
acorn@^6.4.1:
version "6.4.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6"
integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==
ajv@^6.12.3:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
dependencies:
fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
asn1@~0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
dependencies:
safer-buffer "~2.1.0"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
aws4@^1.8.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
dependencies:
tweetnacl "^0.14.3"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"
core-util-is@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
dependencies:
assert-plus "^1.0.0"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
ecc-jsbn@~0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
dependencies:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
extend@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
fast-deep-equal@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-json-stable-stringify@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
dependencies:
assert-plus "^1.0.0"
har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
har-validator@~5.1.3:
version "5.1.5"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd"
integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==
dependencies:
ajv "^6.12.3"
har-schema "^2.0.0"
http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
dependencies:
assert-plus "^1.0.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
dependencies:
assert-plus "1.0.0"
extsprintf "1.3.0"
json-schema "0.2.3"
verror "1.10.0"
lodash@^4.17.19:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
mime-db@1.50.0:
version "1.50.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f"
integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==
mime-types@^2.1.12, mime-types@~2.1.19:
version "2.1.33"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb"
integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==
dependencies:
mime-db "1.50.0"
oauth-sign@~0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
psl@^1.1.28:
version "1.8.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==
punycode@^2.1.0, punycode@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
qs@~6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
request-promise-core@1.1.4, request-promise-core@^1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f"
integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==
dependencies:
lodash "^4.17.19"
request-promise-native@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28"
integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==
dependencies:
request-promise-core "1.1.4"
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"
request@^2.88.0:
version "2.88.2"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
caseless "~0.12.0"
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
har-validator "~5.1.3"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
oauth-sign "~0.9.0"
performance-now "^2.1.0"
qs "~6.5.2"
safe-buffer "^5.1.2"
tough-cookie "~2.5.0"
tunnel-agent "^0.6.0"
uuid "^3.3.2"
safe-buffer@^5.0.1, safe-buffer@^5.1.2:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sshpk@^1.7.0:
version "1.16.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
bcrypt-pbkdf "^1.0.0"
dashdash "^1.12.0"
ecc-jsbn "~0.1.1"
getpass "^0.1.1"
jsbn "~0.1.0"
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"
stealthy-require@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
tough-cookie@^2.3.3, tough-cookie@~2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
dependencies:
psl "^1.1.28"
punycode "^2.1.1"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
dependencies:
safe-buffer "^5.0.1"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
dependencies:
punycode "^2.1.0"
uuid@^3.3.2:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
dependencies:
assert-plus "^1.0.0"
core-util-is "1.0.2"
extsprintf "^1.2.0"

File diff suppressed because one or more lines are too long

@ -59,6 +59,24 @@ func (cli *Client) handleCallEvent(node *waBinary.Node) {
},
Data: &child,
})
case "preaccept":
cli.dispatchEvent(&events.CallPreAccept{
BasicCallMeta: basicMeta,
CallRemoteMeta: types.CallRemoteMeta{
RemotePlatform: ag.String("platform"),
RemoteVersion: ag.String("version"),
},
Data: &child,
})
case "transport":
cli.dispatchEvent(&events.CallTransport{
BasicCallMeta: basicMeta,
CallRemoteMeta: types.CallRemoteMeta{
RemotePlatform: ag.String("platform"),
RemoteVersion: ag.String("version"),
},
Data: &child,
})
case "terminate":
cli.dispatchEvent(&events.CallTerminate{
BasicCallMeta: basicMeta,

@ -19,6 +19,10 @@ import (
"sync/atomic"
"time"
"github.com/gorilla/websocket"
"go.mau.fi/util/random"
"golang.org/x/net/proxy"
"go.mau.fi/whatsmeow/appstate"
waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
@ -28,7 +32,6 @@ import (
"go.mau.fi/whatsmeow/types/events"
"go.mau.fi/whatsmeow/util/keys"
waLog "go.mau.fi/whatsmeow/util/log"
"go.mau.fi/whatsmeow/util/randbytes"
)
// EventHandler is a function that can handle events from WhatsApp.
@ -42,6 +45,11 @@ type wrappedEventHandler struct {
id uint32
}
type deviceCache struct {
devices []types.JID
dhash string
}
// Client contains everything necessary to connect to and interact with the WhatsApp web API.
type Client struct {
Store *store.Device
@ -53,13 +61,16 @@ type Client struct {
socketLock sync.RWMutex
socketWait chan struct{}
isLoggedIn uint32
expectedDisconnectVal uint32
isLoggedIn atomic.Bool
expectedDisconnect atomic.Bool
EnableAutoReconnect bool
LastSuccessfulConnect time.Time
AutoReconnectErrors int
// AutoReconnectHook is called when auto-reconnection fails. If the function returns false,
// the client will not attempt to reconnect. The number of retries can be read from AutoReconnectErrors.
AutoReconnectHook func(error) bool
sendActiveReceipts uint32
sendActiveReceipts atomic.Uint32
// EmitAppStateEventsOnFullSync can be set to true if you want to get app state events emitted
// even when re-syncing the whole state.
@ -73,7 +84,7 @@ type Client struct {
appStateSyncLock sync.Mutex
historySyncNotifications chan *waProto.HistorySyncNotification
historySyncHandlerStarted uint32
historySyncHandlerStarted atomic.Bool
uploadPreKeysLock sync.Mutex
lastPreKeyUpload time.Time
@ -92,6 +103,9 @@ type Client struct {
messageRetries map[string]int
messageRetriesLock sync.Mutex
incomingRetryRequestCounter map[incomingRetryKey]int
incomingRetryRequestCounterLock sync.Mutex
appStateKeyRequests map[string]time.Time
appStateKeyRequestsLock sync.RWMutex
@ -101,10 +115,10 @@ type Client struct {
groupParticipantsCache map[types.JID][]types.JID
groupParticipantsCacheLock sync.Mutex
userDevicesCache map[types.JID][]types.JID
userDevicesCache map[types.JID]deviceCache
userDevicesCacheLock sync.Mutex
recentMessagesMap map[recentMessageKey]*waProto.Message
recentMessagesMap map[recentMessageKey]RecentMessage
recentMessagesList [recentMessagesSize]recentMessageKey
recentMessagesPtr int
recentMessagesLock sync.RWMutex
@ -122,6 +136,10 @@ type Client struct {
// the client will disconnect.
PrePairCallback func(jid types.JID, platform, businessName string) bool
// GetClientPayload is called to get the client payload for connecting to the server.
// This should NOT be used for WhatsApp (to change the OS name, update fields in store.BaseClientPayload directly).
GetClientPayload func() *waProto.ClientPayload
// Should untrusted identity errors be handled automatically? If true, the stored identity and existing signal
// sessions will be removed on untrusted identity errors, and an events.IdentityChange will be dispatched.
// If false, decrypting a message from untrusted devices will fail.
@ -137,10 +155,25 @@ type Client struct {
phoneLinkingCache *phoneLinkingCache
uniqueID string
idCounter uint32
idCounter atomic.Uint64
proxy Proxy
socksProxy proxy.Dialer
proxyOnlyLogin bool
http *http.Client
// This field changes the client to act like a Messenger client instead of a WhatsApp one.
//
// Note that you cannot use a Messenger account just by setting this field, you must use a
// separate library for all the non-e2ee-related stuff like logging in.
// The library is currently embedded in mautrix-meta (https://github.com/mautrix/meta), but may be separated later.
MessengerConfig *MessengerConfig
RefreshCAT func() error
}
proxy socket.Proxy
http *http.Client
type MessengerConfig struct {
UserAgent string
BaseURL string
}
// Size of buffer for the channel that all incoming XML nodes go through.
@ -167,7 +200,7 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client {
if log == nil {
log = waLog.Noop
}
uniqueIDPrefix := randbytes.Make(2)
uniqueIDPrefix := random.Bytes(2)
cli := &Client{
http: &http.Client{
Transport: (http.DefaultTransport.(*http.Transport)).Clone(),
@ -185,12 +218,14 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client {
appStateProc: appstate.NewProcessor(deviceStore, log.Sub("AppState")),
socketWait: make(chan struct{}),
incomingRetryRequestCounter: make(map[incomingRetryKey]int),
historySyncNotifications: make(chan *waProto.HistorySyncNotification, 32),
groupParticipantsCache: make(map[types.JID][]types.JID),
userDevicesCache: make(map[types.JID][]types.JID),
userDevicesCache: make(map[types.JID]deviceCache),
recentMessagesMap: make(map[recentMessageKey]*waProto.Message, recentMessagesSize),
recentMessagesMap: make(map[recentMessageKey]RecentMessage, recentMessagesSize),
sessionRecreateHistory: make(map[types.JID]time.Time),
GetMessageForRetry: func(requester, to types.JID, id types.MessageID) *waProto.Message { return nil },
appStateKeyRequests: make(map[string]time.Time),
@ -218,19 +253,35 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client {
return cli
}
// SetProxyAddress is a helper method that parses a URL string and calls SetProxy.
// SetProxyAddress is a helper method that parses a URL string and calls SetProxy or SetSOCKSProxy based on the URL scheme.
//
// Returns an error if url.Parse fails to parse the given address.
func (cli *Client) SetProxyAddress(addr string) error {
func (cli *Client) SetProxyAddress(addr string, opts ...SetProxyOptions) error {
if addr == "" {
cli.SetProxy(nil, opts...)
return nil
}
parsed, err := url.Parse(addr)
if err != nil {
return err
}
cli.SetProxy(http.ProxyURL(parsed))
if parsed.Scheme == "http" || parsed.Scheme == "https" {
cli.SetProxy(http.ProxyURL(parsed), opts...)
} else if parsed.Scheme == "socks5" {
px, err := proxy.FromURL(parsed, proxy.Direct)
if err != nil {
return err
}
cli.SetSOCKSProxy(px, opts...)
} else {
return fmt.Errorf("unsupported proxy scheme %q", parsed.Scheme)
}
return nil
}
// SetProxy sets the proxy to use for WhatsApp web websocket connections and media uploads/downloads.
type Proxy = func(*http.Request) (*url.URL, error)
// SetProxy sets a HTTP proxy to use for WhatsApp web websocket connections and media uploads/downloads.
//
// Must be called before Connect() to take effect in the websocket connection.
// If you want to change the proxy after connecting, you must call Disconnect() and then Connect() again manually.
@ -250,9 +301,59 @@ func (cli *Client) SetProxyAddress(addr string) error {
// return mediaProxyURL, nil
// }
// })
func (cli *Client) SetProxy(proxy socket.Proxy) {
cli.proxy = proxy
cli.http.Transport.(*http.Transport).Proxy = proxy
func (cli *Client) SetProxy(proxy Proxy, opts ...SetProxyOptions) {
var opt SetProxyOptions
if len(opts) > 0 {
opt = opts[0]
}
if !opt.NoWebsocket {
cli.proxy = proxy
cli.socksProxy = nil
}
if !opt.NoMedia {
transport := cli.http.Transport.(*http.Transport)
transport.Proxy = proxy
transport.Dial = nil
transport.DialContext = nil
}
}
type SetProxyOptions struct {
// If NoWebsocket is true, the proxy won't be used for the websocket
NoWebsocket bool
// If NoMedia is true, the proxy won't be used for media uploads/downloads
NoMedia bool
}
// SetSOCKSProxy sets a SOCKS5 proxy to use for WhatsApp web websocket connections and media uploads/downloads.
//
// Same details as SetProxy apply, but using a different proxy for the websocket and media is not currently supported.
func (cli *Client) SetSOCKSProxy(px proxy.Dialer, opts ...SetProxyOptions) {
var opt SetProxyOptions
if len(opts) > 0 {
opt = opts[0]
}
if !opt.NoWebsocket {
cli.socksProxy = px
cli.proxy = nil
}
if !opt.NoMedia {
transport := cli.http.Transport.(*http.Transport)
transport.Proxy = nil
transport.Dial = cli.socksProxy.Dial
contextDialer, ok := cli.socksProxy.(proxy.ContextDialer)
if ok {
transport.DialContext = contextDialer.DialContext
} else {
transport.DialContext = nil
}
}
}
// ToggleProxyOnlyForLogin changes whether the proxy set with SetProxy or related methods
// is only used for the pre-login websocket and not authenticated websockets.
func (cli *Client) ToggleProxyOnlyForLogin(only bool) {
cli.proxyOnlyLogin = only
}
func (cli *Client) getSocketWaitChan() <-chan struct{} {
@ -308,7 +409,27 @@ func (cli *Client) Connect() error {
}
cli.resetExpectedDisconnect()
fs := socket.NewFrameSocket(cli.Log.Sub("Socket"), socket.WAConnHeader, cli.proxy)
wsDialer := websocket.Dialer{}
if !cli.proxyOnlyLogin || cli.Store.ID == nil {
if cli.proxy != nil {
wsDialer.Proxy = cli.proxy
} else if cli.socksProxy != nil {
wsDialer.NetDial = cli.socksProxy.Dial
contextDialer, ok := cli.socksProxy.(proxy.ContextDialer)
if ok {
wsDialer.NetDialContext = contextDialer.DialContext
}
}
}
fs := socket.NewFrameSocket(cli.Log.Sub("Socket"), wsDialer)
if cli.MessengerConfig != nil {
fs.URL = "wss://web-chat-e2ee.facebook.com/ws/chat"
fs.HTTPHeaders.Set("Origin", cli.MessengerConfig.BaseURL)
fs.HTTPHeaders.Set("User-Agent", cli.MessengerConfig.UserAgent)
fs.HTTPHeaders.Set("Sec-Fetch-Dest", "empty")
fs.HTTPHeaders.Set("Sec-Fetch-Mode", "websocket")
fs.HTTPHeaders.Set("Sec-Fetch-Site", "cross-site")
}
if err := fs.Connect(); err != nil {
fs.Close(0)
return err
@ -323,7 +444,7 @@ func (cli *Client) Connect() error {
// IsLoggedIn returns true after the client is successfully connected and authenticated on WhatsApp.
func (cli *Client) IsLoggedIn() bool {
return atomic.LoadUint32(&cli.isLoggedIn) == 1
return cli.isLoggedIn.Load()
}
func (cli *Client) onDisconnect(ns *socket.NoiseSocket, remote bool) {
@ -348,15 +469,15 @@ func (cli *Client) onDisconnect(ns *socket.NoiseSocket, remote bool) {
}
func (cli *Client) expectDisconnect() {
atomic.StoreUint32(&cli.expectedDisconnectVal, 1)
cli.expectedDisconnect.Store(true)
}
func (cli *Client) resetExpectedDisconnect() {
atomic.StoreUint32(&cli.expectedDisconnectVal, 0)
cli.expectedDisconnect.Store(false)
}
func (cli *Client) isExpectedDisconnect() bool {
return atomic.LoadUint32(&cli.expectedDisconnectVal) == 1
return cli.expectedDisconnect.Load()
}
func (cli *Client) autoReconnect() {
@ -374,6 +495,10 @@ func (cli *Client) autoReconnect() {
return
} else if err != nil {
cli.Log.Errorf("Error reconnecting after autoreconnect sleep: %v", err)
if cli.AutoReconnectHook != nil && !cli.AutoReconnectHook(err) {
cli.Log.Debugf("AutoReconnectHook returned false, not reconnecting")
return
}
} else {
return
}
@ -419,6 +544,9 @@ func (cli *Client) unlockedDisconnect() {
// Note that this will not emit any events. The LoggedOut event is only used for external logouts
// (triggered by the user from the main device or by WhatsApp servers).
func (cli *Client) Logout() error {
if cli.MessengerConfig != nil {
return errors.New("can't logout with Messenger credentials")
}
ownID := cli.getOwnID()
if ownID.IsEmpty() {
return ErrNotLoggedIn
@ -667,7 +795,7 @@ func (cli *Client) ParseWebMessage(chatJID types.JID, webMsg *waProto.WebMessage
if info.Sender.IsEmpty() {
return nil, ErrNotLoggedIn
}
} else if chatJID.Server == types.DefaultUserServer {
} else if chatJID.Server == types.DefaultUserServer || chatJID.Server == types.NewsletterServer {
info.Sender = chatJID
} else if webMsg.GetParticipant() != "" {
info.Sender, err = types.ParseJID(webMsg.GetParticipant())

@ -0,0 +1,76 @@
// Copyright (c) 2021 Tulir Asokan
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package whatsmeow_test
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/store/sqlstore"
"go.mau.fi/whatsmeow/types/events"
waLog "go.mau.fi/whatsmeow/util/log"
)
func eventHandler(evt interface{}) {
switch v := evt.(type) {
case *events.Message:
fmt.Println("Received a message!", v.Message.GetConversation())
}
}
func Example() {
dbLog := waLog.Stdout("Database", "DEBUG", true)
// Make sure you add appropriate DB connector imports, e.g. github.com/mattn/go-sqlite3 for SQLite
container, err := sqlstore.New("sqlite3", "file:examplestore.db?_foreign_keys=on", dbLog)
if err != nil {
panic(err)
}
// If you want multiple sessions, remember their JIDs and use .GetDevice(jid) or .GetAllDevices() instead.
deviceStore, err := container.GetFirstDevice()
if err != nil {
panic(err)
}
clientLog := waLog.Stdout("Client", "DEBUG", true)
client := whatsmeow.NewClient(deviceStore, clientLog)
client.AddEventHandler(eventHandler)
if client.Store.ID == nil {
// No ID stored, new login
qrChan, _ := client.GetQRChannel(context.Background())
err = client.Connect()
if err != nil {
panic(err)
}
for evt := range qrChan {
if evt.Event == "code" {
// Render the QR code here
// e.g. qrterminal.GenerateHalfBlock(evt.Code, qrterminal.L, os.Stdout)
// or just manually `echo 2@... | qrencode -t ansiutf8` in a terminal
fmt.Println("QR code:", evt.Code)
} else {
fmt.Println("Login event:", evt.Event)
}
}
} else {
// Already logged in, just connect
err = client.Connect()
if err != nil {
panic(err)
}
}
// Listen to Ctrl+C (you can also do something else that prevents the program from exiting)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
<-c
client.Disconnect()
}

@ -7,7 +7,6 @@
package whatsmeow
import (
"sync/atomic"
"time"
waBinary "go.mau.fi/whatsmeow/binary"
@ -17,7 +16,7 @@ import (
)
func (cli *Client) handleStreamError(node *waBinary.Node) {
atomic.StoreUint32(&cli.isLoggedIn, 0)
cli.isLoggedIn.Store(false)
cli.clearResponseWaiters(node)
code, _ := node.Attrs["code"].(string)
conflict, _ := node.GetOptionalChildByTag("conflict")
@ -48,6 +47,16 @@ func (cli *Client) handleStreamError(node *waBinary.Node) {
// This seems to happen when the server wants to restart or something.
// The disconnection will be emitted as an events.Disconnected and then the auto-reconnect will do its thing.
cli.Log.Warnf("Got 503 stream error, assuming automatic reconnect will handle it")
case cli.RefreshCAT != nil && (code == events.ConnectFailureCATInvalid.NumberString() || code == events.ConnectFailureCATExpired.NumberString()):
cli.Log.Infof("Got %s stream error, refreshing CAT before reconnecting...", code)
cli.socketLock.RLock()
defer cli.socketLock.RUnlock()
err := cli.RefreshCAT()
if err != nil {
cli.Log.Errorf("Failed to refresh CAT: %v", err)
cli.expectDisconnect()
go cli.dispatchEvent(&events.CATRefreshError{Error: err})
}
default:
cli.Log.Errorf("Unknown stream error: %s", node.XMLString())
go cli.dispatchEvent(&events.StreamError{Code: code, Raw: node})
@ -89,9 +98,20 @@ func (cli *Client) handleConnectFailure(node *waBinary.Node) {
willAutoReconnect = false
case reason == events.ConnectFailureServiceUnavailable:
// Auto-reconnect for 503s
case reason == events.ConnectFailureCATInvalid || reason == events.ConnectFailureCATExpired:
// Auto-reconnect when rotating CAT, lock socket to ensure refresh goes through before reconnect
cli.socketLock.RLock()
defer cli.socketLock.RUnlock()
case reason == 500 && message == "biz vname fetch error":
// These happen for business accounts randomly, also auto-reconnect
}
if reason == 403 {
cli.Log.Debugf(
"Message for 403 connect failure: %s / %s",
ag.OptionalString("logout_message_header"),
ag.OptionalString("logout_message_subtext"),
)
}
if reason.IsLoggedOut() {
cli.Log.Infof("Got %s connect failure, sending LoggedOut event and deleting session", reason)
go cli.dispatchEvent(&events.LoggedOut{OnConnect: true, Reason: reason})
@ -108,6 +128,14 @@ func (cli *Client) handleConnectFailure(node *waBinary.Node) {
} else if reason == events.ConnectFailureClientOutdated {
cli.Log.Errorf("Client outdated (405) connect failure (client version: %s)", store.GetWAVersion().String())
go cli.dispatchEvent(&events.ClientOutdated{})
} else if reason == events.ConnectFailureCATInvalid || reason == events.ConnectFailureCATExpired {
cli.Log.Infof("Got %d/%s connect failure, refreshing CAT before reconnecting...", int(reason), message)
err := cli.RefreshCAT()
if err != nil {
cli.Log.Errorf("Failed to refresh CAT: %v", err)
cli.expectDisconnect()
go cli.dispatchEvent(&events.CATRefreshError{Error: err})
}
} else if willAutoReconnect {
cli.Log.Warnf("Got %d/%s connect failure, assuming automatic reconnect will handle it", int(reason), message)
} else {
@ -120,7 +148,7 @@ func (cli *Client) handleConnectSuccess(node *waBinary.Node) {
cli.Log.Infof("Successfully authenticated")
cli.LastSuccessfulConnect = time.Now()
cli.AutoReconnectErrors = 0
atomic.StoreUint32(&cli.isLoggedIn, 1)
cli.isLoggedIn.Store(true)
go func() {
if dbCount, err := cli.Store.PreKeys.UploadedPreKeyCount(); err != nil {
cli.Log.Errorf("Failed to get number of prekeys in database: %v", err)

@ -10,6 +10,7 @@ import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"errors"
"fmt"
"io"
"net"
@ -17,9 +18,11 @@ import (
"strings"
"time"
"go.mau.fi/util/retryafter"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"go.mau.fi/whatsmeow/binary/armadillo/waMediaTransport"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/socket"
"go.mau.fi/whatsmeow/util/cbcutil"
@ -208,6 +211,10 @@ func (cli *Client) Download(msg DownloadableMessage) ([]byte, error) {
}
}
func (cli *Client) DownloadFB(transport *waMediaTransport.WAMediaTransport_Integral, mediaType MediaType) ([]byte, error) {
return cli.DownloadMediaWithPath(transport.GetDirectPath(), transport.GetFileEncSHA256(), transport.GetFileSHA256(), transport.GetMediaKey(), -1, mediaType, mediaTypeToMMSType[mediaType])
}
// DownloadMediaWithPath downloads an attachment by manually specifying the path and encryption details.
func (cli *Client) DownloadMediaWithPath(directPath string, encFileHash, fileHash, mediaKey []byte, fileLength int, mediaType MediaType, mmsType string) (data []byte, err error) {
var mediaConn *MediaConn
@ -219,15 +226,16 @@ func (cli *Client) DownloadMediaWithPath(directPath string, encFileHash, fileHas
mmsType = mediaTypeToMMSType[mediaType]
}
for i, host := range mediaConn.Hosts {
// TODO omit hash for unencrypted media?
mediaURL := fmt.Sprintf("https://%s%s&hash=%s&mms-type=%s&__wa-mms=", host.Hostname, directPath, base64.URLEncoding.EncodeToString(encFileHash), mmsType)
data, err = cli.downloadAndDecrypt(mediaURL, mediaKey, mediaType, fileLength, encFileHash, fileHash)
// TODO there are probably some errors that shouldn't retry
if err != nil {
if i >= len(mediaConn.Hosts)-1 {
return nil, fmt.Errorf("failed to download media from last host: %w", err)
}
cli.Log.Warnf("Failed to download media: %s, trying with next host...", err)
if err == nil {
return
} else if i >= len(mediaConn.Hosts)-1 {
return nil, fmt.Errorf("failed to download media from last host: %w", err)
}
// TODO there are probably some errors that shouldn't retry
cli.Log.Warnf("Failed to download media: %s, trying with next host...", err)
}
return
}
@ -235,8 +243,11 @@ func (cli *Client) DownloadMediaWithPath(directPath string, encFileHash, fileHas
func (cli *Client) downloadAndDecrypt(url string, mediaKey []byte, appInfo MediaType, fileLength int, fileEncSha256, fileSha256 []byte) (data []byte, err error) {
iv, cipherKey, macKey, _ := getMediaKeys(mediaKey, appInfo)
var ciphertext, mac []byte
if ciphertext, mac, err = cli.downloadEncryptedMediaWithRetries(url, fileEncSha256); err != nil {
if ciphertext, mac, err = cli.downloadPossiblyEncryptedMediaWithRetries(url, fileEncSha256); err != nil {
} else if mediaKey == nil && fileEncSha256 == nil && mac == nil {
// Unencrypted media, just return the downloaded data
data = ciphertext
} else if err = validateMedia(iv, ciphertext, macKey, mac); err != nil {
} else if data, err = cbcutil.Decrypt(cipherKey, iv, ciphertext); err != nil {
@ -254,52 +265,59 @@ func getMediaKeys(mediaKey []byte, appInfo MediaType) (iv, cipherKey, macKey, re
return mediaKeyExpanded[:16], mediaKeyExpanded[16:48], mediaKeyExpanded[48:80], mediaKeyExpanded[80:]
}
func (cli *Client) downloadEncryptedMediaWithRetries(url string, checksum []byte) (file, mac []byte, err error) {
func shouldRetryMediaDownload(err error) bool {
var netErr net.Error
var httpErr DownloadHTTPError
return errors.As(err, &netErr) ||
strings.HasPrefix(err.Error(), "stream error:") || // hacky check for http2 errors
(errors.As(err, &httpErr) && retryafter.Should(httpErr.StatusCode, true))
}
func (cli *Client) downloadPossiblyEncryptedMediaWithRetries(url string, checksum []byte) (file, mac []byte, err error) {
for retryNum := 0; retryNum < 5; retryNum++ {
file, mac, err = cli.downloadEncryptedMedia(url, checksum)
if err == nil {
return
if checksum == nil {
file, err = cli.downloadMedia(url)
} else {
file, mac, err = cli.downloadEncryptedMedia(url, checksum)
}
netErr, ok := err.(net.Error)
if !ok {
// Not a network error, don't retry
if err == nil || !shouldRetryMediaDownload(err) {
return
}
cli.Log.Warnf("Failed to download media due to network error: %w, retrying...", netErr)
time.Sleep(time.Duration(retryNum+1) * time.Second)
retryDuration := time.Duration(retryNum+1) * time.Second
var httpErr DownloadHTTPError
if errors.As(err, &httpErr) {
retryDuration = retryafter.Parse(httpErr.Response.Header.Get("Retry-After"), retryDuration)
}
cli.Log.Warnf("Failed to download media due to network error: %w, retrying in %s...", err, retryDuration)
time.Sleep(retryDuration)
}
return
}
func (cli *Client) downloadEncryptedMedia(url string, checksum []byte) (file, mac []byte, err error) {
var req *http.Request
req, err = http.NewRequest(http.MethodGet, url, nil)
func (cli *Client) downloadMedia(url string) ([]byte, error) {
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
err = fmt.Errorf("failed to prepare request: %w", err)
return
return nil, fmt.Errorf("failed to prepare request: %w", err)
}
req.Header.Set("Origin", socket.Origin)
req.Header.Set("Referer", socket.Origin+"/")
var resp *http.Response
resp, err = cli.http.Do(req)
if cli.MessengerConfig != nil {
req.Header.Set("User-Agent", cli.MessengerConfig.UserAgent)
}
// TODO user agent for whatsapp downloads?
resp, err := cli.http.Do(req)
if err != nil {
return
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
if resp.StatusCode == http.StatusForbidden {
err = ErrMediaDownloadFailedWith403
} else if resp.StatusCode == http.StatusNotFound {
err = ErrMediaDownloadFailedWith404
} else if resp.StatusCode == http.StatusGone {
err = ErrMediaDownloadFailedWith410
} else {
err = fmt.Errorf("download failed with status code %d", resp.StatusCode)
}
return
return nil, DownloadHTTPError{Response: resp}
}
var data []byte
data, err = io.ReadAll(resp.Body)
return io.ReadAll(resp.Body)
}
func (cli *Client) downloadEncryptedMedia(url string, checksum []byte) (file, mac []byte, err error) {
data, err := cli.downloadMedia(url)
if err != nil {
return
} else if len(data) <= 10 {

@ -9,6 +9,7 @@ package whatsmeow
import (
"errors"
"fmt"
"net/http"
waBinary "go.mau.fi/whatsmeow/binary"
)
@ -103,15 +104,28 @@ var (
var (
ErrBroadcastListUnsupported = errors.New("sending to non-status broadcast lists is not yet supported")
ErrUnknownServer = errors.New("can't send message to unknown server")
ErrRecipientADJID = errors.New("message recipient must be normal (non-AD) JID")
ErrRecipientADJID = errors.New("message recipient must be a user JID with no device part")
ErrServerReturnedError = errors.New("server returned error")
)
type DownloadHTTPError struct {
*http.Response
}
func (dhe DownloadHTTPError) Error() string {
return fmt.Sprintf("download failed with status code %d", dhe.StatusCode)
}
func (dhe DownloadHTTPError) Is(other error) bool {
var otherDHE DownloadHTTPError
return errors.As(other, &otherDHE) && dhe.StatusCode == otherDHE.StatusCode
}
// Some errors that Client.Download can return
var (
ErrMediaDownloadFailedWith403 = errors.New("download failed with status code 403")
ErrMediaDownloadFailedWith404 = errors.New("download failed with status code 404")
ErrMediaDownloadFailedWith410 = errors.New("download failed with status code 410")
ErrMediaDownloadFailedWith403 = DownloadHTTPError{Response: &http.Response{StatusCode: 403}}
ErrMediaDownloadFailedWith404 = DownloadHTTPError{Response: &http.Response{StatusCode: 404}}
ErrMediaDownloadFailedWith410 = DownloadHTTPError{Response: &http.Response{StatusCode: 410}}
ErrNoURLPresent = errors.New("no url present")
ErrFileLengthMismatch = errors.New("file length does not match")
ErrTooShortFile = errors.New("file too short")

@ -0,0 +1,21 @@
module go.mau.fi/whatsmeow
go 1.21
require (
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.0
github.com/rs/zerolog v1.32.0
go.mau.fi/libsignal v0.1.0
go.mau.fi/util v0.4.1
golang.org/x/crypto v0.23.0
golang.org/x/net v0.25.0
google.golang.org/protobuf v1.33.0
)
require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
golang.org/x/sys v0.20.0 // indirect
)

@ -0,0 +1,44 @@
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
go.mau.fi/util v0.4.1 h1:3EC9KxIXo5+h869zDGf5OOZklRd/FjeVnimTwtm3owg=
go.mau.fi/util v0.4.1/go.mod h1:GjkTEBsehYZbSh2LlE6cWEn+6ZIZTGrTMM/5DMNlmFY=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

@ -148,30 +148,93 @@ const (
)
// UpdateGroupParticipants can be used to add, remove, promote and demote members in a WhatsApp group.
func (cli *Client) UpdateGroupParticipants(jid types.JID, participantChanges map[types.JID]ParticipantChange) (*waBinary.Node, error) {
func (cli *Client) UpdateGroupParticipants(jid types.JID, participantChanges []types.JID, action ParticipantChange) ([]types.GroupParticipant, error) {
content := make([]waBinary.Node, len(participantChanges))
i := 0
for participantJID, change := range participantChanges {
for i, participantJID := range participantChanges {
content[i] = waBinary.Node{
Tag: string(change),
Content: []waBinary.Node{{
Tag: "participant",
Attrs: waBinary.Attrs{"jid": participantJID},
}},
Tag: "participant",
Attrs: waBinary.Attrs{"jid": participantJID},
}
i++
}
resp, err := cli.sendIQ(infoQuery{
Namespace: "w:g2",
Type: iqSet,
To: jid,
Content: content,
resp, err := cli.sendGroupIQ(context.TODO(), iqSet, jid, waBinary.Node{
Tag: string(action),
Content: content,
})
if err != nil {
return nil, err
}
requestAction, ok := resp.GetOptionalChildByTag(string(action))
if !ok {
return nil, &ElementMissingError{Tag: string(action), In: "response to group participants update"}
}
requestParticipants := requestAction.GetChildrenByTag("participant")
participants := make([]types.GroupParticipant, len(requestParticipants))
for i, child := range requestParticipants {
participants[i] = parseParticipant(child.AttrGetter(), &child)
}
return participants, nil
}
// GetGroupRequestParticipants gets the list of participants that have requested to join the group.
func (cli *Client) GetGroupRequestParticipants(jid types.JID) ([]types.JID, error) {
resp, err := cli.sendGroupIQ(context.TODO(), iqGet, jid, waBinary.Node{
Tag: "membership_approval_requests",
})
if err != nil {
return nil, err
}
request, ok := resp.GetOptionalChildByTag("membership_approval_requests")
if !ok {
return nil, &ElementMissingError{Tag: "membership_approval_requests", In: "response to group request participants query"}
}
requestParticipants := request.GetChildrenByTag("membership_approval_request")
participants := make([]types.JID, len(requestParticipants))
for i, req := range requestParticipants {
participants[i] = req.AttrGetter().JID("jid")
}
return participants, nil
}
type ParticipantRequestChange string
const (
ParticipantChangeApprove ParticipantRequestChange = "approve"
ParticipantChangeReject ParticipantRequestChange = "reject"
)
// UpdateGroupRequestParticipants can be used to approve or reject requests to join the group.
func (cli *Client) UpdateGroupRequestParticipants(jid types.JID, participantChanges []types.JID, action ParticipantRequestChange) ([]types.GroupParticipant, error) {
content := make([]waBinary.Node, len(participantChanges))
for i, participantJID := range participantChanges {
content[i] = waBinary.Node{
Tag: "participant",
Attrs: waBinary.Attrs{"jid": participantJID},
}
}
resp, err := cli.sendGroupIQ(context.TODO(), iqSet, jid, waBinary.Node{
Tag: "membership_requests_action",
Content: []waBinary.Node{{
Tag: string(action),
Content: content,
}},
})
if err != nil {
return nil, err
}
// TODO proper return value?
return resp, nil
request, ok := resp.GetOptionalChildByTag("membership_requests_action")
if !ok {
return nil, &ElementMissingError{Tag: "membership_requests_action", In: "response to group request participants update"}
}
requestAction, ok := request.GetOptionalChildByTag(string(action))
if !ok {
return nil, &ElementMissingError{Tag: string(action), In: "response to group request participants update"}
}
requestParticipants := requestAction.GetChildrenByTag("participant")
participants := make([]types.GroupParticipant, len(requestParticipants))
for i, child := range requestParticipants {
participants[i] = parseParticipant(child.AttrGetter(), &child)
}
return participants, nil
}
// SetGroupPhoto updates the group picture/icon of the given group on WhatsApp.
@ -501,6 +564,33 @@ func (cli *Client) getGroupMembers(ctx context.Context, jid types.JID) ([]types.
return cli.groupParticipantsCache[jid], nil
}
func parseParticipant(childAG *waBinary.AttrUtility, child *waBinary.Node) types.GroupParticipant {
pcpType := childAG.OptionalString("type")
participant := types.GroupParticipant{
IsAdmin: pcpType == "admin" || pcpType == "superadmin",
IsSuperAdmin: pcpType == "superadmin",
JID: childAG.JID("jid"),
LID: childAG.OptionalJIDOrEmpty("lid"),
DisplayName: childAG.OptionalString("display_name"),
}
if participant.JID.Server == types.HiddenUserServer && participant.LID.IsEmpty() {
participant.LID = participant.JID
//participant.JID = types.EmptyJID
}
if errorCode := childAG.OptionalInt("error"); errorCode != 0 {
participant.Error = errorCode
addRequest, ok := child.GetOptionalChildByTag("add_request")
if ok {
addAG := addRequest.AttrGetter()
participant.AddRequest = &types.GroupParticipantAddRequest{
Code: addAG.String("code"),
Expiration: addAG.UnixTime("expiration"),
}
}
}
return participant
}
func (cli *Client) parseGroupNode(groupNode *waBinary.Node) (*types.GroupInfo, error) {
var group types.GroupInfo
ag := groupNode.AttrGetter()
@ -521,24 +611,7 @@ func (cli *Client) parseGroupNode(groupNode *waBinary.Node) (*types.GroupInfo, e
childAG := child.AttrGetter()
switch child.Tag {
case "participant":
pcpType := childAG.OptionalString("type")
participant := types.GroupParticipant{
IsAdmin: pcpType == "admin" || pcpType == "superadmin",
IsSuperAdmin: pcpType == "superadmin",
JID: childAG.JID("jid"),
}
if errorCode := childAG.OptionalInt("error"); errorCode != 0 {
participant.Error = errorCode
addRequest, ok := child.GetOptionalChildByTag("add_request")
if ok {
addAG := addRequest.AttrGetter()
participant.AddRequest = &types.GroupParticipantAddRequest{
Code: addAG.String("code"),
Expiration: addAG.UnixTime("expiration"),
}
}
}
group.Participants = append(group.Participants, participant)
group.Participants = append(group.Participants, parseParticipant(childAG, &child))
case "description":
body, bodyOK := child.GetOptionalChildByTag("body")
if bodyOK {
@ -565,6 +638,9 @@ func (cli *Client) parseGroupNode(groupNode *waBinary.Node) (*types.GroupInfo, e
case "parent":
group.IsParent = true
group.DefaultMembershipApprovalMode = childAG.OptionalString("default_membership_approval_mode")
case "incognito":
group.IsIncognito = true
// TODO: membership_approval_mode
default:
cli.Log.Debugf("Unknown element in group node %s: %s", group.JID.String(), child.XMLString())
}

@ -11,6 +11,7 @@ import (
"fmt"
"time"
"go.mau.fi/libsignal/ecc"
"google.golang.org/protobuf/proto"
waProto "go.mau.fi/whatsmeow/binary/proto"
@ -19,6 +20,9 @@ import (
)
const NoiseHandshakeResponseTimeout = 20 * time.Second
const WACertIssuerSerial = 0
var WACertPubKey = [...]byte{0x14, 0x23, 0x75, 0x57, 0x4d, 0xa, 0x58, 0x71, 0x66, 0xaa, 0xe7, 0x1e, 0xbe, 0x51, 0x64, 0x37, 0xc4, 0xa2, 0x8b, 0x73, 0xe3, 0x69, 0x5c, 0x6c, 0xe1, 0xf7, 0xf9, 0x54, 0x5d, 0xa8, 0xee, 0x6b}
// doHandshake implements the Noise_XX_25519_AESGCM_SHA256 handshake for the WhatsApp web API.
func (cli *Client) doHandshake(fs *socket.FrameSocket, ephemeralKP keys.KeyPair) error {
@ -76,23 +80,8 @@ func (cli *Client) doHandshake(fs *socket.FrameSocket, ephemeralKP keys.KeyPair)
certDecrypted, err := nh.Decrypt(certificateCiphertext)
if err != nil {
return fmt.Errorf("failed to decrypt noise certificate ciphertext: %w", err)
}
var cert waProto.NoiseCertificate
err = proto.Unmarshal(certDecrypted, &cert)
if err != nil {
return fmt.Errorf("failed to unmarshal noise certificate: %w", err)
}
certDetailsRaw := cert.GetDetails()
certSignature := cert.GetSignature()
if certDetailsRaw == nil || certSignature == nil {
return fmt.Errorf("missing parts of noise certificate")
}
var certDetails waProto.NoiseCertificate_Details
err = proto.Unmarshal(certDetailsRaw, &certDetails)
if err != nil {
return fmt.Errorf("failed to unmarshal noise certificate details: %w", err)
} else if !bytes.Equal(certDetails.GetKey(), staticDecrypted) {
return fmt.Errorf("cert key doesn't match decrypted static")
} else if err = verifyServerCert(certDecrypted, staticDecrypted); err != nil {
return fmt.Errorf("failed to verify server cert: %w", err)
}
encryptedPubkey := nh.Encrypt(cli.Store.NoiseKey.Pub[:])
@ -101,7 +90,14 @@ func (cli *Client) doHandshake(fs *socket.FrameSocket, ephemeralKP keys.KeyPair)
return fmt.Errorf("failed to mix noise private key in: %w", err)
}
clientFinishPayloadBytes, err := proto.Marshal(cli.Store.GetClientPayload())
var clientPayload *waProto.ClientPayload
if cli.GetClientPayload != nil {
clientPayload = cli.GetClientPayload()
} else {
clientPayload = cli.Store.GetClientPayload()
}
clientFinishPayloadBytes, err := proto.Marshal(clientPayload)
if err != nil {
return fmt.Errorf("failed to marshal client finish payload: %w", err)
}
@ -129,3 +125,40 @@ func (cli *Client) doHandshake(fs *socket.FrameSocket, ephemeralKP keys.KeyPair)
return nil
}
func verifyServerCert(certDecrypted, staticDecrypted []byte) error {
var certChain waProto.CertChain
err := proto.Unmarshal(certDecrypted, &certChain)
if err != nil {
return fmt.Errorf("failed to unmarshal noise certificate: %w", err)
}
var intermediateCertDetails, leafCertDetails waProto.CertChain_NoiseCertificate_Details
intermediateCertDetailsRaw := certChain.GetIntermediate().GetDetails()
intermediateCertSignature := certChain.GetIntermediate().GetSignature()
leafCertDetailsRaw := certChain.GetLeaf().GetDetails()
leafCertSignature := certChain.GetLeaf().GetSignature()
if intermediateCertDetailsRaw == nil || intermediateCertSignature == nil || leafCertDetailsRaw == nil || leafCertSignature == nil {
return fmt.Errorf("missing parts of noise certificate")
} else if len(intermediateCertSignature) != 64 {
return fmt.Errorf("unexpected length of intermediate cert signature %d (expected 64)", len(intermediateCertSignature))
} else if len(leafCertSignature) != 64 {
return fmt.Errorf("unexpected length of leaf cert signature %d (expected 64)", len(leafCertSignature))
} else if !ecc.VerifySignature(ecc.NewDjbECPublicKey(WACertPubKey), intermediateCertDetailsRaw, [64]byte(intermediateCertSignature)) {
return fmt.Errorf("failed to verify intermediate cert signature")
} else if err = proto.Unmarshal(intermediateCertDetailsRaw, &intermediateCertDetails); err != nil {
return fmt.Errorf("failed to unmarshal noise certificate details: %w", err)
} else if intermediateCertDetails.GetIssuerSerial() != WACertIssuerSerial {
return fmt.Errorf("unexpected intermediate issuer serial %d (expected %d)", intermediateCertDetails.GetIssuerSerial(), WACertIssuerSerial)
} else if len(intermediateCertDetails.GetKey()) != 32 {
return fmt.Errorf("unexpected length of intermediate cert key %d (expected 32)", len(intermediateCertDetails.GetKey()))
} else if !ecc.VerifySignature(ecc.NewDjbECPublicKey([32]byte(intermediateCertDetails.GetKey())), leafCertDetailsRaw, [64]byte(leafCertSignature)) {
return fmt.Errorf("failed to verify intermediate cert signature")
} else if err = proto.Unmarshal(leafCertDetailsRaw, &leafCertDetails); err != nil {
return fmt.Errorf("failed to unmarshal noise certificate details: %w", err)
} else if leafCertDetails.GetIssuerSerial() != intermediateCertDetails.GetSerial() {
return fmt.Errorf("unexpected leaf issuer serial %d (expected %d)", leafCertDetails.GetIssuerSerial(), intermediateCertDetails.GetSerial())
} else if !bytes.Equal(leafCertDetails.GetKey(), staticDecrypted) {
return fmt.Errorf("cert key doesn't match decrypted static")
}
return nil
}

@ -9,6 +9,8 @@ package whatsmeow
import (
"context"
"go.mau.fi/libsignal/keys/prekey"
waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
)
@ -66,3 +68,19 @@ func (int *DangerousInternalClient) RequestAppStateKeys(ctx context.Context, key
func (int *DangerousInternalClient) SendRetryReceipt(node *waBinary.Node, info *types.MessageInfo, forceIncludeIdentity bool) {
int.c.sendRetryReceipt(node, info, forceIncludeIdentity)
}
func (int *DangerousInternalClient) EncryptMessageForDevice(plaintext []byte, to types.JID, bundle *prekey.Bundle, extraAttrs waBinary.Attrs) (*waBinary.Node, bool, error) {
return int.c.encryptMessageForDevice(plaintext, to, bundle, extraAttrs)
}
func (int *DangerousInternalClient) GetOwnID() types.JID {
return int.c.getOwnID()
}
func (int *DangerousInternalClient) DecryptDM(child *waBinary.Node, from types.JID, isPreKey bool) ([]byte, error) {
return int.c.decryptDM(child, from, isPreKey)
}
func (int *DangerousInternalClient) MakeDeviceIdentityNode() waBinary.Node {
return int.c.makeDeviceIdentityNode()
}

@ -11,7 +11,6 @@ import (
"math/rand"
"time"
waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
)
@ -67,7 +66,6 @@ func (cli *Client) sendKeepAlive(ctx context.Context) (isSuccess, shouldContinue
Namespace: "w:p",
Type: "get",
To: types.ServerJID,
Content: []waBinary.Node{{Tag: "ping"}},
})
if err != nil {
cli.Log.Warnf("Failed to send keepalive: %v", err)

@ -0,0 +1,11 @@
# mdtest
This is a simple tool for testing whatsmeow.
1. Clone the repository.
2. Run `go build` inside this directory.
3. Run `./mdtest` to start the program. Optionally, use `rlwrap ./mdtest` to get a nicer prompt.
Add `-debug` if you want to see the raw data being sent/received.
4. On the first run, scan the QR code. On future runs, the program will remember you (unless `mdtest.db` is deleted).
New messages will be automatically logged. To send a message, use `send <jid> <message>`

@ -0,0 +1,29 @@
module go.mau.fi/whatsmeow/mdtest
go 1.21
toolchain go1.22.0
require (
github.com/mattn/go-sqlite3 v1.14.22
github.com/mdp/qrterminal/v3 v3.0.0
go.mau.fi/whatsmeow v0.0.0-20230805111647-405414b9b5c0
google.golang.org/protobuf v1.33.0
)
require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/rs/zerolog v1.32.0 // indirect
go.mau.fi/libsignal v0.1.0 // indirect
go.mau.fi/util v0.4.1 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
rsc.io/qr v0.2.0 // indirect
)
replace go.mau.fi/whatsmeow => ../

@ -0,0 +1,54 @@
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mdp/qrterminal v1.0.1/go.mod h1:Z33WhxQe9B6CdW37HaVqcRKzP+kByF3q/qLxOGe12xQ=
github.com/mdp/qrterminal/v3 v3.0.0 h1:ywQqLRBXWTktytQNDKFjhAvoGkLVN3J2tAFZ0kMd9xQ=
github.com/mdp/qrterminal/v3 v3.0.0/go.mod h1:NJpfAs7OAm77Dy8EkWrtE4aq+cE6McoLXlBqXQEwvE0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
go.mau.fi/util v0.4.1 h1:3EC9KxIXo5+h869zDGf5OOZklRd/FjeVnimTwtm3owg=
go.mau.fi/util v0.4.1/go.mod h1:GjkTEBsehYZbSh2LlE6cWEn+6ZIZTGrTMM/5DMNlmFY=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY=
rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs=

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save