mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
update transport
This commit is contained in:
parent
dab2c35f17
commit
19e3d17259
@ -25,36 +25,38 @@ var (
|
|||||||
AppVersions = map[ProtocolType]*AppVersion{
|
AppVersions = map[ProtocolType]*AppVersion{
|
||||||
AndroidPhone: {
|
AndroidPhone: {
|
||||||
ApkId: "com.tencent.mobileqq",
|
ApkId: "com.tencent.mobileqq",
|
||||||
AppId: 537153294,
|
AppId: 537164840,
|
||||||
SubAppId: 537153294,
|
SubAppId: 537164840,
|
||||||
AppKey: "0S200MNJT807V3GE",
|
AppKey: "0S200MNJT807V3GE",
|
||||||
SortVersionName: "8.9.35.10440",
|
SortVersionName: "8.9.63.11390",
|
||||||
BuildTime: 1676531414,
|
BuildTime: 1685069178,
|
||||||
ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D},
|
ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D},
|
||||||
SdkVersion: "6.0.0.2535",
|
SdkVersion: "6.0.0.2546",
|
||||||
SSOVersion: 19,
|
SSOVersion: 20,
|
||||||
MiscBitmap: 150470524,
|
MiscBitmap: 150470524,
|
||||||
SubSigmap: 0x10400,
|
SubSigmap: 0x10400,
|
||||||
MainSigMap: WLOGIN_A5 | WLOGIN_RESERVED | WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST |
|
MainSigMap: WLOGIN_A5 | WLOGIN_RESERVED | WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST |
|
||||||
WLOGIN_LSKEY | WLOGIN_SKEY | WLOGIN_SIG64 | 1<<16 | WLOGIN_VKEY | WLOGIN_D2 |
|
WLOGIN_LSKEY | WLOGIN_SKEY | WLOGIN_SIG64 | 1<<16 | WLOGIN_VKEY | WLOGIN_D2 |
|
||||||
WLOGIN_SID | WLOGIN_PSKEY | WLOGIN_AQSIG | WLOGIN_LHSIG | WLOGIN_PAYTOKEN, // 16724722
|
WLOGIN_SID | WLOGIN_PSKEY | WLOGIN_AQSIG | WLOGIN_LHSIG | WLOGIN_PAYTOKEN, // 16724722
|
||||||
|
QUA: "V1_AND_SQ_8.9.63_4194_YYB_D",
|
||||||
Protocol: AndroidPhone,
|
Protocol: AndroidPhone,
|
||||||
},
|
},
|
||||||
AndroidPad: {
|
AndroidPad: {
|
||||||
ApkId: "com.tencent.mobileqq",
|
ApkId: "com.tencent.mobileqq",
|
||||||
AppId: 537152242,
|
AppId: 537164888,
|
||||||
SubAppId: 537152242,
|
SubAppId: 537164888,
|
||||||
AppKey: "0S200MNJT807V3GE",
|
AppKey: "0S200MNJT807V3GE",
|
||||||
SortVersionName: "8.9.35.10440",
|
SortVersionName: "8.9.63.11390",
|
||||||
BuildTime: 1676531414,
|
BuildTime: 1685069178,
|
||||||
ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D},
|
ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D},
|
||||||
SdkVersion: "6.0.0.2535",
|
SdkVersion: "6.0.0.2546",
|
||||||
SSOVersion: 19,
|
SSOVersion: 20,
|
||||||
MiscBitmap: 150470524,
|
MiscBitmap: 150470524,
|
||||||
SubSigmap: 0x10400,
|
SubSigmap: 0x10400,
|
||||||
MainSigMap: WLOGIN_A5 | WLOGIN_RESERVED | WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST |
|
MainSigMap: WLOGIN_A5 | WLOGIN_RESERVED | WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST |
|
||||||
WLOGIN_LSKEY | WLOGIN_SKEY | WLOGIN_SIG64 | 1<<16 | WLOGIN_VKEY | WLOGIN_D2 |
|
WLOGIN_LSKEY | WLOGIN_SKEY | WLOGIN_SIG64 | 1<<16 | WLOGIN_VKEY | WLOGIN_D2 |
|
||||||
WLOGIN_SID | WLOGIN_PSKEY | WLOGIN_AQSIG | WLOGIN_LHSIG | WLOGIN_PAYTOKEN, // 16724722
|
WLOGIN_SID | WLOGIN_PSKEY | WLOGIN_AQSIG | WLOGIN_LHSIG | WLOGIN_PAYTOKEN, // 16724722
|
||||||
|
QUA: "V1_AND_SQ_8.9.63_4194_YYB_D",
|
||||||
Protocol: AndroidPad,
|
Protocol: AndroidPad,
|
||||||
},
|
},
|
||||||
AndroidWatch: {
|
AndroidWatch: {
|
||||||
@ -163,6 +165,7 @@ type AppVersion struct {
|
|||||||
MiscBitmap uint32
|
MiscBitmap uint32
|
||||||
SubSigmap uint32
|
SubSigmap uint32
|
||||||
MainSigMap uint32
|
MainSigMap uint32
|
||||||
|
QUA string
|
||||||
Protocol ProtocolType
|
Protocol ProtocolType
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,5 +254,6 @@ type appVersionFile struct {
|
|||||||
MiscBitmap uint32 `json:"misc_bitmap"`
|
MiscBitmap uint32 `json:"misc_bitmap"`
|
||||||
MainSigMap uint32 `json:"main_sig_map"`
|
MainSigMap uint32 `json:"main_sig_map"`
|
||||||
SubSigmap uint32 `json:"sub_sig_map"`
|
SubSigmap uint32 `json:"sub_sig_map"`
|
||||||
|
QUA string `json:"qua"`
|
||||||
ProtocolType ProtocolType `json:"protocol_type"`
|
ProtocolType ProtocolType `json:"protocol_type"`
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package network
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
"github.com/Mrs4s/MiraiGo/client/internal/auth"
|
"github.com/Mrs4s/MiraiGo/client/internal/auth"
|
||||||
@ -21,6 +22,96 @@ type Transport struct {
|
|||||||
// conn *TCPClient
|
// conn *TCPClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var WhiteListCommands = `
|
||||||
|
ConnAuthSvr.fast_qq_login
|
||||||
|
ConnAuthSvr.sdk_auth_api
|
||||||
|
ConnAuthSvr.sdk_auth_api_emp
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoBarrage
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoComment
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoFollow
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoLike
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoPush
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.DoReply
|
||||||
|
FeedCloudSvr.trpc.feedcloud.commwriter.ComWriter.PublishFeed
|
||||||
|
FeedCloudSvr.trpc.videocircle.circleprofile.CircleProfile.SetProfile
|
||||||
|
friendlist.addFriend
|
||||||
|
friendlist.AddFriendReq
|
||||||
|
friendlist.ModifyGroupInfoReq
|
||||||
|
MessageSvc.PbSendMsg
|
||||||
|
MsgProxy.SendMsg
|
||||||
|
OidbSvc.0x4ff_9
|
||||||
|
OidbSvc.0x4ff_9_IMCore
|
||||||
|
OidbSvc.0x56c_6
|
||||||
|
OidbSvc.0x6d9_4
|
||||||
|
OidbSvc.0x758
|
||||||
|
OidbSvc.0x758_0
|
||||||
|
OidbSvc.0x758_1
|
||||||
|
OidbSvc.0x88d_0
|
||||||
|
OidbSvc.0x89a_0
|
||||||
|
OidbSvc.0x89b_1
|
||||||
|
OidbSvc.0x8a1_0
|
||||||
|
OidbSvc.0x8a1_7
|
||||||
|
OidbSvc.0x8ba
|
||||||
|
OidbSvc.0x9fa
|
||||||
|
OidbSvc.oidb_0x758
|
||||||
|
OidbSvcTrpcTcp.0x101e_1
|
||||||
|
OidbSvcTrpcTcp.0x101e_2
|
||||||
|
OidbSvcTrpcTcp.0x1100_1
|
||||||
|
OidbSvcTrpcTcp.0x1105_1
|
||||||
|
OidbSvcTrpcTcp.0x1107_1
|
||||||
|
OidbSvcTrpcTcp.0x55f_0
|
||||||
|
OidbSvcTrpcTcp.0x6d9_4
|
||||||
|
OidbSvcTrpcTcp.0xf55_1
|
||||||
|
OidbSvcTrpcTcp.0xf57_1
|
||||||
|
OidbSvcTrpcTcp.0xf57_106
|
||||||
|
OidbSvcTrpcTcp.0xf57_9
|
||||||
|
OidbSvcTrpcTcp.0xf65_1
|
||||||
|
OidbSvcTrpcTcp.0xf65_10
|
||||||
|
OidbSvcTrpcTcp.0xf67_1
|
||||||
|
OidbSvcTrpcTcp.0xf67_5
|
||||||
|
OidbSvcTrpcTcp.0xf6e_1
|
||||||
|
OidbSvcTrpcTcp.0xf88_1
|
||||||
|
OidbSvcTrpcTcp.0xf89_1
|
||||||
|
OidbSvcTrpcTcp.0xfa5_1
|
||||||
|
ProfileService.getGroupInfoReq
|
||||||
|
ProfileService.GroupMngReq
|
||||||
|
QChannelSvr.trpc.qchannel.commwriter.ComWriter.DoComment
|
||||||
|
QChannelSvr.trpc.qchannel.commwriter.ComWriter.DoReply
|
||||||
|
QChannelSvr.trpc.qchannel.commwriter.ComWriter.PublishFeed
|
||||||
|
qidianservice.135
|
||||||
|
qidianservice.207
|
||||||
|
qidianservice.269
|
||||||
|
qidianservice.290
|
||||||
|
SQQzoneSvc.addComment
|
||||||
|
SQQzoneSvc.addReply
|
||||||
|
SQQzoneSvc.forward
|
||||||
|
SQQzoneSvc.like
|
||||||
|
SQQzoneSvc.publishmood
|
||||||
|
SQQzoneSvc.shuoshuo
|
||||||
|
trpc.group_pro.msgproxy.sendmsg
|
||||||
|
trpc.login.ecdh.EcdhService.SsoNTLoginPasswordLoginUnusualDevice
|
||||||
|
trpc.o3.ecdh_access.EcdhAccess.SsoEstablishShareKey
|
||||||
|
trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Access
|
||||||
|
trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish
|
||||||
|
trpc.o3.ecdh_access.EcdhAccess.SsoSecureAccess
|
||||||
|
trpc.o3.report.Report.SsoReport
|
||||||
|
trpc.passwd.manager.PasswdManager.SetPasswd
|
||||||
|
trpc.passwd.manager.PasswdManager.VerifyPasswd
|
||||||
|
trpc.qlive.relationchain_svr.RelationchainSvr.Follow
|
||||||
|
trpc.qlive.word_svr.WordSvr.NewPublicChat
|
||||||
|
trpc.qqhb.qqhb_proxy.Handler.sso_handle
|
||||||
|
trpc.springfestival.redpacket.LuckyBag.SsoSubmitGrade
|
||||||
|
wtlogin.device_lock
|
||||||
|
wtlogin.exchange_emp
|
||||||
|
wtlogin.login
|
||||||
|
wtlogin.name2uin
|
||||||
|
wtlogin.qrlogin
|
||||||
|
wtlogin.register
|
||||||
|
wtlogin.trans_emp
|
||||||
|
wtlogin_device.login
|
||||||
|
wtlogin_device.tran_sim_emp
|
||||||
|
`
|
||||||
|
|
||||||
func (t *Transport) packBody(req *Request, w *binary.Writer) {
|
func (t *Transport) packBody(req *Request, w *binary.Writer) {
|
||||||
pos := w.FillUInt32()
|
pos := w.FillUInt32()
|
||||||
if req.Type == RequestTypeLogin {
|
if req.Type == RequestTypeLogin {
|
||||||
@ -45,12 +136,8 @@ func (t *Transport) packBody(req *Request, w *binary.Writer) {
|
|||||||
|
|
||||||
w.WriteUInt16(uint16(len(t.Sig.Ksid)) + 2)
|
w.WriteUInt16(uint16(len(t.Sig.Ksid)) + 2)
|
||||||
w.Write(t.Sig.Ksid)
|
w.Write(t.Sig.Ksid)
|
||||||
|
|
||||||
secSign := t.PackSecSign(req)
|
|
||||||
w.WriteUInt32(uint32(len(secSign) + 4))
|
|
||||||
w.Write(secSign)
|
|
||||||
}
|
}
|
||||||
if wrapper.AllowSignSendMsg != nil && wrapper.AllowSignSendMsg() && req.CommandName == "MessageSvc.PbSendMsg" {
|
if strings.Contains(WhiteListCommands, req.CommandName) {
|
||||||
secSign := t.PackSecSign(req)
|
secSign := t.PackSecSign(req)
|
||||||
w.WriteUInt32(uint32(len(secSign) + 4))
|
w.WriteUInt32(uint32(len(secSign) + 4))
|
||||||
w.Write(secSign)
|
w.Write(secSign)
|
||||||
@ -69,7 +156,10 @@ func (t *Transport) PackSecSign(req *Request) []byte {
|
|||||||
if wrapper.FekitGetSign == nil {
|
if wrapper.FekitGetSign == nil {
|
||||||
return []byte{}
|
return []byte{}
|
||||||
}
|
}
|
||||||
sign, extra, token, err := wrapper.FekitGetSign(uint64(req.SequenceID), strconv.FormatInt(req.Uin, 10), req.CommandName, "V1_AND_SQ_8.9.50_3898_YYB_D", req.Body)
|
sign, extra, token, err := wrapper.FekitGetSign(uint64(req.SequenceID), strconv.FormatInt(req.Uin, 10), req.CommandName, t.Version.QUA, req.Body)
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}
|
||||||
|
}
|
||||||
m := &pb.SSOReserveField{
|
m := &pb.SSOReserveField{
|
||||||
Flag: 0,
|
Flag: 0,
|
||||||
Qimei: t.Device.QImei16,
|
Qimei: t.Device.QImei16,
|
||||||
|
@ -3,5 +3,3 @@ package wrapper
|
|||||||
var DandelionEnergy func(uint64, string, string, []byte) ([]byte, error)
|
var DandelionEnergy func(uint64, string, string, []byte) ([]byte, error)
|
||||||
|
|
||||||
var FekitGetSign func(uint64, string, string, string, []byte) ([]byte, []byte, []byte, error)
|
var FekitGetSign func(uint64, string, string, string, []byte) ([]byte, []byte, []byte, error)
|
||||||
|
|
||||||
var AllowSignSendMsg func() bool
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user