Skip to content

Commit

Permalink
needn't just replace version, version upgrade may change the algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
xqdoo00o committed Jul 29, 2023
1 parent 7c725e6 commit e5c7577
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,13 @@ func readHAR() {
panic(err)
}
bw := getBw(t.Unix())
re := regexp.MustCompile(`\/v2\/\S*?\/enforcement\.\S*?\.`)
arkHeader = make(http.Header)
for _, h := range arkReq.Request.Headers {
// arkHeader except cookie & content-length
if strings.EqualFold(h.Name, "content-length") == false && strings.EqualFold(h.Name, "cookie") == false && strings.HasPrefix(h.Name, ":") == false {
arkHeader.Set(h.Name, h.Value)
if strings.EqualFold(h.Name, "user-agent") {
bv = h.Value
} else if strings.EqualFold(h.Name, "referer") {
arkHeader.Set(h.Name, re.ReplaceAllString(h.Value, "/v2/"+initVer+"/enforcement."+initHex+`.`))
}
}
}
Expand All @@ -107,13 +104,10 @@ func readHAR() {
panic(err)
}
arkBx = Decrypt(cipher, bv+bw)
arkBx = re.ReplaceAllString(arkBx, "/v2/"+initVer+"/enforcement."+initHex+`.`)
} else if p.Name != "rnd" {
arkBody += "&" + p.Name + "=" + p.Value
}
}
re = regexp.MustCompile(`&capi_version=\S*?&`)
arkBody = re.ReplaceAllString(arkBody, `&capi_version=`+initVer+`&`)
}

//goland:noinspection GoUnhandledErrorResult
Expand Down

0 comments on commit e5c7577

Please sign in to comment.