Skip to content

Commit

Permalink
feat: 设置自定义服务器,导出passwordmd5
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Nov 12, 2024
1 parent 42b7313 commit dc65991
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions client/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewClientMD5(uin uint32, passwordMD5 [16]byte) *QQClient {
client := &QQClient{
Uin: uin,
oicq: oicq.NewCodec(int64(uin)),
passwordMD5: passwordMD5,
PasswordMD5: passwordMD5,
ticket: &TicketService{
client: &http.Client{Jar: cookieContainer},
sKey: &keyInfo{},
Expand All @@ -70,7 +70,7 @@ type QQClient struct {

t106 []byte
t16a []byte
passwordMD5 [16]byte
PasswordMD5 [16]byte

UA string

Expand Down Expand Up @@ -167,6 +167,10 @@ func (c *QQClient) Sig() *auth.SigInfo {
return &c.transport.Sig
}

func (c *QQClient) SetCustomServer(servers []netip.AddrPort) {
c.servers = append(servers, c.servers...)
}

func (c *QQClient) Release() {
if c.Online.Load() {
c.Disconnect()
Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (c *QQClient) PasswordLogin() (loginstate.State, error) {
return -996, err
}

data, err := buildPasswordLoginRequest(c.Uin, c.version(), c.Device(), &c.transport.Sig, c.passwordMD5)
data, err := buildPasswordLoginRequest(c.Uin, c.version(), c.Device(), &c.transport.Sig, c.PasswordMD5)
if err != nil {
return -998, err
}
Expand All @@ -178,7 +178,7 @@ func (c *QQClient) PasswordLogin() (loginstate.State, error) {

func (c *QQClient) CommitCaptcha(ticket, randStr, aid string) (loginstate.State, error) {
c.Sig().CaptchaInfo = [3]string{ticket, randStr, aid}
data, err := buildPasswordLoginRequest(c.Uin, c.version(), c.Device(), &c.transport.Sig, c.passwordMD5)
data, err := buildPasswordLoginRequest(c.Uin, c.version(), c.Device(), &c.transport.Sig, c.PasswordMD5)
if err != nil {
return -998, err
}
Expand Down

0 comments on commit dc65991

Please sign in to comment.