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

feat: 现可使用不同的二维码生成参数获取二维码

This commit is contained in:
Lin 2021-12-24 14:25:13 +08:00
parent cf864799cb
commit b5697b24c5
No known key found for this signature in database
GPG Key ID: 244C608766137C86
2 changed files with 4 additions and 4 deletions

View File

@ -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))

View File

@ -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")
}