app

package
v0.0.0-...-74e40a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DHString = []byte{69, 68, 0, 1}
View Source
var InitString = []byte("WA")

Functions

func GenAuthDataService

func GenAuthDataService(payload *waProto.ClientPayload) error

GenAuthDataService 生成认证数据

func IsEmpty

func IsEmpty(s string) bool

IsEmpty

Types

type AccountInfo

type AccountInfo struct {
	// contains filtered or unexported fields
}

AccountInfo

func EmptyAccountInfo

func EmptyAccountInfo() *AccountInfo

func (AccountInfo) Ctx

func (l AccountInfo) Ctx() context.Context

func (*AccountInfo) GetClientPayload

func (a *AccountInfo) GetClientPayload() *waProto.ClientPayload

func (AccountInfo) GetLoginSettings

func (l AccountInfo) GetLoginSettings() *WAHandshakeSettings

GetLoginSettings

func (*AccountInfo) GetPlatform

func (a *AccountInfo) GetPlatform() string

获取平台

func (*AccountInfo) GetStaticKeys

func (a *AccountInfo) GetStaticKeys() *DHKey

func (AccountInfo) GetStaticPriKey

func (l AccountInfo) GetStaticPriKey() *[32]byte

func (AccountInfo) GetStaticPubKey

func (l AccountInfo) GetStaticPubKey() *[32]byte

func (*AccountInfo) GetUserName

func (a *AccountInfo) GetUserName() string

GetUserName

func (*AccountInfo) GetVeriFiledName

func (a *AccountInfo) GetVeriFiledName() uint64

func (AccountInfo) SetCliPayload

func (l AccountInfo) SetCliPayload(payload *waProto.ClientPayload)

func (AccountInfo) SetCliPayloadData

func (l AccountInfo) SetCliPayloadData(data []byte) error

SetCliPayloadData

func (*AccountInfo) SetLogCtx

func (a *AccountInfo) SetLogCtx(k, v string)

SetLogCtx

func (AccountInfo) SetRoutingInfo

func (l AccountInfo) SetRoutingInfo(d []byte)

func (AccountInfo) SetStaticHdBase64Keys

func (l AccountInfo) SetStaticHdBase64Keys(pri, pub string) error

func (AccountInfo) SetStaticHdKeys

func (l AccountInfo) SetStaticHdKeys(pri, pub []byte) error

func (AccountInfo) SetStaticKeys

func (l AccountInfo) SetStaticKeys(base64Data string) error

SetStaticKeys

func (AccountInfo) SetStaticPriKey

func (l AccountInfo) SetStaticPriKey(d string) error

func (AccountInfo) SetStaticPubKey

func (l AccountInfo) SetStaticPubKey(d string) error

func (*AccountInfo) SetUserName

func (a *AccountInfo) SetUserName(u uint64)

func (*AccountInfo) SetVeriFiledName

func (a *AccountInfo) SetVeriFiledName(VeriFiledName uint64)

type AuthDataDto

type AuthDataDto struct {
	*ClientPayload
}

type AuthDataDtoActual

type AuthDataDtoActual struct {
	*waProto.ClientPayload
}

type BusinessVersion42

type BusinessVersion42 struct {
	Primary    uint32
	Secondary  uint32
	Tertiary   uint32
	Quaternary uint32
}

企业版

func GetBusinessVersion42

func GetBusinessVersion42() *BusinessVersion42

type ClientPayload

