diff --git a/client/builders.go b/client/builders.go index 032a4f1d..ef836780 100644 --- a/client/builders.go +++ b/client/builders.go @@ -124,7 +124,7 @@ func (c *QQClient) buildDeviceLockLoginPacket() (uint16, []byte) { return seq, c.transport.PackPacket(&req2) } -func (c *QQClient) buildQRCodeFetchRequestPacket() (uint16, []byte) { +func (c *QQClient) buildQRCodeFetchRequestPacket(size, margin, ecLevel uint32) (uint16, []byte) { watch := auth.AndroidWatch.Version() seq := c.nextSeq() req := c.buildOicqRequestPacket(0, 0x0812, binary.NewWriterF(func(w *binary.Writer) { @@ -139,7 +139,7 @@ func (c *QQClient) buildQRCodeFetchRequestPacket() (uint16, []byte) { w.WriteUInt16(6) 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, size, margin, 72, ecLevel, 2)) w.Write(tlv.T1D(watch.MiscBitmap)) w.Write(tlv.T1F(false, c.deviceInfo.OSType, []byte("7.1.2"), []byte("China Mobile GSM"), c.deviceInfo.APN, 2)) w.Write(tlv.T33(c.deviceInfo.Guid)) diff --git a/client/client.go b/client/client.go index ef9b0391..971472b2 100644 --- a/client/client.go +++ b/client/client.go @@ -309,7 +309,7 @@ func (c *QQClient) TokenLogin(token []byte) error { return c.init(true) } -func (c *QQClient) FetchQRCode() (*QRCodeLoginResponse, error) { +func (c *QQClient) FetchQRCode(size, margin, ecLevel uint32) (*QRCodeLoginResponse, error) { if c.Online.Load() { return nil, ErrAlreadyOnline } @@ -317,7 +317,7 @@ func (c *QQClient) FetchQRCode() (*QRCodeLoginResponse, error) { if err != nil { return nil, err } - i, err := c.sendAndWait(c.buildQRCodeFetchRequestPacket()) + i, err := c.sendAndWait(c.buildQRCodeFetchRequestPacket(size, margin, ecLevel)) if err != nil { return nil, errors.Wrap(err, "fetch qrcode error") }