Skip to content

Commit

Permalink
update default protocol version & pass through app version for T544 s…
Browse files Browse the repository at this point in the history
…igner
  • Loading branch information
Mrs4s committed Apr 1, 2023
1 parent 62d60f1 commit f8d9841
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions client/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down
28 changes: 14 additions & 14 deletions client/internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions internal/tlv/t544.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion wrapper/codec.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package wrapper

var DandelionEnergy func(uint64, string, []byte) ([]byte, error)
var DandelionEnergy func(uint64, string, string, []byte) ([]byte, error)

0 comments on commit f8d9841

Please sign in to comment.