feat(ppclock): 离线激活 keygen(ror2 公式+EFEF 反解 MAC)+ activate --auto;docs 终稿(firmware-analysis/protocol/PROGRESS),132 测试全绿
This commit is contained in:
1 parent
bed8973551
commit
6615696c2d
8 files changed
+465
-24
No files matched your search
+9
-1
@@ -151,6 +151,8 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
sp = sub.add_parser("activate", help="激活")
|
||||
sp.add_argument("code", nargs="?", help="激活码 hex")
|
||||
sp.add_argument("--show-id", action="store_true", help="仅读取设备 ID")
|
||||
sp.add_argument("--auto", action="store_true",
|
||||
help="离线自动激活:EFEF 反解 MAC + 本地 keygen(无需服务器)")
|
||||
|
||||
sp = sub.add_parser("wifi", help="WiFi 配置")
|
||||
sp.add_argument("ssid")
|
||||
@@ -225,8 +227,14 @@ async def _run_command(args, t):
|
||||
if c == "activate":
|
||||
if args.show_id:
|
||||
return {"device_id": await C.get_device_id(t)}
|
||||
if args.auto:
|
||||
mac = None
|
||||
if args.mac:
|
||||
# 显示序 MAC → NVDS 字节序(LSB 在前);不确定时优先省略 --mac 走 EFEF 反解
|
||||
mac = bytes.fromhex(args.mac.replace(":", ""))[::-1]
|
||||
return await C.activate_auto(t, mac)
|
||||
if not args.code:
|
||||
raise ValueError("缺少激活码或 --show-id")
|
||||
raise ValueError("缺少激活码、--auto 或 --show-id")
|
||||
await C.activate(t, args.code)
|
||||
return None
|
||||
if c == "wifi":
|
||||
|
||||
Reference in new issue
Block a user