type ClientPayload struct {
	Username            *uint64                  `protobuf:"varint,1,opt,name=username" json:"username,omitempty"`
	Passive             *bool                    `protobuf:"varint,3,opt,name=passive" json:"passive,omitempty"`
	ClientFeatures      []int32                  `protobuf:"varint,4,rep,name=client_features,json=clientFeatures,enum=int32" json:"client_features,omitempty"`
	UserAgent           *ClientPayload_UserAgent `protobuf:"bytes,5,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"`
	WebInfo             *ClientPayload_WebInfo   `protobuf:"bytes,6,opt,name=web_info,json=webInfo" json:"web_info,omitempty"`
	PushName            *string                  `protobuf:"bytes,7,opt,name=push_name,json=pushName" json:"push_name,omitempty"`
	SessionId           *int32                   `protobuf:"fixed32,9,opt,name=session_id,json=sessionId" json:"session_id,omitempty"`
	ShortConnect        *bool                    `protobuf:"varint,10,opt,name=short_connect,json=shortConnect" json:"short_connect,omitempty"`
	ConnectType         *int32                   `protobuf:"varint,12,opt,name=connect_type,json=connectType,enum=int32" json:"connect_type,omitempty"`
	ConnectReason       *int32                   `protobuf:"varint,13,opt,name=connect_reason,json=connectReason,enum=int32" json:"connect_reason,omitempty"`
	Shards              []int32                  `protobuf:"fixed32,14,rep,name=shards" json:"shards,omitempty"`
	DnsSource           *ClientPayload_DnsSource `protobuf:"bytes,15,opt,name=dns_source,json=dnsSource" json:"dns_source,omitempty"`
	ConnectAttemptCount *int32                   `protobuf:"fixed32,16,opt,name=connect_attempt_count,json=connectAttemptCount" json:"connect_attempt_count,omitempty"`
	Oc                  *bool                    `protobuf:"varint,23,opt,name=oc" json:"oc,omitempty"`
	Lc                  *int32                   `protobuf:"varint,24,opt,name=lc" json:"lc,omitempty"`
	IosAppExtension     *int32                   `protobuf:"varint,30,opt,name=ios_app_extension,json=iosAppExtension,enum=int32" json:"ios_app_extension,omitempty"`
	FbAppId             *uint64                  `protobuf:"varint,31,opt,name=fb_app_id,json=fbAppId" json:"fb_app_id,omitempty"`
	// 128-bit UUID https://www.internalfb.com/intern/wiki/How-do-we-uniquely-identify-devices/device-id/
	FbDeviceId           []byte   `protobuf:"bytes,32,opt,name=fb_device_id,json=fbDeviceId" json:"fb_device_id,omitempty"`
	YearClass            *int32   `protobuf:"varint,36,opt,name=ok_36,json=ok36" json:"ok_36,omitempty"`
	MemClass             *int32   `protobuf:"varint,37,opt,name=ok_37,json=ok37" json:"ok_37,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

type ClientPayload_DnsSource

type ClientPayload_DnsSource struct {
	DnsMethod            *int32   `protobuf:"varint,15,opt,name=dnsMethod,enum=int32" json:"dnsMethod,omitempty"`
	AppCached            *bool    `protobuf:"varint,16,opt,name=appCached" json:"appCached,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

type ClientPayload_UserAgent

type ClientPayload_UserAgent struct {
	Platform                    *int32                              `protobuf:"varint,1,opt,name=platform,enum=int32" json:"platform,omitempty"`
	AppVersion                  *ClientPayload_UserAgent_AppVersion `protobuf:"bytes,2,opt,name=app_version,json=appVersion" json:"app_version,omitempty"`
	Mcc                         *string                             `protobuf:"bytes,3,opt,name=mcc" json:"mcc,omitempty"`
	Mnc                         *string                             `protobuf:"bytes,4,opt,name=mnc" json:"mnc,omitempty"`
	OsVersion                   *string                             `protobuf:"bytes,5,opt,name=os_version,json=osVersion" json:"os_version,omitempty"`
	Manufacturer                *string                             `protobuf:"bytes,6,opt,name=manufacturer" json:"manufacturer,omitempty"`
	Device                      *string                             `protobuf:"bytes,7,opt,name=device" json:"device,omitempty"`
	OsBuildNumber               *string                             `protobuf:"bytes,8,opt,name=os_build_number,json=osBuildNumber" json:"os_build_number,omitempty"`
	PhoneId                     *string                             `protobuf:"bytes,9,opt,name=phone_id,json=phoneId" json:"phone_id,omitempty"`
	ReleaseChannel              *int32                              `protobuf:"varint,10,opt,name=release_channel,json=releaseChannel,enum=int32" json:"release_channel,omitempty"`
	LocaleLanguageIso6391       *string                             `protobuf:"bytes,11,opt,name=locale_language_iso_639_1,json=localeLanguageIso6391" json:"locale_language_iso_639_1,omitempty"`
	LocaleCountryIso31661Alpha2 *string                             `` /* 146-byte string literal not displayed */
	XXX_NoUnkeyedLiteral        struct{}                            `json:"-"`
	XXX_unrecognized            []byte                              `json:"-"`
	XXX_sizecache               int32                               `json:"-"`
}

type ClientPayload_UserAgent_AppVersion

type ClientPayload_UserAgent_AppVersion struct {
	Primary              *uint32  `protobuf:"varint,1,opt,name=primary" json:"primary,omitempty"`
	Secondary            *uint32  `protobuf:"varint,2,opt,name=secondary" json:"secondary,omitempty"`
	Tertiary             *uint32  `protobuf:"varint,3,opt,name=tertiary" json:"tertiary,omitempty"`
	Quaternary           *uint32  `protobuf:"varint,4,opt,name=quaternary" json:"quaternary,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

type ClientPayload_WebInfo

type ClientPayload_WebInfo struct {
	RefToken             *string                            `protobuf:"bytes,1,opt,name=ref_token,json=refToken" json:"ref_token,omitempty"`
	Version              *string                            `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
	WebdPayload          *ClientPayload_WebInfo_WebdPayload `protobuf:"bytes,3,opt,name=webd_payload,json=webdPayload" json:"webd_payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                           `json:"-"`
	XXX_unrecognized     []byte                             `json:"-"`
	XXX_sizecache        int32                              `json:"-"`
}

type ClientPayload_WebInfo_WebdPayload

type ClientPayload_WebInfo_WebdPayload struct {
	UsesParticipantInKey     *bool    `protobuf:"varint,1,opt,name=uses_participant_in_key,json=usesParticipantInKey" json:"uses_participant_in_key,omitempty"`
	SupportsStarredMessages  *bool    `` /* 126-byte string literal not displayed */
	SupportsDocumentMessages *bool    `` /* 129-byte string literal not displayed */
	SupportsUrlMessages      *bool    `protobuf:"varint,4,opt,name=supports_url_messages,json=supportsUrlMessages" json:"supports_url_messages,omitempty"`
	SupportsMediaRetry       *bool    `protobuf:"varint,5,opt,name=supports_media_retry,json=supportsMediaRetry" json:"supports_media_retry,omitempty"`
	SupportsE2EImage         *bool    `protobuf:"varint,6,opt,name=supports_e2e_image,json=supportsE2eImage" json:"supports_e2e_image,omitempty"`
	SupportsE2EVideo         *bool    `protobuf:"varint,7,opt,name=supports_e2e_video,json=supportsE2eVideo" json:"supports_e2e_video,omitempty"`
	SupportsE2EAudio         *bool    `protobuf:"varint,8,opt,name=supports_e2e_audio,json=supportsE2eAudio" json:"supports_e2e_audio,omitempty"`
	SupportsE2EDocument      *bool    `protobuf:"varint,9,opt,name=supports_e2e_document,json=supportsE2eDocument" json:"supports_e2e_document,omitempty"`
	DocumentTypes            *string  `protobuf:"bytes,10,opt,name=document_types,json=documentTypes" json:"document_types,omitempty"`
	XXX_NoUnkeyedLiteral     struct{} `json:"-"`
	XXX_unrecognized         []byte   `json:"-"`
	XXX_sizecache            int32    `json:"-"`
}

type DHKey

type DHKey struct {
	Private []byte
	Public  []byte
}

type LoginDto

type LoginDto struct {
	// socks 5 代理
	UUID           string
	Socks5         string
	AuthBody       *AuthDataDto
	AuthBodyActual *AuthDataDtoActual
	// AuthHexData 握手认证数据
	AuthHexData string
	// StaticPriKey 认证私钥
	StaticPriKey string
	// StaticPubKey 认证公钥
	StaticPubKey string
	//注册返回
	ClientStaticKeypair string
	//EdgeRouting
	EdgeRouting string
	//
	IdentityPubKey string
	IdentityPriKey string
	Hash           string
}

LoginDto 登录信息

func (*LoginDto) Init

func (loginDto *LoginDto) Init()

type VerifyCallbackFunc

type VerifyCallbackFunc func(publicKey []byte, data []byte) error

type Version42

type Version42 struct {
	Primary    uint32
	Secondary  uint32
	Tertiary   uint32
	Quaternary uint32
}

func GetVersion42

func GetVersion42() *Version42

type WAHandshakeSettings

type WAHandshakeSettings struct {
	RoutingInfo []byte
	//认证数据
	Payload []byte //certificates, signs etc
	// 用户注册时生成的公私秘钥
	StaticKey DHKey
	// 服务器公钥
	PeerStatic []byte
}

type WAProtocolVersion

type WAProtocolVersion struct {
	// 主要版本
	VersionMajor byte
	// 次要版本
	VersionMinor byte
}

WAProtocolVersion noise 握手版本

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL