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

fix login

This commit is contained in:
Mrs4s 2023-03-10 03:56:17 +08:00
parent adae194961
commit 9760f01de1
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
3 changed files with 14 additions and 0 deletions

View File

@ -110,6 +110,7 @@ func (c *QQClient) buildLoginPacket() (uint16, []byte) {
w.WriteBytesShort(c.Device().Guid)
w.WriteBytesShort([]byte(c.version().SdkVersion))
w.WriteUInt32(9) // sub command
w.WriteUInt32(0) // 被演了
})
t.Append(tlv.T544Custom("810_9", salt, warpper.DandelionEnergy))
}

View File

@ -51,6 +51,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if m.Exists(0x546) {
c.sig.T547 = auth.CalcPow(m[0x546])
}
// c.logger.Info("login response %v", t)
if t == 0 { // login success
// if t150, ok := m[0x150]; ok {
// c.t150 = t150
@ -71,6 +72,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if m.Exists(0x192) {
return LoginResponse{
Success: false,
Code: t,
VerifyUrl: string(m[0x192]),
Error: SliderNeededError,
}, nil
@ -82,6 +84,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
sign := imgData.ReadBytes(int(signLen))
return LoginResponse{
Success: false,
Code: t,
Error: NeedCaptcha,
CaptchaImage: imgData.ReadAvailable(),
CaptchaSign: sign,
@ -89,6 +92,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
} else {
return LoginResponse{
Success: false,
Code: t,
Error: UnknownLoginError,
}, nil
}
@ -97,6 +101,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if t == 40 {
return LoginResponse{
Success: false,
Code: t,
ErrorMessage: "账号被冻结",
Error: UnknownLoginError,
}, nil
@ -115,6 +120,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if t204, ok := m[0x204]; ok { // 同时支持扫码验证 ?
return LoginResponse{
Success: false,
Code: t,
Error: SMSOrVerifyNeededError,
VerifyUrl: string(t204),
SMSPhone: phone,
@ -123,6 +129,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
}
return LoginResponse{
Success: false,
Code: t,
Error: SMSNeededError,
SMSPhone: phone,
ErrorMessage: string(m[0x17e]),
@ -133,6 +140,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
c.sig.T104 = m[0x104]
return LoginResponse{
Success: false,
Code: t,
Error: SMSNeededError,
}, nil
}
@ -140,6 +148,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if t204, ok := m[0x204]; ok { // 扫码验证
return LoginResponse{
Success: false,
Code: t,
Error: UnsafeDeviceError,
VerifyUrl: string(t204),
ErrorMessage: "",
@ -149,6 +158,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
if t == 162 {
return LoginResponse{
Code: t,
Error: TooManySMSRequestError,
}, nil
}
@ -165,6 +175,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
t149r.ReadStringShort() // title
return LoginResponse{
Success: false,
Code: t,
Error: OtherLoginError,
ErrorMessage: t149r.ReadStringShort(),
}, nil
@ -176,6 +187,7 @@ func decodeLoginResponse(c *QQClient, pkt *network.Packet) (any, error) {
t146r.ReadStringShort() // title
return LoginResponse{
Success: false,
Code: t,
Error: OtherLoginError,
ErrorMessage: t146r.ReadStringShort(),
}, nil

View File

@ -27,6 +27,7 @@ type (
LoginResponse struct {
Success bool
Code byte
Error LoginError
// Captcha info