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
}
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+)["']`)
loginFromRE = regexp.MustCompile(`(?is)]*id=["']loginFrom["'][^>]*>`)
inputValueRE = regexp.MustCompile(`value=["']([^"']*)["']`)
scriptSrcRE = regexp.MustCompile(`(?i)