Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToFloat32(bytes []byte) float32
- func BytesToFloat64(bytes []byte) float64
- func BytesToInt16(bytes []byte) int16
- func BytesToInt32(bytes []byte) int32
- func BytesToInt64(bytes []byte) int64
- func Float32ToByte(float float32) []byte
- func Float64ToByte(float float64) []byte
- func GetSliderTicket() string
- func Int16ToBytes(i int16) []byte
- func Int32ToBytes(i int32) []byte
- func Int64ToBytes(i int64) []byte
- func StartSliderCaptchaServer() ([]string, error)
- func TlvEncode(typeId uint16, data []byte) []byte
- func TlvRead(data []byte, tagSizeBitNum int) map[uint16][]byte
- func TlvType0x100Encode(ssoVersion uint32, appId uint32, subAppId uint32, appClientVersion uint32, ...) []byte
- func TlvType0x104Encode(data []byte) []byte
- func TlvType0x106Encode(uin uint32, hashSalt uint32, appId uint32, subAppId uint32, ...) []byte
- func TlvType0x107Encode(picType uint16) []byte
- func TlvType0x109Encode(androidId []byte) []byte
- func TlvType0x116Encode(bitmap uint32, subSigmap uint32) []byte
- func TlvType0x124Encode(osType []byte, osVersion []byte, simInfo []byte, address []byte, apn []byte) []byte
- func TlvType0x128Encode(isGuidFromFileNull bool, isGuidAvailable bool, isGuidChanged bool, ...) []byte
- func TlvType0x141Encode(simInfo []byte, apn []byte) []byte
- func TlvType0x142Encode(apkId []byte) []byte
- func TlvType0x144Encode(deviceInfo *DeviceInfo, isGuidFromFileNull bool, isGuidAvailable bool, ...) []byte
- func TlvType0x145Encode(guid []byte) []byte
- func TlvType0x147Encode(appId uint32, apkVersion []byte, apkSign []byte) []byte
- func TlvType0x154Encode(seqence uint16) []byte
- func TlvType0x16EEncode(model []byte) []byte
- func TlvType0x174Encode(data []byte) []byte
- func TlvType0x177Encode(buildTime uint32, sdkVersion string) []byte
- func TlvType0x17AEncode(SMSAppId uint32) []byte
- func TlvType0x17CEncode(SMSCode string) []byte
- func TlvType0x187Encode(macAddress []byte) []byte
- func TlvType0x188Encode(androidId []byte) []byte
- func TlvType0x18Encode(appId uint32, uin uint32) []byte
- func TlvType0x191Encode(canWebVerify byte) []byte
- func TlvType0x193Encode(ticket string) []byte
- func TlvType0x194Encode(imsiHash []byte) []byte
- func TlvType0x197Encode(data []byte) []byte
- func TlvType0x198Encode() []byte
- func TlvType0x1Encode(uin uint32, ip []byte) []byte
- func TlvType0x202Encode(wifiBSSID []byte, wifiSSID []byte) []byte
- func TlvType0x401Encode(data []byte) []byte
- func TlvType0x511Encode(domains []string) []byte
- func TlvType0x516Encode(sourceType uint32) []byte
- func TlvType0x521Encode(productType uint32) []byte
- func TlvType0x525Encode(type0x536 []byte) []byte
- func TlvType0x52DEncode(deviceInfo *DeviceInfo) []byte
- func TlvType0x536Encode(loginExtraData []byte) []byte
- func TlvType0x8Encode(localId uint32) []byte
- type AtElementStruct
- type DeviceInfo
- type ECDHKey
- type LoginResponse
- type NetworkPackStruct
- type OSVersion
- type OfflineImageElementStruct
- type Protocol
- type QQClient
- func (qqClient *QQClient) BuildClientRegisterPack() ([]byte, uint16)
- func (qqClient *QQClient) BuildConfigPushResponsePack(configType int32, configBytes []byte, configSeqence int64) ([]byte, uint16)
- func (qqClient *QQClient) BuildDeleteMessageRequestPack(deleteMessageList []*goqqprotobuf.MessageItem) ([]byte, uint16)
- func (qqClient *QQClient) BuildFriendListRequestPack(friendStartIndex uint16, friendListCount uint16, groupStartIndex uint8, ...) ([]byte, uint16)
- func (qqClient *QQClient) BuildGetMessageRequestPack(syncFlag uint32) ([]byte, uint16)
- func (qqClient *QQClient) BuildGroupListRequestPack(cookie []byte) ([]byte, uint16)
- func (qqClient *QQClient) BuildHeartBeatPack() ([]byte, uint16)
- func (qqClient *QQClient) BuildLoginDeviceLockPack() ([]byte, uint16)
- func (qqClient *QQClient) BuildLoginPack() ([]byte, uint16)
- func (qqClient *QQClient) BuildLoginSMSRequestPack() ([]byte, uint16)
- func (qqClient *QQClient) BuildLoginSMSSubmitPack(SMSCode string) ([]byte, uint16)
- func (qqClient *QQClient) BuildLoginSliderSendPack(ticket string) ([]byte, uint16)
- func (qqClient *QQClient) BuildNetworkPack(requestType uint32, encryptType byte, seqence uint16, uin int64, ...) []byte
- func (qqClient *QQClient) BuildOnlinePushMessageRequestPack(uin int64, seqence uint16, serverIp int32, pushToken []byte, ...) ([]byte, uint16)
- func (qqClient *QQClient) BuildRequestPack(uin int64, command uint16, encryptMethod uint8, body []byte) []byte
- func (qqClient *QQClient) ClientRegister() error
- func (qqClient *QQClient) Connect() error
- func (qqClient *QQClient) DecodeFriendGroupListResponse(data []byte) (uint16, []*goqqjce.FriendInfoStruct)
- func (qqClient *QQClient) DecodeGetMessageRequestPack(data []byte)
- func (qqClient *QQClient) DecodeGroupListResponse(data []byte) ([]*goqqjce.TroopNumStruct, []byte)
- func (qqClient *QQClient) DecodeLoginResponse(data []byte) *LoginResponse
- func (qqClient *QQClient) DecodeLoginResponseNetworkPack(netpackStruct *NetworkPackStruct) *LoginResponse
- func (qqClient *QQClient) DecodeLoginResponseSuccessTlv(payload []byte)
- func (qqClient *QQClient) DecodeNetworkPack(data []byte) (*NetworkPackStruct, error)
- func (qqClient *QQClient) DecodeRegisterResponse(data []byte) error
- func (qqClient *QQClient) DecodeResponsePack(data []byte) (uint16, int64, []byte)
- func (qqClient *QQClient) FindFriend(uin int64) (bool, string)
- func (qqClient *QQClient) GetFriendList() []*goqqjce.FriendInfoStruct
- func (qqClient *QQClient) GetGroupList() []*goqqjce.TroopNumStruct
- func (qqClient *QQClient) GetMessage(syncFlag uint32)
- func (qqClient *QQClient) HandleConfigPushRequest(data []byte)
- func (qqClient *QQClient) HandleOnlinePushRequest(netpack *NetworkPackStruct)
- func (qqClient *QQClient) HandlePushNotifyRequest(netpack *NetworkPackStruct)
- func (qqClient *QQClient) HeartBeat()
- func (qqClient *QQClient) Init() error
- func (qqClient *QQClient) Login(method uint16) (*LoginResponse, error)
- func (qqClient *QQClient) NextSeqence() uint16
- func (qqClient *QQClient) PackRecvLoop()
- func (qqClient *QQClient) PrivateMessageDecoder(pairMessage *goqqprotobuf.Message) *UniformMessageStruct
- func (qqClient *QQClient) ProcessMessage(pairMessage *goqqprotobuf.Message) *UniformMessageStruct
- func (qqClient *QQClient) RecvPack(seqence uint16) *NetworkPackStruct
- func (qqClient *QQClient) RequestSMSCode() bool
- func (qqClient *QQClient) SendPack(pack []byte, seqence uint16) uint16
- func (qqClient *QQClient) SubmitSMSCode(SMSCode string) (*LoginResponse, error)
- func (qqClient *QQClient) SubmitSliderTicket(ticket string) *LoginResponse
- func (qqClient *QQClient) SyncMessage(responseStruct *goqqprotobuf.GetMessageResponseStruct)
- type ReplyElementStruct
- type SafeInt32
- type TextElementStruct
- type Token
- type UniformMessageStruct
- type UniformRichTextElementStruct
- type VoiceMessageStruct
Constants ¶
View Source
const ( MessageSyncFlagStart uint32 = 0x00 MessageSyncFlagContinue uint32 = 0x01 MessageSyncFlagStop uint32 = 0x02 )
View Source
const ( MessageTypeVoice uint16 = 0x01 MessageTypeRichText uint16 = 0x02 )
View Source
const ( RichTextElementTypeReply uint16 = 0x01 RichTextElementTypeAtAll uint16 = 0x02 RichTextElementTypeAt uint16 = 0x03 RichTextElementTypeText uint16 = 0x03 RichTextElementTypeOfflineImage uint16 = 0x04 )
View Source
const ( RequestEncryptEMECDH uint8 = 0x00 RequestEncryptEMST uint8 = 0x01 NetpackRequestTypeLogin uint32 = 0x0A NetpackRequestTypeSimple uint32 = 0x0B NetpackEncryptNoEncrypt byte = 0x00 NetpackEncryptD2Key byte = 0x01 NetpackEncryptEmptyKey byte = 0x02 GetMessageSyncFlagStart uint32 = 0 GetMessageSyncFlagContinue uint32 = 1 GetMessageSyncFlagStop uint32 = 2 )
View Source
const ( LoginResponseNeedSlider uint16 = 1 LoginResponseNeedSMS uint16 = 2 LoginResponseNeedWebVerify uint16 = 3 LoginResponseOtherError uint16 = 4 )
View Source
const (
LoginMethodPassword uint16 = 0
)
Variables ¶
View Source
var ( ErrorNoServerIsReachable = errors.New("error: No server is reachable") ErrorPackLengthError = errors.New("error: Pack length error") )
View Source
var ( IPad = Protocol{ ApkId: "com.tencent.minihd.qq", AppId: 16, SubAppId: 537097188, Version: "8.8.35", ApkSign: []byte{0xAA, 0x39, 0x78, 0xE0, 0x1F, 0xD9, 0x6F, 0xF9, 0x91, 0x4A, 0x66, 0x9E, 0x18, 0x64, 0x74, 0xC7}, BuildTime: 1595836208, SdkVersion: "6.0.0.2433", SsoVersion: 12, Bitmap: 150470524, MainSigmap: 1970400, SubSigmap: 0x10400, Name: "IPad", } ProtocolMap = map[string]*Protocol{ "IPad": &IPad, } )
View Source
var (
ErrNoIpAvailable = errors.New("error: No ip available")
)
Functions ¶
func BytesToFloat32 ¶
func BytesToFloat64 ¶
func BytesToInt16 ¶
func BytesToInt32 ¶
func BytesToInt64 ¶
func Float32ToByte ¶
func Float64ToByte ¶
func GetSliderTicket ¶
func GetSliderTicket() string
func Int16ToBytes ¶
func Int32ToBytes ¶
func Int64ToBytes ¶
func TlvType0x100Encode ¶
func TlvType0x104Encode ¶
func TlvType0x106Encode ¶
func TlvType0x107Encode ¶
func TlvType0x109Encode ¶
func TlvType0x116Encode ¶
func TlvType0x124Encode ¶
func TlvType0x128Encode ¶
func TlvType0x141Encode ¶
func TlvType0x142Encode ¶
func TlvType0x144Encode ¶
func TlvType0x144Encode(deviceInfo *DeviceInfo, isGuidFromFileNull bool, isGuidAvailable bool, isGuidChanged bool) []byte
func TlvType0x145Encode ¶
func TlvType0x147Encode ¶
func TlvType0x154Encode ¶
func TlvType0x16EEncode ¶
func TlvType0x174Encode ¶
func TlvType0x177Encode ¶
func TlvType0x17AEncode ¶
func TlvType0x17CEncode ¶
func TlvType0x187Encode ¶
func TlvType0x188Encode ¶
func TlvType0x18Encode ¶
func TlvType0x191Encode ¶
func TlvType0x193Encode ¶
func TlvType0x194Encode ¶
func TlvType0x197Encode ¶
func TlvType0x198Encode ¶
func TlvType0x198Encode() []byte
func TlvType0x1Encode ¶
func TlvType0x202Encode ¶
func TlvType0x401Encode ¶
func TlvType0x511Encode ¶
func TlvType0x516Encode ¶
func TlvType0x521Encode ¶
func TlvType0x525Encode ¶
func TlvType0x52DEncode ¶
func TlvType0x52DEncode(deviceInfo *DeviceInfo) []byte
func TlvType0x536Encode ¶
func TlvType0x8Encode ¶
Types ¶
type AtElementStruct ¶
type DeviceInfo ¶
type DeviceInfo struct { Product string Device string Board string Brand string Model string Bootloader string BootId string ProcVersion string BaseBand string VendorName string VendorOSName string MacAddress string IpAddress []byte WIFISSID string IMEI string AndroidId string FingerPrint string SimInfo string OsType string Apn string Guid []byte TgtgtKey []byte ImsiHash []byte Version OSVersion Protocol *Protocol }
func NewDevice ¶
func NewDevice() *DeviceInfo
func (*DeviceInfo) FromJson ¶
func (deviceInfo *DeviceInfo) FromJson(data []byte) error
func (*DeviceInfo) ToJson ¶
func (deviceInfo *DeviceInfo) ToJson() []byte
type LoginResponse ¶
type NetworkPackStruct ¶
type QQClient ¶
type QQClient struct { Uin int64 PaswordHash [16]byte Device *DeviceInfo SsoServerList []goqqjce.SsoServerInfoStruct ResponsePackLock sync.Mutex ResponsePackNotHandledMap map[uint16]*NetworkPackStruct ResponsePackWaitChannelMap map[uint16]chan *NetworkPackStruct Connected bool Conn net.Conn PackageSequenceId *SafeInt32 FriendSeqenceId *SafeInt32 SessionId []byte Ksid []byte Token *Token WtSessionTicketKey []byte ECDHKey *ECDHKey RandomKey []byte Age byte Sex byte NickName string FriendList []*goqqjce.FriendInfoStruct IsInit bool SyncCookie []byte PublicAccountCookie []byte Online bool }
func NewClient ¶
func NewClient(uin int64, paswordHash [16]byte, device *DeviceInfo) (*QQClient, error)
func (*QQClient) BuildClientRegisterPack ¶
func (*QQClient) BuildConfigPushResponsePack ¶
func (*QQClient) BuildDeleteMessageRequestPack ¶
func (qqClient *QQClient) BuildDeleteMessageRequestPack(deleteMessageList []*goqqprotobuf.MessageItem) ([]byte, uint16)
func (*QQClient) BuildFriendListRequestPack ¶
func (*QQClient) BuildGetMessageRequestPack ¶
func (*QQClient) BuildGroupListRequestPack ¶
func (*QQClient) BuildHeartBeatPack ¶
func (*QQClient) BuildLoginDeviceLockPack ¶
func (*QQClient) BuildLoginPack ¶
func (*QQClient) BuildLoginSMSRequestPack ¶
func (*QQClient) BuildLoginSMSSubmitPack ¶
func (*QQClient) BuildLoginSliderSendPack ¶
func (*QQClient) BuildNetworkPack ¶
func (*QQClient) BuildOnlinePushMessageRequestPack ¶
func (*QQClient) BuildRequestPack ¶
func (*QQClient) ClientRegister ¶
func (*QQClient) DecodeFriendGroupListResponse ¶
func (qqClient *QQClient) DecodeFriendGroupListResponse(data []byte) (uint16, []*goqqjce.FriendInfoStruct)
func (*QQClient) DecodeGetMessageRequestPack ¶
func (*QQClient) DecodeGroupListResponse ¶
func (qqClient *QQClient) DecodeGroupListResponse(data []byte) ([]*goqqjce.TroopNumStruct, []byte)
func (*QQClient) DecodeLoginResponse ¶
func (qqClient *QQClient) DecodeLoginResponse(data []byte) *LoginResponse
func (*QQClient) DecodeLoginResponseNetworkPack ¶
func (qqClient *QQClient) DecodeLoginResponseNetworkPack(netpackStruct *NetworkPackStruct) *LoginResponse
func (*QQClient) DecodeLoginResponseSuccessTlv ¶
func (*QQClient) DecodeNetworkPack ¶
func (qqClient *QQClient) DecodeNetworkPack(data []byte) (*NetworkPackStruct, error)
func (*QQClient) DecodeRegisterResponse ¶
func (*QQClient) DecodeResponsePack ¶
func (*QQClient) GetFriendList ¶
func (qqClient *QQClient) GetFriendList() []*goqqjce.FriendInfoStruct
func (*QQClient) GetGroupList ¶
func (qqClient *QQClient) GetGroupList() []*goqqjce.TroopNumStruct
func (*QQClient) GetMessage ¶
func (*QQClient) HandleConfigPushRequest ¶
func (*QQClient) HandleOnlinePushRequest ¶
func (qqClient *QQClient) HandleOnlinePushRequest(netpack *NetworkPackStruct)
func (*QQClient) HandlePushNotifyRequest ¶
func (qqClient *QQClient) HandlePushNotifyRequest(netpack *NetworkPackStruct)
func (*QQClient) NextSeqence ¶
func (*QQClient) PackRecvLoop ¶
func (qqClient *QQClient) PackRecvLoop()
func (*QQClient) PrivateMessageDecoder ¶
func (qqClient *QQClient) PrivateMessageDecoder(pairMessage *goqqprotobuf.Message) *UniformMessageStruct
func (*QQClient) ProcessMessage ¶
func (qqClient *QQClient) ProcessMessage(pairMessage *goqqprotobuf.Message) *UniformMessageStruct
func (*QQClient) RecvPack ¶
func (qqClient *QQClient) RecvPack(seqence uint16) *NetworkPackStruct
func (*QQClient) RequestSMSCode ¶
func (*QQClient) SubmitSMSCode ¶
func (qqClient *QQClient) SubmitSMSCode(SMSCode string) (*LoginResponse, error)
func (*QQClient) SubmitSliderTicket ¶
func (qqClient *QQClient) SubmitSliderTicket(ticket string) *LoginResponse
func (*QQClient) SyncMessage ¶
func (qqClient *QQClient) SyncMessage(responseStruct *goqqprotobuf.GetMessageResponseStruct)
type ReplyElementStruct ¶
type ReplyElementStruct struct { ReplySeqence uint32 Time uint32 SenderUin int64 TargetUin int64 Elements []*UniformRichTextElementStruct }
type TextElementStruct ¶
type TextElementStruct struct {
Text string
}
type Token ¶
type Token struct { TlvType0x104Data []byte TlvType0x133Data []byte TlvType0x174Data []byte TlvType0x402Data []byte RansSeed []byte Dpwd []byte G []byte PsKeyMap map[string][]byte Pt4TokenMap map[string][]byte LoginBitMap uint32 SrmToken []byte Tgt []byte TgtKey []byte UserSTKey []byte UserSTWebSig []byte SKey []byte SKeyExpiredTime int64 D2 []byte D2Key []byte DeviceToken []byte }
type UniformMessageStruct ¶
type UniformMessageStruct struct { MessageType uint16 MessageSeqence uint32 Time uint32 TargetUin int64 SenderUin int64 SenderNickname string SenderIsFriend bool SelfUin int64 VoiceMessage VoiceMessageStruct RichTextMessage []*UniformRichTextElementStruct }
type UniformRichTextElementStruct ¶
type UniformRichTextElementStruct struct { RichTextElementType uint16 ReplyElement ReplyElementStruct AtElement AtElementStruct TextElement TextElementStruct OfflineImageElement OfflineImageElementStruct }
func DecodeRichTextElements ¶
func DecodeRichTextElements(elements []*goqqprotobuf.Element) []*UniformRichTextElementStruct
Source Files ¶
Click to show internal directories.
Click to hide internal directories.