feat(huya): device_mint 铸币机编排器 + 登录链验收矩阵(铸币hdid→APP_SIGN/金样本→NEED_RISK)
- tools/device_mint.py: --mint-only/--login/--control/--matrix 全编排 - huya_launch_mint.mint_sguid(): 上线铸币函数 - docs §11.9: 接受度矩阵 + 边界精确化 (sGuid可铸/登录签名独立硬锚)
This commit is contained in:
@@ -280,6 +280,40 @@ def parse_launch_rsp(resp: bytes) -> dict:
|
||||
return {"header": header, "sGuid_candidates": sguid_candidates, "structs": structs}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# live 发送
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def mint_sguid(profile: dict | None = None, mid: str | None = None,
|
||||
url: str = WUP_URL, timeout: float = 20.0) -> str | None:
|
||||
"""doLaunch 上线铸币: 服务端按指纹(mid)确定性签发 sGuid (32hex).
|
||||
|
||||
返回 tRsp 里的 sGuid; 无则 None (请自行查 HTTP/解析日志)。
|
||||
"""
|
||||
import gzip as _g
|
||||
import urllib.request as _ur
|
||||
p = dict(profile or DEFAULT_PROFILE)
|
||||
if mid:
|
||||
p["mid"] = mid
|
||||
body = build_live_launch_wup(p)
|
||||
req = _ur.Request(
|
||||
url, data=body,
|
||||
headers={
|
||||
"Content-Type": "application/octet-stream",
|
||||
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 11; M2102J2SC Build/RKQ1.200826.002)",
|
||||
})
|
||||
with _ur.urlopen(req, timeout=timeout) as r:
|
||||
resp = r.read()
|
||||
if resp[:2] == b"\x1f\x8b":
|
||||
try:
|
||||
resp = _g.decompress(resp)
|
||||
except Exception:
|
||||
pass
|
||||
parsed = parse_launch_rsp(resp)
|
||||
cands = parsed["sGuid_candidates"]
|
||||
return cands[0] if cands else None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# CLI
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user