1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

update default protocol version & pass through app version for T544 signer

This commit is contained in:
Mrs4s 2023-04-01 15:20:48 +08:00
parent 62d60f1322
commit f8d9841755
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
4 changed files with 27 additions and 27 deletions

View File

@ -103,7 +103,7 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) {
tlv.T525(tlv.T536([]byte{0x01, 0x00})), tlv.T525(tlv.T536([]byte{0x01, 0x00})),
) )
if wrapper.DandelionEnergy != nil { 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) 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)) t.Append(tlv.T(0x547, c.sig.T547))
} }
if wrapper.DandelionEnergy != nil { 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) t.Append(t544)
} }
} }
@ -364,7 +364,7 @@ func (c *QQClient) buildSMSCodeSubmitPacket(code string) (uint16, []byte) {
}, },
} }
if wrapper.DandelionEnergy != nil { 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) t.Append(t544)
} }
} }
@ -395,7 +395,7 @@ func (c *QQClient) buildTicketSubmitPacket(ticket string) (uint16, []byte) {
t.Append(tlv.T(0x547, c.sig.T547)) t.Append(tlv.T(0x547, c.sig.T547))
} }
if wrapper.DandelionEnergy != nil { 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) t.Append(t544)
} }
} }
@ -461,7 +461,7 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
} }
if wrapper.DandelionEnergy != nil { 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) t.Append(t544)
} }
} }
@ -549,7 +549,7 @@ func (c *QQClient) buildRequestChangeSigPacket(changeD2 bool) (uint16, []byte) {
tlv.T202(c.Device().WifiBSSID, c.Device().WifiSSID), tlv.T202(c.Device().WifiBSSID, c.Device().WifiSSID),
) )
if wrapper.DandelionEnergy != nil && t.Command == 10 { 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) t.Append(t544)
} }
} }

View File

@ -25,13 +25,13 @@ var (
AppVersions = map[ProtocolType]*AppVersion{ AppVersions = map[ProtocolType]*AppVersion{
AndroidPhone: { AndroidPhone: {
ApkId: "com.tencent.mobileqq", ApkId: "com.tencent.mobileqq",
AppId: 537151682, AppId: 537153294,
SubAppId: 537151682, SubAppId: 537153294,
AppKey: "0S200MNJT807V3GE", AppKey: "0S200MNJT807V3GE",
SortVersionName: "8.9.33.10335", SortVersionName: "8.9.35.10440",
BuildTime: 1673599898, BuildTime: 1676531414,
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.2534", SdkVersion: "6.0.0.2535",
SSOVersion: 19, SSOVersion: 19,
MiscBitmap: 150470524, MiscBitmap: 150470524,
SubSigmap: 0x10400, SubSigmap: 0x10400,
@ -42,13 +42,13 @@ var (
}, },
AndroidPad: { AndroidPad: {
ApkId: "com.tencent.mobileqq", ApkId: "com.tencent.mobileqq",
AppId: 537151218, AppId: 537152242,
SubAppId: 537151218, SubAppId: 537152242,
AppKey: "0S200MNJT807V3GE", AppKey: "0S200MNJT807V3GE",
SortVersionName: "8.9.33.10335", SortVersionName: "8.9.35.10440",
BuildTime: 1673599898, BuildTime: 1676531414,
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.2534", SdkVersion: "6.0.0.2535",
SSOVersion: 19, SSOVersion: 19,
MiscBitmap: 150470524, MiscBitmap: 150470524,
SubSigmap: 0x10400, SubSigmap: 0x10400,
@ -75,13 +75,13 @@ var (
}, },
IPad: { IPad: {
ApkId: "com.tencent.minihd.qq", ApkId: "com.tencent.minihd.qq",
AppId: 537118796, AppId: 537151363,
SubAppId: 537118796, SubAppId: 537151363,
SortVersionName: "5.9.3", SortVersionName: "8.9.33.614",
BuildTime: 1595836208, BuildTime: 1595836208,
ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199}, ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199},
SdkVersion: "6.0.0.2433", SdkVersion: "6.0.0.2433",
SSOVersion: 12, SSOVersion: 19,
MiscBitmap: 150470524, MiscBitmap: 150470524,
SubSigmap: 66560, SubSigmap: 66560,
MainSigMap: WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST | WLOGIN_SKEY | WLOGIN_VKEY | WLOGIN_D2 | WLOGIN_SID | WLOGIN_PSKEY, // 1970400 MainSigMap: WLOGIN_STWEB | WLOGIN_A2 | WLOGIN_ST | WLOGIN_SKEY | WLOGIN_VKEY | WLOGIN_D2 | WLOGIN_SID | WLOGIN_PSKEY, // 1970400

View File

@ -4,17 +4,17 @@ import "github.com/Mrs4s/MiraiGo/binary"
// temporary solution // 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) { salt := binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt64(userId) w.WriteUInt64(userId)
w.WriteBytesShort(guid) w.WriteBytesShort(guid)
w.WriteBytesShort([]byte(sdkVersion)) w.WriteBytesShort([]byte(sdkVersion))
w.WriteUInt32(subCmd) 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) { salt := binary.NewWriterF(func(w *binary.Writer) {
// w.Write(binary.NewWriterF(func(w *binary.Writer) { w.WriteUInt64(userId) })[:4]) // w.Write(binary.NewWriterF(func(w *binary.Writer) { w.WriteUInt64(userId) })[:4])
w.WriteUInt32(0) w.WriteUInt32(0)
@ -23,11 +23,11 @@ func T544v2(userId uint64, moduleId string, subCmd uint32, sdkVersion string, gu
w.WriteUInt32(subCmd) w.WriteUInt32(subCmd)
w.WriteUInt32(0) 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 { func T544Custom(userId uint64, moduleId string, appVersion string, salt []byte, signer func(uint64, string, string, []byte) ([]byte, error)) []byte {
sign, err := signer(userId, moduleId, salt) sign, err := signer(userId, moduleId, appVersion, salt)
if err != nil { if err != nil {
return nil return nil
} }

View File

@ -1,3 +1,3 @@
package wrapper package wrapper
var DandelionEnergy func(uint64, string, []byte) ([]byte, error) var DandelionEnergy func(uint64, string, string, []byte) ([]byte, error)