mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 20:40:43 +00:00
被控端 - 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%) - 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败) - 每分钟回头找局域网,自动切回快 400 倍的路径 - 画面心跳帧:静止时省流量,客户端仍知道流是活的 - 锁屏时给出可操作的提示 手表端 - 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException - 连接错误翻译成人话(证书/时间/解析/超时分别提示) - 经中转连上后用服务器报的地址刷新已配对记录 - 新增局域网连接页面、服务器延迟检测 服务器端 - 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502) - 网络调优脚本 net-tune.sh(开机自动应用) - 管理页:批量删除、网络体检、下载区 - 隧道改 HTTP/2 + 双连接 文档 - 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
60 lines
2.0 KiB
Python
60 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""把「开机零窗口」测试接进 verify_all.ps1,并清理引用已删测试的残留。"""
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
TARGET = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests\verify_all.ps1")
|
|
ANCHOR = 'Record "首次设置窗口" ($setupCode2 -eq 0)'
|
|
|
|
ADDITION = '''Record "首次设置窗口" ($setupCode2 -eq 0)
|
|
|
|
# ---------------------------------------------------------------- 1l
|
|
Banner "1l/7 开机零窗口(照注册表里的自启命令真跑一遍)"
|
|
Stop-Strays
|
|
& python (Join-Path $root "_tests\\test_boot_silent.py") *> (Join-Path $env:TEMP "lr_boot.txt")
|
|
$bootCode = $LASTEXITCODE
|
|
Get-Content (Join-Path $env:TEMP "lr_boot.txt") -Encoding UTF8 -ErrorAction SilentlyContinue |
|
|
Select-Object -Last 3
|
|
Record "开机零窗口" ($bootCode -eq 0)'''
|
|
|
|
|
|
def main() -> int:
|
|
raw = TARGET.read_bytes()
|
|
bom = raw[:3] == b"\xef\xbb\xbf"
|
|
text = raw.decode("utf-8-sig")
|
|
|
|
if "test_boot_silent.py" not in text:
|
|
if ANCHOR not in text:
|
|
print(" [失败] 锚点没找到")
|
|
return 1
|
|
text = text.replace(ANCHOR, ADDITION, 1)
|
|
print(" verify_all.ps1: 已插入「开机零窗口」阶段")
|
|
|
|
# 清理引用已删测试的残留行
|
|
for name in ("test_pc_gui.py", "test_simple_ui.py", "test_quit.py"):
|
|
if name in text:
|
|
lines = text.splitlines(keepends=True)
|
|
kept = [l for l in lines if name not in l]
|
|
removed = len(lines) - len(kept)
|
|
text = "".join(kept)
|
|
print(f" 清掉 {name} 残留 {removed} 行")
|
|
|
|
data = text.encode("utf-8")
|
|
if bom:
|
|
data = b"\xef\xbb\xbf" + data
|
|
TARGET.write_bytes(data)
|
|
|
|
# 看看还剩哪些阶段
|
|
names = re.findall(r'Record "([^"]+)"', text)
|
|
print(f"\n 当前 {len(names)} 个验证阶段:")
|
|
for name in names:
|
|
print(f" - {name}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|