package unicom
import (
"errors"
"regexp"
"strings"
)
type loginScript struct {
exponent string
modulus string
captchaAppID string
captchaScript string
sendPath string
loginPath string
genQRPath string
heartPath string
logonPath string
secCookie string
piwCookie string
pwdType string
userType string
redirectType string
jqueryVer string
releasePath string
checkFirst string
needPath string
agreePath string
userNoPath string
}
type billAPI struct {
URL string
Origin string
Referer string
Version string
Language string
}
var (
keyPairRE = regexp.MustCompile(`RSAUtils\.getKeyPair\(\s*"([0-9a-fA-F]+)"\s*,\s*"([0-9a-fA-F]*)"\s*,\s*"([0-9a-fA-F]+)"\s*\)`)
captchaAppRE = regexp.MustCompile(`new\s+TencentCaptcha\(\s*['"](\d+)['"]`)
captchaSrcRE = regexp.MustCompile(`src=["']([^"']*turing\.captcha[^"']+)["']`)
sendPathRE = regexp.MustCompile(`(/portal/Service/SendMSG)`)
loginPathRE = regexp.MustCompile(`(/portal/Service/MallLogin)`)
genQRRE = regexp.MustCompile(`(/oauth2/genqr)`)
heartRE = regexp.MustCompile(`(/qrcode/qrcode_hbt)`)
logonRE = regexp.MustCompile(`(/portal/qrcode/qrcode_logon)`)
secCookieRE = regexp.MustCompile(`secsnid\s*=\s*\$\.cookie\(["']([A-Za-z0-9_]+)["']\)`)
piwCookieRE = regexp.MustCompile(`setCookie\(\s*["']([A-Za-z0-9_]+)["']\s*,\s*data\.piw`)
pwdTypeRE = regexp.MustCompile(`PWD_TYPE_RND\s*=\s*["'](\d+)["']`)
userTypeRE = regexp.MustCompile(`USER_TYPE_MOBILE\s*=\s*["'](\d+)["']`)
jqueryVerRE = regexp.MustCompile(`(?:jquery:"|jQuery v)(\d+\.\d+\.\d+)`)
releaseRE = regexp.MustCompile(`(/portal/Service/checkRelease)`)
checkFirstRE = regexp.MustCompile(`(/portal/Service/alogin_checkFirst)`)
needVerifyRE = regexp.MustCompile(`(/portal/Service/CheckNeedVerify)`)
agreementRE = regexp.MustCompile(`(/portal/Service/CheckAgreement)`)
userNumberRE = regexp.MustCompile(`(/portal/Service/CheckUsernumber)`)
loginFromRE = regexp.MustCompile(`(?is)]*id=["']loginFrom["'][^>]*>`)
inputValueRE = regexp.MustCompile(`value=["']([^"']*)["']`)
scriptSrcRE = regexp.MustCompile(`(?i)