1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

feat: customize the device by client.

This commit is contained in:
Mrs4s 2021-07-17 22:24:53 +08:00
parent 1f6ef84f8b
commit d6a47cb6c0
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
9 changed files with 139 additions and 133 deletions

View File

@ -40,27 +40,27 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) {
} }
w.Write(tlv.T18(16, uint32(c.Uin))) w.Write(tlv.T18(16, uint32(c.Uin)))
w.Write(tlv.T1(uint32(c.Uin), SystemDeviceInfo.IpAddress)) w.Write(tlv.T1(uint32(c.Uin), c.deviceInfo.IpAddress))
w.Write(tlv.T106(uint32(c.Uin), 0, c.version.AppId, c.version.SSOVersion, c.PasswordMd5, true, SystemDeviceInfo.Guid, SystemDeviceInfo.TgtgtKey, 0)) w.Write(tlv.T106(uint32(c.Uin), 0, c.version.AppId, c.version.SSOVersion, c.PasswordMd5, true, c.deviceInfo.Guid, c.deviceInfo.TgtgtKey, 0))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T100(c.version.SSOVersion, c.version.SubAppId, c.version.MainSigMap)) w.Write(tlv.T100(c.version.SSOVersion, c.version.SubAppId, c.version.MainSigMap))
w.Write(tlv.T107(0)) w.Write(tlv.T107(0))
w.Write(tlv.T142(c.version.ApkId)) w.Write(tlv.T142(c.version.ApkId))
w.Write(tlv.T144( w.Write(tlv.T144(
[]byte(SystemDeviceInfo.IMEI), []byte(c.deviceInfo.IMEI),
SystemDeviceInfo.GenDeviceInfoData(), c.deviceInfo.GenDeviceInfoData(),
SystemDeviceInfo.OSType, c.deviceInfo.OSType,
SystemDeviceInfo.Version.Release, c.deviceInfo.Version.Release,
SystemDeviceInfo.SimInfo, c.deviceInfo.SimInfo,
SystemDeviceInfo.APN, c.deviceInfo.APN,
false, true, false, tlv.GuidFlag(), false, true, false, tlv.GuidFlag(),
SystemDeviceInfo.Model, c.deviceInfo.Model,
SystemDeviceInfo.Guid, c.deviceInfo.Guid,
SystemDeviceInfo.Brand, c.deviceInfo.Brand,
SystemDeviceInfo.TgtgtKey, c.deviceInfo.TgtgtKey,
)) ))
w.Write(tlv.T145(SystemDeviceInfo.Guid)) w.Write(tlv.T145(c.deviceInfo.Guid))
w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign)) w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign))
/* /*
if (miscBitMap & 0x80) != 0{ if (miscBitMap & 0x80) != 0{
@ -68,7 +68,7 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) {
} }
*/ */
w.Write(tlv.T154(seq)) w.Write(tlv.T154(seq))
w.Write(tlv.T141(SystemDeviceInfo.SimInfo, SystemDeviceInfo.APN)) w.Write(tlv.T141(c.deviceInfo.SimInfo, c.deviceInfo.APN))
w.Write(tlv.T8(2052)) w.Write(tlv.T8(2052))
w.Write(tlv.T511([]string{ w.Write(tlv.T511([]string{
"tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com", "tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com",
@ -76,23 +76,23 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) {
"qqweb.qq.com", "office.qq.com", "ti.qq.com", "mail.qq.com", "mma.qq.com", "qqweb.qq.com", "office.qq.com", "ti.qq.com", "mail.qq.com", "mma.qq.com",
})) }))
w.Write(tlv.T187(SystemDeviceInfo.MacAddress)) w.Write(tlv.T187(c.deviceInfo.MacAddress))
w.Write(tlv.T188(SystemDeviceInfo.AndroidId)) w.Write(tlv.T188(c.deviceInfo.AndroidId))
if len(SystemDeviceInfo.IMSIMd5) != 0 { if len(c.deviceInfo.IMSIMd5) != 0 {
w.Write(tlv.T194(SystemDeviceInfo.IMSIMd5)) w.Write(tlv.T194(c.deviceInfo.IMSIMd5))
} }
if c.AllowSlider { if c.AllowSlider {
w.Write(tlv.T191(0x82)) w.Write(tlv.T191(0x82))
} }
if len(SystemDeviceInfo.WifiBSSID) != 0 && len(SystemDeviceInfo.WifiSSID) != 0 { if len(c.deviceInfo.WifiBSSID) != 0 && len(c.deviceInfo.WifiSSID) != 0 {
w.Write(tlv.T202(SystemDeviceInfo.WifiBSSID, SystemDeviceInfo.WifiSSID)) w.Write(tlv.T202(c.deviceInfo.WifiBSSID, c.deviceInfo.WifiSSID))
} }
w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion)) w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion))
w.Write(tlv.T516()) w.Write(tlv.T516())
w.Write(tlv.T521(0)) w.Write(tlv.T521(0))
w.Write(tlv.T525(tlv.T536([]byte{0x01, 0x00}))) w.Write(tlv.T525(tlv.T536([]byte{0x01, 0x00})))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -108,7 +108,7 @@ func (c *QQClient) buildDeviceLockLoginPacket() (uint16, []byte) {
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T401(c.g)) w.Write(tlv.T401(c.g))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -127,15 +127,15 @@ func (c *QQClient) buildQRCodeFetchRequestPacket() (uint16, []byte) {
w.WriteBytesShort(EmptyBytes) w.WriteBytesShort(EmptyBytes)
w.WriteUInt16(6) w.WriteUInt16(6)
w.Write(tlv.T16(watch.SSOVersion, 16, watch.AppId, SystemDeviceInfo.Guid, []byte(watch.ApkId), []byte(watch.SortVersionName), watch.ApkSign)) w.Write(tlv.T16(watch.SSOVersion, 16, watch.AppId, c.deviceInfo.Guid, []byte(watch.ApkId), []byte(watch.SortVersionName), watch.ApkSign))
w.Write(tlv.T1B(0, 0, 3, 4, 72, 2, 2)) w.Write(tlv.T1B(0, 0, 3, 4, 72, 2, 2))
w.Write(tlv.T1D(watch.MiscBitmap)) w.Write(tlv.T1D(watch.MiscBitmap))
w.Write(tlv.T1F(false, SystemDeviceInfo.OSType, []byte("7.1.2"), []byte("China Mobile GSM"), SystemDeviceInfo.APN, 2)) w.Write(tlv.T1F(false, c.deviceInfo.OSType, []byte("7.1.2"), []byte("China Mobile GSM"), c.deviceInfo.APN, 2))
w.Write(tlv.T33(SystemDeviceInfo.Guid)) w.Write(tlv.T33(c.deviceInfo.Guid))
w.Write(tlv.T35(8)) w.Write(tlv.T35(8))
})) }))
}) })
sso := packets.BuildSsoPacket(seq, watch.AppId, c.version.SubAppId, "wtlogin.trans_emp", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, watch.AppId, c.version.SubAppId, "wtlogin.trans_emp", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(0, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(0, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -158,7 +158,7 @@ func (c *QQClient) buildQRCodeResultQueryRequestPacket(sig []byte) (uint16, []by
w.WriteUInt16(0) // const w.WriteUInt16(0) // const
})) }))
}) })
sso := packets.BuildSsoPacket(seq, watch.AppId, c.version.SubAppId, "wtlogin.trans_emp", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, watch.AppId, c.version.SubAppId, "wtlogin.trans_emp", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(0, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(0, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -170,52 +170,52 @@ func (c *QQClient) buildQRCodeLoginPacket(t106, t16a, t318 []byte) (uint16, []by
w.WriteUInt16(24) w.WriteUInt16(24)
w.Write(tlv.T18(16, uint32(c.Uin))) w.Write(tlv.T18(16, uint32(c.Uin)))
w.Write(tlv.T1(uint32(c.Uin), SystemDeviceInfo.IpAddress)) w.Write(tlv.T1(uint32(c.Uin), c.deviceInfo.IpAddress))
w.Write(binary.NewWriterF(func(w *binary.Writer) { w.Write(binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x106) w.WriteUInt16(0x106)
w.WriteBytesShort(t106) w.WriteBytesShort(t106)
})) }))
// w.Write(tlv.T106(uint32(c.Uin), 0, c.version.AppId, c.version.SSOVersion, c.PasswordMd5, true, SystemDeviceInfo.Guid, SystemDeviceInfo.TgtgtKey, 0)) // w.Write(tlv.T106(uint32(c.Uin), 0, c.version.AppId, c.version.SSOVersion, c.PasswordMd5, true, c.deviceInfo.Guid, c.deviceInfo.TgtgtKey, 0))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T100(c.version.SSOVersion, c.version.SubAppId, c.version.MainSigMap)) w.Write(tlv.T100(c.version.SSOVersion, c.version.SubAppId, c.version.MainSigMap))
w.Write(tlv.T107(0)) w.Write(tlv.T107(0))
w.Write(tlv.T142(c.version.ApkId)) w.Write(tlv.T142(c.version.ApkId))
w.Write(tlv.T144( w.Write(tlv.T144(
[]byte(SystemDeviceInfo.IMEI), []byte(c.deviceInfo.IMEI),
SystemDeviceInfo.GenDeviceInfoData(), c.deviceInfo.GenDeviceInfoData(),
SystemDeviceInfo.OSType, c.deviceInfo.OSType,
SystemDeviceInfo.Version.Release, c.deviceInfo.Version.Release,
SystemDeviceInfo.SimInfo, c.deviceInfo.SimInfo,
SystemDeviceInfo.APN, c.deviceInfo.APN,
false, true, false, tlv.GuidFlag(), false, true, false, tlv.GuidFlag(),
SystemDeviceInfo.Model, c.deviceInfo.Model,
SystemDeviceInfo.Guid, c.deviceInfo.Guid,
SystemDeviceInfo.Brand, c.deviceInfo.Brand,
SystemDeviceInfo.TgtgtKey, c.deviceInfo.TgtgtKey,
)) ))
w.Write(tlv.T145(SystemDeviceInfo.Guid)) w.Write(tlv.T145(c.deviceInfo.Guid))
w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign)) w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign))
w.Write(binary.NewWriterF(func(w *binary.Writer) { w.Write(binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x16A) w.WriteUInt16(0x16A)
w.WriteBytesShort(t16a) w.WriteBytesShort(t16a)
})) }))
w.Write(tlv.T154(seq)) w.Write(tlv.T154(seq))
w.Write(tlv.T141(SystemDeviceInfo.SimInfo, SystemDeviceInfo.APN)) w.Write(tlv.T141(c.deviceInfo.SimInfo, c.deviceInfo.APN))
w.Write(tlv.T8(2052)) w.Write(tlv.T8(2052))
w.Write(tlv.T511([]string{ w.Write(tlv.T511([]string{
"tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com", "tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com",
"qzone.qq.com", "vip.qq.com", "gamecenter.qq.com", "qun.qq.com", "game.qq.com", "qzone.qq.com", "vip.qq.com", "gamecenter.qq.com", "qun.qq.com", "game.qq.com",
"qqweb.qq.com", "office.qq.com", "ti.qq.com", "mail.qq.com", "mma.qq.com", "qqweb.qq.com", "office.qq.com", "ti.qq.com", "mail.qq.com", "mma.qq.com",
})) }))
w.Write(tlv.T187(SystemDeviceInfo.MacAddress)) w.Write(tlv.T187(c.deviceInfo.MacAddress))
w.Write(tlv.T188(SystemDeviceInfo.AndroidId)) w.Write(tlv.T188(c.deviceInfo.AndroidId))
if len(SystemDeviceInfo.IMSIMd5) != 0 { if len(c.deviceInfo.IMSIMd5) != 0 {
w.Write(tlv.T194(SystemDeviceInfo.IMSIMd5)) w.Write(tlv.T194(c.deviceInfo.IMSIMd5))
} }
w.Write(tlv.T191(0x00)) w.Write(tlv.T191(0x00))
if len(SystemDeviceInfo.WifiBSSID) != 0 && len(SystemDeviceInfo.WifiSSID) != 0 { if len(c.deviceInfo.WifiBSSID) != 0 && len(c.deviceInfo.WifiSSID) != 0 {
w.Write(tlv.T202(SystemDeviceInfo.WifiBSSID, SystemDeviceInfo.WifiSSID)) w.Write(tlv.T202(c.deviceInfo.WifiBSSID, c.deviceInfo.WifiSSID))
} }
w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion)) w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion))
w.Write(tlv.T516()) w.Write(tlv.T516())
@ -226,7 +226,7 @@ func (c *QQClient) buildQRCodeLoginPacket(t106, t16a, t318 []byte) (uint16, []by
w.WriteBytesShort(t318) w.WriteBytesShort(t318)
})) }))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -242,7 +242,7 @@ func (c *QQClient) buildCaptchaPacket(result string, sign []byte) (uint16, []byt
w.Write(tlv.T104(c.t104)) w.Write(tlv.T104(c.t104))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -260,7 +260,7 @@ func (c *QQClient) buildSMSRequestPacket() (uint16, []byte) {
w.Write(tlv.T17A(9)) w.Write(tlv.T17A(9))
w.Write(tlv.T197()) w.Write(tlv.T197())
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -279,7 +279,7 @@ func (c *QQClient) buildSMSCodeSubmitPacket(code string) (uint16, []byte) {
w.Write(tlv.T401(c.g)) w.Write(tlv.T401(c.g))
w.Write(tlv.T198()) w.Write(tlv.T198())
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -295,7 +295,7 @@ func (c *QQClient) buildTicketSubmitPacket(ticket string) (uint16, []byte) {
w.Write(tlv.T104(c.t104)) w.Write(tlv.T104(c.t104))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.login", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -307,7 +307,7 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
w.WriteUInt16(24) w.WriteUInt16(24)
w.Write(tlv.T18(16, uint32(c.Uin))) w.Write(tlv.T18(16, uint32(c.Uin)))
w.Write(tlv.T1(uint32(c.Uin), SystemDeviceInfo.IpAddress)) w.Write(tlv.T1(uint32(c.Uin), c.deviceInfo.IpAddress))
w.Write(binary.NewWriterF(func(w *binary.Writer) { w.Write(binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x106) w.WriteUInt16(0x106)
w.WriteBytesShort(c.sigInfo.encryptedA1) w.WriteBytesShort(c.sigInfo.encryptedA1)
@ -316,23 +316,23 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
w.Write(tlv.T100(c.version.SSOVersion, 2, c.version.MainSigMap)) w.Write(tlv.T100(c.version.SSOVersion, 2, c.version.MainSigMap))
w.Write(tlv.T107(0)) w.Write(tlv.T107(0))
w.Write(tlv.T144( w.Write(tlv.T144(
SystemDeviceInfo.AndroidId, c.deviceInfo.AndroidId,
SystemDeviceInfo.GenDeviceInfoData(), c.deviceInfo.GenDeviceInfoData(),
SystemDeviceInfo.OSType, c.deviceInfo.OSType,
SystemDeviceInfo.Version.Release, c.deviceInfo.Version.Release,
SystemDeviceInfo.SimInfo, c.deviceInfo.SimInfo,
SystemDeviceInfo.APN, c.deviceInfo.APN,
false, true, false, tlv.GuidFlag(), false, true, false, tlv.GuidFlag(),
SystemDeviceInfo.Model, c.deviceInfo.Model,
SystemDeviceInfo.Guid, c.deviceInfo.Guid,
SystemDeviceInfo.Brand, c.deviceInfo.Brand,
SystemDeviceInfo.TgtgtKey, c.deviceInfo.TgtgtKey,
)) ))
w.Write(tlv.T142(c.version.ApkId)) w.Write(tlv.T142(c.version.ApkId))
w.Write(tlv.T145(SystemDeviceInfo.Guid)) w.Write(tlv.T145(c.deviceInfo.Guid))
w.Write(tlv.T16A(c.sigInfo.srmToken)) w.Write(tlv.T16A(c.sigInfo.srmToken))
w.Write(tlv.T154(seq)) w.Write(tlv.T154(seq))
w.Write(tlv.T141(SystemDeviceInfo.SimInfo, SystemDeviceInfo.APN)) w.Write(tlv.T141(c.deviceInfo.SimInfo, c.deviceInfo.APN))
w.Write(tlv.T8(2052)) w.Write(tlv.T8(2052))
w.Write(tlv.T511([]string{ w.Write(tlv.T511([]string{
"tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com", "tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com",
@ -341,11 +341,11 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
})) }))
w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign)) w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign))
w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion)) w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion))
w.Write(tlv.T400(c.g, c.Uin, SystemDeviceInfo.Guid, c.dpwd, 1, 16, c.randSeed)) w.Write(tlv.T400(c.g, c.Uin, c.deviceInfo.Guid, c.dpwd, 1, 16, c.randSeed))
w.Write(tlv.T187(SystemDeviceInfo.MacAddress)) w.Write(tlv.T187(c.deviceInfo.MacAddress))
w.Write(tlv.T188(SystemDeviceInfo.AndroidId)) w.Write(tlv.T188(c.deviceInfo.AndroidId))
w.Write(tlv.T194(SystemDeviceInfo.IMSIMd5)) w.Write(tlv.T194(c.deviceInfo.IMSIMd5))
w.Write(tlv.T202(SystemDeviceInfo.WifiBSSID, SystemDeviceInfo.WifiSSID)) w.Write(tlv.T202(c.deviceInfo.WifiBSSID, c.deviceInfo.WifiSSID))
w.Write(tlv.T516()) w.Write(tlv.T516())
w.Write(tlv.T521(0)) w.Write(tlv.T521(0))
w.Write(tlv.T525(tlv.T536([]byte{0x01, 0x00}))) w.Write(tlv.T525(tlv.T536([]byte{0x01, 0x00})))
@ -363,40 +363,40 @@ func (c *QQClient) buildRequestChangeSigPacket() (uint16, []byte) {
w.Write(tlv.T100(c.version.SSOVersion, 100, c.version.MainSigMap)) w.Write(tlv.T100(c.version.SSOVersion, 100, c.version.MainSigMap))
w.Write(tlv.T10A(c.sigInfo.tgt)) w.Write(tlv.T10A(c.sigInfo.tgt))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap)) w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T108(SystemDeviceInfo.IMEI)) w.Write(tlv.T108(c.deviceInfo.IMEI))
h := md5.Sum(c.sigInfo.d2Key) h := md5.Sum(c.sigInfo.d2Key)
w.Write(tlv.T144( w.Write(tlv.T144(
SystemDeviceInfo.AndroidId, c.deviceInfo.AndroidId,
SystemDeviceInfo.GenDeviceInfoData(), c.deviceInfo.GenDeviceInfoData(),
SystemDeviceInfo.OSType, c.deviceInfo.OSType,
SystemDeviceInfo.Version.Release, c.deviceInfo.Version.Release,
SystemDeviceInfo.SimInfo, c.deviceInfo.SimInfo,
SystemDeviceInfo.APN, c.deviceInfo.APN,
false, true, false, tlv.GuidFlag(), false, true, false, tlv.GuidFlag(),
SystemDeviceInfo.Model, c.deviceInfo.Model,
SystemDeviceInfo.Guid, c.deviceInfo.Guid,
SystemDeviceInfo.Brand, c.deviceInfo.Brand,
h[:], h[:],
)) ))
w.Write(tlv.T143(c.sigInfo.d2)) w.Write(tlv.T143(c.sigInfo.d2))
w.Write(tlv.T142(c.version.ApkId)) w.Write(tlv.T142(c.version.ApkId))
w.Write(tlv.T154(seq)) w.Write(tlv.T154(seq))
w.Write(tlv.T18(16, uint32(c.Uin))) w.Write(tlv.T18(16, uint32(c.Uin)))
w.Write(tlv.T141(SystemDeviceInfo.SimInfo, SystemDeviceInfo.APN)) w.Write(tlv.T141(c.deviceInfo.SimInfo, c.deviceInfo.APN))
w.Write(tlv.T8(2052)) w.Write(tlv.T8(2052))
w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign)) w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign))
w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion)) w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion))
w.Write(tlv.T187(SystemDeviceInfo.MacAddress)) w.Write(tlv.T187(c.deviceInfo.MacAddress))
w.Write(tlv.T188(SystemDeviceInfo.AndroidId)) w.Write(tlv.T188(c.deviceInfo.AndroidId))
w.Write(tlv.T194(SystemDeviceInfo.IMSIMd5)) w.Write(tlv.T194(c.deviceInfo.IMSIMd5))
w.Write(tlv.T511([]string{ w.Write(tlv.T511([]string{
"tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com", "tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com",
"qzone.qq.com", "vip.qq.com", "qun.qq.com", "game.qq.com", "qqweb.qq.com", "qzone.qq.com", "vip.qq.com", "qun.qq.com", "game.qq.com", "qqweb.qq.com",
"office.qq.com", "ti.qq.com", "mail.qq.com", "qzone.com", "mma.qq.com", "office.qq.com", "ti.qq.com", "mail.qq.com", "qzone.com", "mma.qq.com",
})) }))
// w.Write(tlv.T202(SystemDeviceInfo.WifiBSSID, SystemDeviceInfo.WifiSSID)) // w.Write(tlv.T202(c.deviceInfo.WifiBSSID, c.deviceInfo.WifiSSID))
}) })
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.exchange_emp", SystemDeviceInfo.IMEI, c.sigInfo.tgt, c.OutGoingPacketSessionId, req, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "wtlogin.exchange_emp", c.deviceInfo.IMEI, c.sigInfo.tgt, c.OutGoingPacketSessionId, req, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 2, make([]byte, 16), sso, []byte{})
return seq, packet return seq, packet
} }
@ -411,23 +411,23 @@ func (c *QQClient) buildClientRegisterPacket() (uint16, []byte) {
Status: 11, Status: 11,
KickPC: 0, KickPC: 0,
KickWeak: 0, KickWeak: 0,
IOSVersion: int64(SystemDeviceInfo.Version.Sdk), IOSVersion: int64(c.deviceInfo.Version.Sdk),
NetType: 1, NetType: 1,
RegType: 0, RegType: 0,
Guid: SystemDeviceInfo.Guid, Guid: c.deviceInfo.Guid,
IsSetStatus: 0, IsSetStatus: 0,
LocaleId: 2052, LocaleId: 2052,
DevName: string(SystemDeviceInfo.Model), DevName: string(c.deviceInfo.Model),
DevType: string(SystemDeviceInfo.Model), DevType: string(c.deviceInfo.Model),
OSVer: string(SystemDeviceInfo.Version.Release), OSVer: string(c.deviceInfo.Version.Release),
OpenPush: 1, OpenPush: 1,
LargeSeq: 1551, LargeSeq: 1551,
OldSSOIp: 0, OldSSOIp: 0,
NewSSOIp: 31806887127679168, NewSSOIp: 31806887127679168,
ChannelNo: "", ChannelNo: "",
CPID: 0, CPID: 0,
VendorName: string(SystemDeviceInfo.VendorName), VendorName: string(c.deviceInfo.VendorName),
VendorOSName: string(SystemDeviceInfo.VendorOSName), VendorOSName: string(c.deviceInfo.VendorOSName),
B769: []byte{0x0A, 0x04, 0x08, 0x2E, 0x10, 0x00, 0x0A, 0x05, 0x08, 0x9B, 0x02, 0x10, 0x00}, B769: []byte{0x0A, 0x04, 0x08, 0x2E, 0x10, 0x00, 0x0A, 0x05, 0x08, 0x9B, 0x02, 0x10, 0x00},
SetMute: 0, SetMute: 0,
} }
@ -444,7 +444,7 @@ func (c *QQClient) buildClientRegisterPacket() (uint16, []byte) {
Context: make(map[string]string), Context: make(map[string]string),
Status: make(map[string]string), Status: make(map[string]string),
} }
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "StatSvc.register", SystemDeviceInfo.IMEI, c.sigInfo.tgt, c.OutGoingPacketSessionId, pkt.ToBytes(), c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "StatSvc.register", c.deviceInfo.IMEI, c.sigInfo.tgt, c.OutGoingPacketSessionId, pkt.ToBytes(), c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 1, c.sigInfo.d2Key, sso, c.sigInfo.d2) packet := packets.BuildLoginPacket(c.Uin, 1, c.sigInfo.d2Key, sso, c.sigInfo.d2)
return seq, packet return seq, packet
} }
@ -459,15 +459,15 @@ func (c *QQClient) buildStatusSetPacket(status, extStatus int32) (uint16, []byte
KickPC: 0, KickPC: 0,
KickWeak: 0, KickWeak: 0,
Timestamp: time.Now().Unix(), Timestamp: time.Now().Unix(),
IOSVersion: int64(SystemDeviceInfo.Version.Sdk), IOSVersion: int64(c.deviceInfo.Version.Sdk),
NetType: 1, NetType: 1,
RegType: 0, RegType: 0,
Guid: SystemDeviceInfo.Guid, Guid: c.deviceInfo.Guid,
IsSetStatus: 1, IsSetStatus: 1,
LocaleId: 2052, LocaleId: 2052,
DevName: string(SystemDeviceInfo.Model), DevName: string(c.deviceInfo.Model),
DevType: string(SystemDeviceInfo.Model), DevType: string(c.deviceInfo.Model),
OSVer: string(SystemDeviceInfo.Version.Release), OSVer: string(c.deviceInfo.Version.Release),
OpenPush: 1, OpenPush: 1,
LargeSeq: 1551, LargeSeq: 1551,
ExtOnlineStatus: int64(extStatus), ExtOnlineStatus: int64(extStatus),
@ -1077,7 +1077,7 @@ func (c *QQClient) buildAppInfoRequestPacket(id string) (uint16, []byte) {
body := &qweb.QWebReq{ body := &qweb.QWebReq{
Seq: 1, Seq: 1,
Qua: "V1_AND_SQ_8.4.8_1492_YYB_D", Qua: "V1_AND_SQ_8.4.8_1492_YYB_D",
DeviceInfo: fmt.Sprintf("i=865166025905020&imsi=460002478794049&mac=02:00:00:00:00:00&m=%v&o=7.1.2&a=25&sc=1&sd=0&p=900*1600&f=nubia&mm=3479&cf=2407&cc=4&aid=086bbf84a7d5fbb3&qimei=865166023450458&sharpP=1&n=wifi", string(SystemDeviceInfo.Model)), DeviceInfo: fmt.Sprintf("i=865166025905020&imsi=460002478794049&mac=02:00:00:00:00:00&m=%v&o=7.1.2&a=25&sc=1&sd=0&p=900*1600&f=nubia&mm=3479&cf=2407&cc=4&aid=086bbf84a7d5fbb3&qimei=865166023450458&sharpP=1&n=wifi", string(c.deviceInfo.Model)),
BusiBuff: b, BusiBuff: b,
TraceId: fmt.Sprintf("%v_%v_%v", c.Uin, time.Now().Format("0102150405"), rand.Int63()), TraceId: fmt.Sprintf("%v_%v_%v", c.Uin, time.Now().Format("0102150405"), rand.Int63()),
} }

View File

@ -59,6 +59,7 @@ type QQClient struct {
currServerIndex int currServerIndex int
retryTimes int retryTimes int
version *versionInfo version *versionInfo
deviceInfo *DeviceInfo
dpwd []byte dpwd []byte
syncCookie []byte syncCookie []byte
@ -194,14 +195,15 @@ func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient {
groupSeq: int32(rand.Intn(20000)), groupSeq: int32(rand.Intn(20000)),
friendSeq: 22911, friendSeq: 22911,
highwayApplyUpSeq: 77918, highwayApplyUpSeq: 77918,
ksid: []byte(fmt.Sprintf("|%s|A8.2.7.27f6ea96", SystemDeviceInfo.IMEI)), // ksid: []byte(fmt.Sprintf("|%s|A8.2.7.27f6ea96", SystemDeviceInfo.IMEI)),
eventHandlers: &eventHandlers{}, eventHandlers: &eventHandlers{},
msgSvcCache: utils.NewCache(time.Second * 15), msgSvcCache: utils.NewCache(time.Second * 15),
transCache: utils.NewCache(time.Second * 15), transCache: utils.NewCache(time.Second * 15),
onlinePushCache: utils.NewCache(time.Second * 15), onlinePushCache: utils.NewCache(time.Second * 15),
version: genVersionInfo(SystemDeviceInfo.Protocol), // version: genVersionInfo(SystemDeviceInfo.Protocol),
servers: []*net.TCPAddr{}, servers: []*net.TCPAddr{},
} }
cli.UseDevice(SystemDeviceInfo)
sso, err := getSSOAddress() sso, err := getSSOAddress()
if err == nil && len(sso) > 0 { if err == nil && len(sso) > 0 {
cli.servers = append(sso, cli.servers...) cli.servers = append(sso, cli.servers...)
@ -255,6 +257,12 @@ func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient {
return cli return cli
} }
func (c *QQClient) UseDevice(info *DeviceInfo) {
c.version = genVersionInfo(info.Protocol)
c.ksid = []byte(fmt.Sprintf("|%s|A8.2.7.27f6ea96", info.IMEI))
c.deviceInfo = info
}
// Login send login request // Login send login request
func (c *QQClient) Login() (*LoginResponse, error) { func (c *QQClient) Login() (*LoginResponse, error) {
if c.Online { if c.Online {
@ -295,7 +303,8 @@ func (c *QQClient) TokenLogin(token []byte) error {
c.sigInfo.encryptedA1 = r.ReadBytesShort() c.sigInfo.encryptedA1 = r.ReadBytesShort()
c.sigInfo.wtSessionTicketKey = r.ReadBytesShort() c.sigInfo.wtSessionTicketKey = r.ReadBytesShort()
c.OutGoingPacketSessionId = r.ReadBytesShort() c.OutGoingPacketSessionId = r.ReadBytesShort()
SystemDeviceInfo.TgtgtKey = r.ReadBytesShort() // SystemDeviceInfo.TgtgtKey = r.ReadBytesShort()
c.deviceInfo.TgtgtKey = r.ReadBytesShort()
} }
_, err = c.sendAndWait(c.buildRequestChangeSigPacket()) _, err = c.sendAndWait(c.buildRequestChangeSigPacket())
if err != nil { if err != nil {
@ -457,7 +466,7 @@ func (c *QQClient) GenToken() []byte {
w.WriteBytesShort(c.sigInfo.encryptedA1) w.WriteBytesShort(c.sigInfo.encryptedA1)
w.WriteBytesShort(c.sigInfo.wtSessionTicketKey) w.WriteBytesShort(c.sigInfo.wtSessionTicketKey)
w.WriteBytesShort(c.OutGoingPacketSessionId) w.WriteBytesShort(c.OutGoingPacketSessionId)
w.WriteBytesShort(SystemDeviceInfo.TgtgtKey) w.WriteBytesShort(c.deviceInfo.TgtgtKey)
}) })
} }
@ -1085,7 +1094,7 @@ func (c *QQClient) doHeartbeat() {
for c.Online { for c.Online {
time.Sleep(time.Second * 30) time.Sleep(time.Second * 30)
seq := c.nextSeq() seq := c.nextSeq()
sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "Heartbeat.Alive", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, []byte{}, c.ksid) sso := packets.BuildSsoPacket(seq, c.version.AppId, c.version.SubAppId, "Heartbeat.Alive", c.deviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, []byte{}, c.ksid)
packet := packets.BuildLoginPacket(c.Uin, 0, []byte{}, sso, []byte{}) packet := packets.BuildLoginPacket(c.Uin, 0, []byte{}, sso, []byte{})
_, err := c.sendAndWait(seq, packet) _, err := c.sendAndWait(seq, packet)
if errors.Is(err, utils.ErrConnectionClosed) { if errors.Is(err, utils.ErrConnectionClosed) {

View File

@ -41,7 +41,7 @@ func decodeLoginResponse(c *QQClient, _ *incomingPacketInfo, payload []byte) (in
if m.Exists(0x402) { if m.Exists(0x402) {
c.dpwd = []byte(utils.RandomString(16)) c.dpwd = []byte(utils.RandomString(16))
c.t402 = m[0x402] c.t402 = m[0x402]
h := md5.Sum(append(append(SystemDeviceInfo.Guid, c.dpwd...), c.t402...)) h := md5.Sum(append(append(c.deviceInfo.Guid, c.dpwd...), c.t402...))
c.g = h[:] c.g = h[:]
} }
if t == 0 { // login success if t == 0 { // login success
@ -54,7 +54,7 @@ func decodeLoginResponse(c *QQClient, _ *incomingPacketInfo, payload []byte) (in
if m.Exists(0x403) { if m.Exists(0x403) {
c.randSeed = m[0x403] c.randSeed = m[0x403]
} }
c.decodeT119(m[0x119], SystemDeviceInfo.TgtgtKey) c.decodeT119(m[0x119], c.deviceInfo.TgtgtKey)
return LoginResponse{ return LoginResponse{
Success: true, Success: true,
}, nil }, nil
@ -289,7 +289,7 @@ func decodeTransEmpResponse(c *QQClient, _ *incomingPacketInfo, payload []byte)
if !m.Exists(0x18) || !m.Exists(0x1e) || !m.Exists(0x19) { if !m.Exists(0x18) || !m.Exists(0x1e) || !m.Exists(0x19) {
return nil, errors.New("wtlogin.trans_emp sub cmd 0x12 error: tlv error") return nil, errors.New("wtlogin.trans_emp sub cmd 0x12 error: tlv error")
} }
SystemDeviceInfo.TgtgtKey = m[0x1e] c.deviceInfo.TgtgtKey = m[0x1e]
return &QRCodeLoginResponse{State: QRCodeConfirmed, LoginInfo: &QRCodeLoginInfo{ return &QRCodeLoginResponse{State: QRCodeConfirmed, LoginInfo: &QRCodeLoginInfo{
tmpPwd: m[0x18], tmpPwd: m[0x18],
tmpNoPicSig: m[0x19], tmpNoPicSig: m[0x19],

View File

@ -32,7 +32,7 @@ func (c *QQClient) buildFaceroamRequestPacket() (uint16, []byte) {
payload, _ := proto.Marshal(&faceroam.FaceroamReqBody{ payload, _ := proto.Marshal(&faceroam.FaceroamReqBody{
Comm: &faceroam.PlatInfo{ Comm: &faceroam.PlatInfo{
Implat: proto.Int64(109), Implat: proto.Int64(109),
Osver: proto.String(string(SystemDeviceInfo.Version.Release)), Osver: proto.String(string(c.deviceInfo.Version.Release)),
Mqqver: &c.version.SortVersionName, Mqqver: &c.version.SortVersionName,
}, },
Uin: proto.Uint64(uint64(c.Uin)), Uin: proto.Uint64(uint64(c.Uin)),

View File

@ -6,16 +6,6 @@ import (
"encoding/hex" "encoding/hex"
"encoding/xml" "encoding/xml"
"fmt" "fmt"
"math/rand"
"net"
"sort"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/binary"
"github.com/Mrs4s/MiraiGo/binary/jce" "github.com/Mrs4s/MiraiGo/binary/jce"
devinfo "github.com/Mrs4s/MiraiGo/client/pb" devinfo "github.com/Mrs4s/MiraiGo/client/pb"
@ -23,6 +13,14 @@ import (
"github.com/Mrs4s/MiraiGo/client/pb/oidb" "github.com/Mrs4s/MiraiGo/client/pb/oidb"
"github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/message"
"github.com/Mrs4s/MiraiGo/utils" "github.com/Mrs4s/MiraiGo/utils"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"math/rand"
"net"
"sort"
"strconv"
"strings"
"time"
) )
type ( type (
@ -126,7 +124,6 @@ type (
requestParams map[string]interface{} requestParams map[string]interface{}
) )
// default
var SystemDeviceInfo = &DeviceInfo{ var SystemDeviceInfo = &DeviceInfo{
Display: []byte("MIRAI.123456.001"), Display: []byte("MIRAI.123456.001"),
Product: []byte("mirai"), Product: []byte("mirai"),

View File

@ -59,7 +59,7 @@ func (c *QQClient) GetModelShow(modelName string) ([]*ModelVariant, error) {
Uin: c.Uin, Uin: c.Uin,
Model: strings.ReplaceAll(url.QueryEscape(modelName), "+", "%20"), Model: strings.ReplaceAll(url.QueryEscape(modelName), "+", "%20"),
AppType: 0, AppType: 0,
IMei: SystemDeviceInfo.IMEI, IMei: c.deviceInfo.IMEI,
ShowInfo: true, ShowInfo: true,
ModelShow: "", ModelShow: "",
RecoverDefault: false, RecoverDefault: false,
@ -98,7 +98,7 @@ func (c *QQClient) SetModelShow(modelName string, modelShow string) error {
Uin: c.Uin, Uin: c.Uin,
Model: strings.ReplaceAll(url.QueryEscape(modelName), "+", "%20"), Model: strings.ReplaceAll(url.QueryEscape(modelName), "+", "%20"),
AppType: 0, AppType: 0,
IMei: SystemDeviceInfo.IMEI, IMei: c.deviceInfo.IMEI,
ShowInfo: true, ShowInfo: true,
ModelShow: strings.ReplaceAll(url.QueryEscape(modelShow), "+", "%20"), ModelShow: strings.ReplaceAll(url.QueryEscape(modelShow), "+", "%20"),
RecoverDefault: modelShow == "", RecoverDefault: modelShow == "",

View File

@ -78,9 +78,9 @@ func (c *QQClient) buildLoginExtraPacket() (uint16, []byte) {
TerminalType: proto.Uint32(2), TerminalType: proto.Uint32(2),
Status: proto.Uint32(10), Status: proto.Uint32(10),
LoginTime: proto.Uint32(5), LoginTime: proto.Uint32(5),
HardwareInfo: proto.String(string(SystemDeviceInfo.Model)), HardwareInfo: proto.String(string(c.deviceInfo.Model)),
SoftwareInfo: proto.String(string(SystemDeviceInfo.Version.Release)), SoftwareInfo: proto.String(string(c.deviceInfo.Version.Release)),
Guid: SystemDeviceInfo.Guid, Guid: c.deviceInfo.Guid,
AppName: &c.version.ApkId, AppName: &c.version.ApkId,
SubAppId: &c.version.AppId, SubAppId: &c.version.AppId,
}, },

View File

@ -124,7 +124,7 @@ func (c *QQClient) MarkPrivateMessageReaded(uin, time int64) {
func (c *QQClient) buildDeviceListRequestPacket() (uint16, []byte) { func (c *QQClient) buildDeviceListRequestPacket() (uint16, []byte) {
seq := c.nextSeq() seq := c.nextSeq()
req := &jce.SvcReqGetDevLoginInfo{ req := &jce.SvcReqGetDevLoginInfo{
Guid: SystemDeviceInfo.Guid, Guid: c.deviceInfo.Guid,
LoginType: 1, LoginType: 1,
AppName: "com.tencent.mobileqq", AppName: "com.tencent.mobileqq",
RequireMax: 20, RequireMax: 20,

View File

@ -110,7 +110,7 @@ func (c *QQClient) decodeT119(data, ek []byte) {
if len(decrypted) > 51+16 { if len(decrypted) > 51+16 {
dr := binary.NewReader(decrypted) dr := binary.NewReader(decrypted)
dr.ReadBytes(51) dr.ReadBytes(51)
SystemDeviceInfo.TgtgtKey = dr.ReadBytes(16) c.deviceInfo.TgtgtKey = dr.ReadBytes(16)
} }
} }
c.Nickname = nick c.Nickname = nick
@ -120,7 +120,7 @@ func (c *QQClient) decodeT119(data, ek []byte) {
// wtlogin.exchange_emp // wtlogin.exchange_emp
func (c *QQClient) decodeT119R(data []byte) { func (c *QQClient) decodeT119R(data []byte) {
tea := binary.NewTeaCipher(SystemDeviceInfo.TgtgtKey) tea := binary.NewTeaCipher(c.deviceInfo.TgtgtKey)
reader := binary.NewReader(tea.Decrypt(data)) reader := binary.NewReader(tea.Decrypt(data))
reader.ReadBytes(2) reader.ReadBytes(2)
m := reader.ReadTlvMap(2) m := reader.ReadTlvMap(2)