From f8d9841755b579f7c95ed918d23b767e3854553a Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Sat, 1 Apr 2023 15:20:48 +0800 Subject: [PATCH] update default protocol version & pass through app version for T544 signer --- client/builders.go | 12 ++++++------ client/internal/auth/auth.go | 28 ++++++++++++++-------------- internal/tlv/t544.go | 12 ++++++------ wrapper/codec.go | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/client/builders.go b/client/builders.go index 562d7ccd..b8ac9201 100644 --- a/client/builders.go +++ b/client/builders.go @@ -103,7 +103,7 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) { tlv.T525(tlv.T536([]byte{0x01, 0x00})), ) if wrapper.DandelionEnergy != nil { - if t544 := tlv.T544v2(uint64(c.Uin), "810_9", 9, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544v2(uint64(c.Uin), "810_9", 9, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } @@ -309,7 +309,7 @@ func (c *QQClient) buildCaptchaPacket(result string, sign []byte) (uint16, []byt t.Append(tlv.T(0x547, c.sig.T547)) } if wrapper.DandelionEnergy != nil { - if t544 := tlv.T544(uint64(c.Uin), "810_2", 2, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544(uint64(c.Uin), "810_2", 2, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } @@ -364,7 +364,7 @@ func (c *QQClient) buildSMSCodeSubmitPacket(code string) (uint16, []byte) { }, } if wrapper.DandelionEnergy != nil { - if t544 := tlv.T544(uint64(c.Uin), "810_7", 7, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544(uint64(c.Uin), "810_7", 7, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } @@ -395,7 +395,7 @@ func (c *QQClient) buildTicketSubmitPacket(ticket string) (uint16, []byte) { t.Append(tlv.T(0x547, c.sig.T547)) } if wrapper.DandelionEnergy != nil { - if t544 := tlv.T544(uint64(c.Uin), "810_2", 2, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544(uint64(c.Uin), "810_2", 2, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } @@ -461,7 +461,7 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) { } if wrapper.DandelionEnergy != nil { - if t544 := tlv.T544v2(uint64(c.Uin), "810_f", 15, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544v2(uint64(c.Uin), "810_f", 15, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } @@ -549,7 +549,7 @@ func (c *QQClient) buildRequestChangeSigPacket(changeD2 bool) (uint16, []byte) { tlv.T202(c.Device().WifiBSSID, c.Device().WifiSSID), ) if wrapper.DandelionEnergy != nil && t.Command == 10 { - if t544 := tlv.T544v2(uint64(c.Uin), "810_a", 10, c.version().SdkVersion, c.Device().Guid, wrapper.DandelionEnergy); t544 != nil { + if t544 := tlv.T544v2(uint64(c.Uin), "810_a", 10, c.version().SdkVersion, c.Device().Guid, c.version().SortVersionName, wrapper.DandelionEnergy); t544 != nil { t.Append(t544) } } diff --git a/client/internal/auth/auth.go b/client/internal/auth/auth.go index 1ee577d8..6415a926 100644 --- a/client/internal/auth/auth.go +++ b/client/internal/auth/auth.go @@ -25,13 +25,13 @@ var ( AppVersions = map[ProtocolType]*AppVersion{ AndroidPhone: { ApkId: "com.tencent.mobileqq", - AppId: 537151682, - SubAppId: 537151682, + AppId: 537153294, + SubAppId: 537153294, AppKey: "0S200MNJT807V3GE", - SortVersionName: "8.9.33.10335", - BuildTime: 1673599898, + SortVersionName: "8.9.35.10440", + BuildTime: 1676531414, ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D}, - SdkVersion: "6.0.0.2534", + SdkVersion: "6.0.0.2535", SSOVersion: 19, MiscBitmap: 150470524, SubSigmap: 0x10400, @@ -42,13 +42,13 @@ var ( }, AndroidPad: { ApkId: "com.tencent.mobileqq", - AppId: 537151218, - SubAppId: 537151218, + AppId: 537152242, + SubAppId: 537152242, AppKey: "0S200MNJT807V3GE", - SortVersionName: "8.9.33.10335", - BuildTime: 1673599898, + SortVersionName: "8.9.35.10440", + BuildTime: 1676531414, ApkSign: []byte{0xA6, 0xB7, 0x45, 0xBF, 0x24, 0xA2, 0xC2, 0x77, 0x52, 0x77, 0x16, 0xF6, 0xF3, 0x6E, 0xB6, 0x8D}, - SdkVersion: "6.0.0.2534", + SdkVersion: "6.0.0.2535", SSOVersion: 19, MiscBitmap: 150470524, SubSigmap: 0x10400, @@ -75,13 +75,13 @@ var ( }, IPad: { ApkId: "com.tencent.minihd.qq", - AppId: 537118796, - SubAppId: 537118796, - SortVersionName: "5.9.3", + AppId: 537151363, + SubAppId: 537151363, + SortVersionName: "8.9.33.614", BuildTime: 1595836208, ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199}, SdkVersion: "6.0.0.2433", - SSOVersion: 12, + SSOVersion: 19, MiscBitmap: 150470524, SubSigmap: 66560, MainSigMap: WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST | WLOGIN_SKEY | WLOGIN_VKEY | WLOGIN_D2 | WLOGIN_SID | WLOGIN_PSKEY, // 1970400 diff --git a/internal/tlv/t544.go b/internal/tlv/t544.go index 8e3e3221..7829f3f5 100644 --- a/internal/tlv/t544.go +++ b/internal/tlv/t544.go @@ -4,17 +4,17 @@ import "github.com/Mrs4s/MiraiGo/binary" // temporary solution -func T544(userId uint64, moduleId string, subCmd uint32, sdkVersion string, guid []byte, signer func(uint64, string, []byte) ([]byte, error)) []byte { +func T544(userId uint64, moduleId string, subCmd uint32, sdkVersion string, guid []byte, appVersion string, signer func(uint64, string, string, []byte) ([]byte, error)) []byte { salt := binary.NewWriterF(func(w *binary.Writer) { w.WriteUInt64(userId) w.WriteBytesShort(guid) w.WriteBytesShort([]byte(sdkVersion)) w.WriteUInt32(subCmd) }) - return T544Custom(userId, moduleId, salt, signer) + return T544Custom(userId, moduleId, appVersion, salt, signer) } -func T544v2(userId uint64, moduleId string, subCmd uint32, sdkVersion string, guid []byte, signer func(uint64, string, []byte) ([]byte, error)) []byte { +func T544v2(userId uint64, moduleId string, subCmd uint32, sdkVersion string, guid []byte, appVersion string, signer func(uint64, string, string, []byte) ([]byte, error)) []byte { salt := binary.NewWriterF(func(w *binary.Writer) { // w.Write(binary.NewWriterF(func(w *binary.Writer) { w.WriteUInt64(userId) })[:4]) w.WriteUInt32(0) @@ -23,11 +23,11 @@ func T544v2(userId uint64, moduleId string, subCmd uint32, sdkVersion string, gu w.WriteUInt32(subCmd) w.WriteUInt32(0) }) - return T544Custom(userId, moduleId, salt, signer) + return T544Custom(userId, moduleId, appVersion, salt, signer) } -func T544Custom(userId uint64, moduleId string, salt []byte, signer func(uint64, string, []byte) ([]byte, error)) []byte { - sign, err := signer(userId, moduleId, salt) +func T544Custom(userId uint64, moduleId string, appVersion string, salt []byte, signer func(uint64, string, string, []byte) ([]byte, error)) []byte { + sign, err := signer(userId, moduleId, appVersion, salt) if err != nil { return nil } diff --git a/wrapper/codec.go b/wrapper/codec.go index b0b9055f..1cbb6706 100644 --- a/wrapper/codec.go +++ b/wrapper/codec.go @@ -1,3 +1,3 @@ package wrapper -var DandelionEnergy func(uint64, string, []byte) ([]byte, error) +var DandelionEnergy func(uint64, string, string, []byte) ([]byte, error)