feat: Windows v1.1.1 — 修复与改进(DSH 工作区归档)

This commit is contained in:
jbjf6666 committed 2026-10-29 15:37:17 +08:00
1 parent 4a5d676c7b
commit e6880efdc6
21 files changed
+807 -106

No files matched your search

+20 -7
View File
@@ -22,7 +22,6 @@ import time
import urllib.request
import webbrowser
from pathlib import Path
from typing import Any
from core import platform as plat # noqa: E402
@@ -171,6 +170,16 @@ def run_check_driver(install: bool) -> int:
print(f" · {item['serial']}({item['connection']})")
print(f"结论:{status['summary']}")
# 开发者镜像(iOS 17+ 虚拟定位的前提,独立于 Apple 驱动)
try:
ddi = apple_driver.ddi_status()
state = "已就绪" if ddi["ok"] else ("缺失:" + "、".join(ddi["missing"]))
print(f"开发者镜像:{state}({ddi['total_mb']} MB)")
print(f" 目录:{ddi['dir']}")
except Exception as exc:
print(f"开发者镜像:检测失败({exc})")
print(f"日志目录:{plat.data_dir() / 'logs'}")
if status.get("ready"):
return 0
if not install:
@@ -315,6 +324,7 @@ def main(argv: list[str] | None = None) -> int:
# ---------------- 启动时的「环境准备」窗口 ----------------
# 每次打开都显示:逐项列出依赖,缺的可以直接点右侧按钮安装,
# 必需项全部就绪后「进入程序」才可点击。
setup_result: bool | None = None
if not args.no_setup and not mock_flag:
from core import setup_window
@@ -388,20 +398,23 @@ def main(argv: list[str] | None = None) -> int:
# 关键:放到**后台线程**里做。首次运行可能要下载 40~200MB,如果同步跑,
# 界面会迟迟不出现(打包成窗口程序后用户看不到任何进度)。后台跑的话,
# 界面已经打开,安装日志会实时通过 WebSocket 推到界面上。
driver_state: dict[str, Any] = {"ok": None, "done": threading.Event()}
def _driver_worker() -> None:
ok = ensure_apple_driver(app.log, allow_install=True)
driver_state["ok"] = ok
ensure_apple_driver(app.log, allow_install=True)
# 驱动就绪后设备列表可能从空变成有,主动刷一次并推给界面
try:
app.devices.refresh()
app._on_devices_change()
except Exception:
pass
driver_state["done"].set()
if plat.IS_WINDOWS and not mock and not args.no_driver_check:
threading.Thread(target=_driver_worker, name="apple-driver", daemon=True).start()
if setup_result is True:
# 环境窗口刚刚已经做过完整的驱动检查/安装(含 sc / 27015 / PnP / 注册表),
# 这里再跑一遍纯属浪费,还可能因为状态在两次之间变化而触发安装阶梯。
app.log("info", "环境检查已完成,跳过重复的驱动探测")
else:
threading.Thread(target=_driver_worker, name="apple-driver",
daemon=True).start()
if getattr(app.config, "_repaired", False):
app.log("warn", "config.json 中有非法项(类型/范围不合法),已自动回退为默认值")