feat: complete U30 Air support and harden shared installer
Port charger, fuel-gauge, pinctrl and native dual-SIM support with device-specific safeguards. Strengthen shared radio and dialing locks, power reporting and packaging checks. Include installer diagnostics, backup progress, recovery and reboot-verification improvements, tests and documentation.
No files matched your search
@@ -32,6 +32,12 @@ jobs:
|
||||
run: python -m unittest discover -s installer/tests -v
|
||||
- name: Build portable release
|
||||
run: python installer/build.py
|
||||
- name: Browser test dependencies
|
||||
run: |
|
||||
python -m pip install playwright
|
||||
python -m playwright install chromium
|
||||
- name: Production UI regression (simulated transport only)
|
||||
run: python -X utf8 installer/tests/run_ui.py
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openwrt-installer-windows
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
Windows desktop installer: extract the complete release package and run root `OpenWrt-Installer.exe`. Device selection, persistent recovery and the two-stage Android reset flow share the existing backend. Python/CLI and Magisk entries remain available. See the bilingual [user guide](installer/GUIDE.md), [build instructions](installer/README.md), and [verification/screenshots](installer/VERIFICATION.md). Multiple ADB devices can be selected in the GUI or interactive CLI, or explicitly bound with `--serial SERIAL`.
|
||||
|
||||
|
||||
U30 Air mainline updates now include both charger variants, corrected fuel-gauge persistence,
|
||||
Type-C current detection, OTG boost control and native dual-SIM boot/live switching.
|
||||
See the [U30 Air port and verification record](docs/U30AIR-UPSTREAM-20261015.zh-CN.md).
|
||||
|
||||
V50/MU3351 desktop-installer support and the new LED driver are documented in
|
||||
[the V50 adaptation record](docs/V50-MU3351-20261014.zh-CN.md), including what has
|
||||
been checked on hardware and what remains unverified.
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# U30 Air 上游适配记录(2026-10-15)
|
||||
|
||||
本次仅修改 MU300 仓库 `feat/u30air-upstream-support`,不修改 E5 仓库。
|
||||
对照上游 `main` 的 `e9b4009`,选择性导入 U30 Air 支持,并接入本分支已有的公共看板和双卡接口。
|
||||
这不是新支持 U30 Pro;U30 Pro 的不同 SoC 不在本次范围内。
|
||||
|
||||
## 内核硬件支持
|
||||
|
||||
适用主线内核 6.18.54 和 7.2.8,保留 5.4 原状。
|
||||
|
||||
- 导入补丁 0009–0013、0015、0016:SGM41511/BQ25601(0x6b)和 SGM41513(0x1a)充电管理;包含不同芯片的电流编码、终止电流、供电状态、充电完成状态。
|
||||
- UMP9620 的 BC1.2 检测地址修正为 0x239c,保留 Type-C Rp 输入电流识别;不把电脑 USB 当作大电流充电器。
|
||||
- 电量计恢复原厂保存电量与完成状态的处理,修正跨重启容量保持。
|
||||
- 网页百分比与短信电量通知共用电源节点探测:兼容原厂 battery、主线 sc27xx-fgu、实际 Battery 类型节点及 bq256xx-charger 外部供电状态;过滤 F50/V50 的虚假电量和 0–100 以外的值。
|
||||
- 引入 UMS9620 pinctrl 和 I2C6 管脚修正,让充电芯片总线可以实际工作。
|
||||
- 同时导入最新防误识别补丁:只有具有 `/charger_policy_service` 的电池机型才能尝试备用 0x1a 地址。F50/V50 上的同地址应答不当作充电芯片。
|
||||
- LED、蓝牙、Wi-Fi、安装识别此前已支持 U30 Air,继续使用本分支原有公共实现。
|
||||
|
||||
对应上游来源:
|
||||
|
||||
- [U30 Air 充电/Type-C](https://github.com/dikeckaan/mu300-linux/commit/d8387d9)
|
||||
- [pinctrl / I2C6](https://github.com/dikeckaan/mu300-linux/commit/21e2d23)
|
||||
- [0x1a 芯片变体](https://github.com/dikeckaan/mu300-linux/commit/1947354)
|
||||
- [仅在电池机型探测备用充电器](https://github.com/dikeckaan/mu300-linux/commit/9741a46)
|
||||
|
||||
## USB / OTG
|
||||
|
||||
`mu300-usb` 保留原有角色接口,增加两种充电器地址识别、已绑定驱动下的访问兼容。
|
||||
电池升压与外部供电互斥:外部供电的 Hub 使用其自身 VBUS,不同时打开升压。
|
||||
切回电脑角色前关闭升压;内核充电驱动存在时,不重新开启芯片看门狗,避免其超时把充电设置恢复成默认值。
|
||||
角色切换失败时会关闭刚开启的升压。F50/V50 不执行这些充电寄存器操作。
|
||||
|
||||
## U30 Air 原生双卡
|
||||
|
||||
原生冷启动和热切换脚本来自上游 [0d520f4](https://github.com/dikeckaan/mu300-linux/commit/0d520f4),按本仓库的接口适配。
|
||||
|
||||
- U30 Air 同一时间只启用一张卡的射频;不能照搬 V50 同时启动两个射频的流程。
|
||||
- NR1/NR2 与 NR4/NR5 各自持有命令通道,NR0/NR3 各自只有一个 URC 读取者。等待 SIPC SBUF 就绪后才打开设备。
|
||||
- U30 所有通道禁用失败重开和 procd 重启,缺少持久 AT owner 时不直接打开 tty。
|
||||
- 冷启动保留基带当前网络模式;先 RIL 握手,再检查冷态、SIM 上电与身份、设置数据通路,最后启用射频。
|
||||
- 持久化的频段/小区设置在射频启用前回放,不额外打乱原有回放顺序。
|
||||
- 热切换先检查目标 SIM,然后停止旧 WAN,确认拆除完成后关闭旧卡射频和 SIM 电源,再启用目标卡、切换数据通路、打开新卡射频。
|
||||
- 切换中的 AT、射频、网络锁定操作互斥。命令不返回或控制进程异常时,不循环盲目重置射频;保留上游受控回退/重启机制。
|
||||
- 目标卡有实际数据连接后才自动保存开机默认卡。目标卡无数据而旧卡原来有数据,则恢复旧卡;两张卡都无数据时保留用户当前选卡,但不覆盖开机默认。
|
||||
- 用户主动关闭 WAN 时,切卡后保持关闭;显式选择会保存到开机默认卡。
|
||||
- 首次选择 SIM2 后支持限时首数据检查;已经成功使用过的卡不会因普通网络波动被切走。
|
||||
- 普通 SIM1 启动会按需要恢复此前可能留在 SIM2 上的数据路由。
|
||||
|
||||
配置存储沿用 `unisoc_modem.main.data_sim`,不建立第二份相互冲突的开机选卡配置。
|
||||
当前实际卡槽单独存在 `/run/mu300/sim-slot`,因此启动回退和未保存的实时切换不会错误拨打默认卡。
|
||||
两卡 APN、短信、网络锁定、终端及流量统计复用现有按槽位隔离的公共实现。
|
||||
|
||||
## 核对后的公共修复
|
||||
|
||||
下列处理适用于 MU300 仓库所有机型,未放进 U30 Air 判断里:
|
||||
|
||||
- 射频初始化与拨号互斥改用原子 PID 符号链接,消除“目录已创建、PID 尚未写入”窗口,避免并发调用误删新锁。
|
||||
- 回收僵尸锁也有单独原子互斥,多个等待者不会把前一个刚取得的新锁删掉;同时检查 PID 对应进程,防止 PID 复用误判。
|
||||
- 正常射频等待仍为原来的 8 秒、拨号等待仍为 150 秒,只改变加锁方式,不改变 AT/回放顺序。
|
||||
- 公共 AT 适配器支持事务进行中及射频状态未知时拒绝外来命令,并在实际发送前再次检查,防止排队请求穿过切卡窗口。标记由对应控制器创建,不会使普通启动多等时间。
|
||||
- 电量计的供电来源和保存容量处理在公共驱动中按 PMIC/硬件能力生效;未按产品名称硬编码。
|
||||
- 任务超时、界面状态刷新和打包脚本缺失检查均复用公共代码;仅原生切卡的耗时预算单独扩展。
|
||||
|
||||
充电芯片地址探测、OTG 升压、单活动射频切换、禁止 SIPC 重开等基于板级验证的行为仍保留机型边界,避免改变 F50/V50 的硬件控制方式。
|
||||
|
||||
## 网页入口与默认行为
|
||||
|
||||
蜂窝 → SIM 卡管理增加 U30 Air 原生双卡设置,仅 U30 Air 显示:
|
||||
|
||||
1. 保持默认普通 SIM1 启动,热切换默认关闭。
|
||||
2. 可选择卡槽并点击“仅保存为下次开机默认卡”,不立即切卡、不自动重启。
|
||||
3. 启用双卡热切换后,如当前启动没有完成双卡准备,手动重启一次。
|
||||
4. 准备完成后,使用原有“切换上网卡”按钮即可在线切换。
|
||||
|
||||
新增文案包含中文、英文和土耳其文。状态接口不在轮询时发送 AT,也不写闪存。
|
||||
已有 U30 Air 配置会一次性升级为双卡能力,保留当前选卡、APN、短信和流量历史;F50/V50 保留现有双卡协议;射频与拨号锁使用上文的公共修复。
|
||||
|
||||
## 验证与限制
|
||||
|
||||
- 6.18.54、7.2.8 内核 Image 均构建成功,三个新增配置实际生效。
|
||||
- 7.2.8 的 201 个、6.18.54 的 194 个配套内核模块已重新构建;BTF 检查、模块/Image 指纹和容器内核能力校验通过。
|
||||
- 测试覆盖原生冷启动、热切换、缺卡/PIN、忙锁、通道丢失、失败回退、主动关闭 WAN、等待拆除、当前卡/默认卡分离,以及原有 F50/V50/USB 逻辑。
|
||||
- 电量读取、看板与短信转发相关 24 项测试运行完成,22 项通过,2 项需真实 OpenWrt 测试环境而跳过;覆盖主线/原厂节点、外部充电在线状态、0% 电量、无电池机型和非法百分比。
|
||||
- 原生冷启动/热切换与接口集成共 75 项测试通过;公共锁/数据优先级 10 项(包含八路并发旧锁回收)、移动恢复/早期回放 18 项,以及锁定/APN/翻译/构建检查相关测试通过。
|
||||
- 扩大运行时,已有 LED 报警动画测试出现一次采样时序失败,独立重跑通过;本次未修改其灯控实现,不把这次整套扩大运行写成全部通过。
|
||||
- rootfs 构建安装并检查原生切卡所需的 flock,显式设置新脚本执行权限;TF 与正式发布脚本校验这些脚本和配置库是否确实进入包。
|
||||
- **当前没有连接 U30 Air,因此本次是代码移植、内核编译和模拟回归验证;未声称已完成该机实测,也未刷写其他机器。**
|
||||
- 仍需 U30 Air 实机验证:两种充电芯片对应样机的充电与 OTG、跨重启电量、双卡冷启动/双向切换、缺卡回退。
|
||||
|
||||
编译输出位于 Docker 卷 `mu300-mainline-clean-tf-7-2` 的 `/src/u30air-validation-7.2`、`/src/u30air-validation-6.18`。
|
||||
Image 与模块必须配套使用,不能只替换 Image 而留下旧 BTF 模块。
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
### 独立内置分区
|
||||
|
||||
检查设备不会替换你已选择的安装方式;“推荐”只作提示。重装已有内置分区不要求插 TF 卡,也不会校验 TF 卡容量。只有选择 TF 卡安装时才要求卡及其目标分区有效。最终计划会明确列出安装方式、写入目标和数据影响;返回修改时会保留所选方式及原页面。
|
||||
|
||||
优先使用已验证 GPT 未分配区域,足够时不缩容或清空 userdata。没有合适区域时使用既有离线缩容逻辑。计划显示 Android 保留空间、OpenWrt 分配大小及数据影响。
|
||||
|
||||
“使用全部已分配的 OpenWrt 分区容量”默认开启,意思是扩满选定大小的 OpenWrt 分区,**不是占用设备所有剩余空间**。设备端写入后检查文件系统块数,进入 OpenWrt 后再次读取 ext4 超级块验证实际容量。验证没通过不会显示安装成功。
|
||||
@@ -38,9 +40,15 @@
|
||||
|
||||
这些等待**没有总超时**。预期重启或 USB 消失属于等待状态,不是 EOF 失败。无 ADB 时电脑无法区分“Android 仍在开机”和“尚未开启调试”;界面同时给出初始化、开启调试与允许授权的具体步骤。未加密 userdata 保留离线保数据缩容,不默认清空。
|
||||
|
||||
### 更新与自动重启
|
||||
|
||||
更新提交后,设备会自动重启以应用更新,网络会暂时断开。页面与通知会显示“更新已提交,设备将自动重启”;请保持供电。安装器确认同一设备的启动标识确实变化,再校验实际容量,最后显示“OpenWrt 已更新并通过校验”。重启前旧系统仍能响应 SSH 时不会提前显示完成。点击“我已进入 OpenWrt”也仍会核验真实重启;地址或密码变化时可在此处修正。完成、失败和暂停后阶段计时停止;这些时间保存在记录中,重新打开后仍可查看,重试开始新的执行计时。旧更新记录若未保存重启前证据,不能自动认定更新完成,应保留记录人工复核。
|
||||
|
||||
重启期间的 SSH 断开、连接被拒绝、连接超时或 USB 网卡暂时消失,均属于正常的“设备正在重启,等待重新连接”,不会显示连接错误或要求重新更新,也没有固定等待总时限。详细原因仅记入 DEBUG 日志;认证失败或地址确实对应另一台设备时,才提示修正密码/目标。管理地址与密码输入框始终保留,设备开机后可手动确认并重试校验。
|
||||
|
||||
### 暂停、关闭与失败恢复
|
||||
|
||||
事务默认位于 `%LOCALAPPDATA%\OpenWrt-Installer\transactions\<transaction-id>\`。通过“打开事务目录”查看,通过“导出事务与备份”生成 ZIP。备份含设备身份和可能含无线配置的旧后端记录,请妥善保管,不要公开上传。默认日志不包含原终端输出、密码、短信正文或完整设备标识。
|
||||
事务默认位于 `%LOCALAPPDATA%\OpenWrt-Installer\transactions\<transaction-id>\`。通过“打开事务目录”查看,通过“导出事务与备份”生成 ZIP。备份含设备身份和可能含无线配置的旧后端记录,请妥善保管,不要公开上传。DEBUG 日志记录命令边界、脱敏后的 CLI 输出、校验结果及具体异常堆栈;密码、无线密钥与完整设备标识在写入日志前脱敏,不读取短信正文。
|
||||
|
||||
“在安全边界暂停”会等待正在进行的存储操作结束,不会直接杀进程。任务执行中关闭窗口会被阻止并提示先暂停。暂停后可以关闭、重启电脑或移动包;重新打开 EXE,选择“继续未完成的安装”。若已提交离线准备,暂停不会撤销设备已收到的启动请求,仍须保持设备供电。完成页保持显示,不会自动关闭。
|
||||
|
||||
@@ -52,6 +60,16 @@
|
||||
|
||||
窗口顶部、步骤导航和底部操作按钮保持固定;安装内容、续装列表和展开的日志各自滚动。侧栏底部可打开事务目录。操作结果、错误与阶段变化统一通过右上角通知提示;错误通知可以手动关闭,详细信息仍可在日志或对应事务页面查阅。通知不会覆盖底部最终确认按钮。数据影响、等待操作指引和完成结果会持续显示在页面中。界面动效会遵循 Windows 的“动画效果/减少动态效果”设置。
|
||||
|
||||
开始或继续安装后,底部“详细日志 · DEBUG”自动展开,可随时收起;日志列表限制高度,不会推走操作按钮。出错时可一键“复制诊断信息给开发者”,也可复制或导出日志。分享内容来自电脑上持久保存的日志,不局限于界面最近显示的 500 条;完整轮转日志随事务备份导出。旧版记录没有保存的调试细节无法凭空恢复,使用新版重试后会开始记录。备份及传输显示真实字节数、速度和进度条;写入、检查、缩容或扩容缺少可信百分比时,显示活动进度条、阶段及耗时,不生成虚假百分比。等待用户操作时,进度条停止活动并显示下一步指引。
|
||||
|
||||
启动链备份逐项 `dd` 到设备 `/data/local/tmp/` 下的独立临时目录,再通过 `adb pull` 拉到电脑;源分区、临时文件、电脑文件的 SHA-256 必须一致。每项完成后删除设备临时文件,全部完成后删除临时目录。不使用 Base64 或压缩流备份;临时空间不足时会明确停止。备份只读取启动相关源分区,不向源分区写入。
|
||||
|
||||
文件传输的 100% 仅代表当前文件已传完。后续提取、音频或蓝牙固件转换会切换到独立阶段和活动进度条,并在日志中显示转换器文件名、输出及耗时。电脑端转换支持安全暂停,单个转换器超过 120 秒会明确报错;Android 初始化和授权等待仍没有此时限。
|
||||
|
||||
详细日志按最新记录在上、较早记录在下显示;一条异常内的堆栈顺序保持不变。复制及导出的持久化诊断仍按发生时间排列,方便开发者分析。
|
||||
|
||||
阶段 4 需要手动重启时,页面顶部会明确显示“请现在手动重启设备”。使用设备正常重启功能;已经重启或进入 OpenWrt 时不要重复重启。自动重启流程会显示已发送请求。进入 OpenWrt 后,将电脑连接到这台设备的 USB 网络或热点,核对管理地址和 SSH root 密码,点击“我已进入 OpenWrt,开始校验”。多台 OpenWrt 的默认地址可能冲突,请连接目标设备的网络并填写它可访问的地址;安装器不会自动改网卡或路由。地址对应另一台设备、连接失败或认证失败时,可以直接修正地址/密码并重试,不必重新安装。手动确认会立即请求最终身份及容量校验,通过后显示完成;不会跳过校验或重新执行分区写入。所选地址与启动确认保存在原记录中,密码只在内存使用,重启安装器后需重新填写。
|
||||
|
||||
### 连接与常见问题
|
||||
|
||||
#### 第一次使用,从哪里开始?
|
||||
@@ -60,7 +78,7 @@
|
||||
|
||||
#### 没有发现设备,或者同时连接了多台设备?
|
||||
|
||||
先完成安装包校验,再刷新设备。确认 USB 线支持数据传输、设备供电正常;必要时更换线缆或 USB 口,并在 Windows 设备管理器检查设备及其 USB 驱动。Android 中开启开发者选项和 USB 调试。多台设备会列在下拉列表中,请核对型号和序列号末四位,明确选择目标后检查;后续操作绑定所选设备,不会任选另一台。
|
||||
刷新设备不依赖安装包校验;没有设备时也可以反复刷新。进入安装、临时启动或高级选项时会先自动刷新一次。枚举连接不读取分区或请求 root,检查设备和安装前仍须校验安装包。确认 USB 线支持数据传输、设备供电正常;必要时更换线缆或 USB 口,并在 Windows 设备管理器检查设备及其 USB 驱动。Android 中开启开发者选项和 USB 调试。多台设备会列在下拉列表中,请核对型号和序列号末四位,明确选择目标后检查;后续操作绑定所选设备,不会任选另一台。
|
||||
|
||||
#### 显示“等待调试授权”或“离线”?
|
||||
|
||||
@@ -94,6 +112,8 @@ Extract the complete ZIP and run **OpenWrt-Installer.exe** at its root. Keep all
|
||||
|
||||
### Storage and capacity
|
||||
|
||||
Inspecting a device never changes your selected installation method; recommendation badges are advisory. Reinstalling an existing internal partition needs no TF card and does not validate card capacity. A valid card/target is required only for TF installation. The final plan names the method, write target and data impact. Returning to edit preserves the chosen method and original page.
|
||||
|
||||
TF installation follows the existing first-partition preference, using the raw card only when it has no partitions. It does not repartition cards or impose a 32 GiB ceiling. Check the exact target and capacity. The payload and local firmware are prepared before releasing Android mounts and formatting. A release failure stops installation. Magisk TF installation remains supported.
|
||||
|
||||
Internal installation first checks validated GPT gaps. A sufficient gap avoids shrinking/resetting userdata. Otherwise the existing offline resize is used. The plan displays retained Android space, allocated OpenWrt space and data impact. **Use all allocated OpenWrt partition capacity** is enabled by default: it fills the chosen allocation, not all remaining device storage. Device-side block-count checks and final ext4 superblock verification prevent a 10 GiB partition with an unexpanded 2 GiB filesystem from being reported as success.
|
||||
@@ -108,9 +128,15 @@ Wait for offline preparation and stock recovery to finish. Complete Android setu
|
||||
|
||||
There is **no overall deadline** for user setup or authorization. Expected reboots and missing USB are waiting states. Without ADB the computer cannot distinguish Android still booting from USB debugging not yet enabled; the UI provides both instructions. Unencrypted userdata retains its preserving offline-shrink path.
|
||||
|
||||
### Updates and automatic restart
|
||||
|
||||
After submission the device automatically restarts to apply the update, briefly disconnecting its network. The page and notification show “Update submitted; device restarting.” Keep power connected. Completion requires the same device’s boot identifier to change, followed by actual-capacity verification; an SSH response from the old runtime before reboot cannot complete the update. Explicit boot confirmation retains this check. Correct changed addresses/passwords in the verification form. Phase clocks stop on completion, failure and pause, persist across application restart, and begin a new execution segment on retry. Older update records without pre-reboot evidence require manual review and are not automatically accepted as complete.
|
||||
|
||||
SSH EOF, refused connections, timeouts and a temporarily absent USB network during reboot are normal reconnection waits. They do not generate connection-error warnings, request another update or impose a fixed overall deadline. Transport details remain in DEBUG diagnostics. Authentication failure or a confirmed different device still asks for corrected credentials/target. The editable management endpoint and explicit verification button remain available.
|
||||
|
||||
### Recovery and results
|
||||
|
||||
Transactions live in `%LOCALAPPDATA%\OpenWrt-Installer\transactions\<transaction-id>\`. Open this directory or export the full transaction/backup ZIP from the application. Backups include private hardware identity and may contain wireless settings in legacy records; do not publish them. Default logs omit legacy terminal output, passwords, SMS bodies and full hardware identifiers.
|
||||
Transactions live in `%LOCALAPPDATA%\OpenWrt-Installer\transactions\<transaction-id>\`. Open this directory or export the full transaction/backup ZIP from the application. Backups include private hardware identity and may contain wireless settings in legacy records; do not publish them. DEBUG logs include command boundaries, sanitized CLI output, verification results and exception tracebacks. Passwords, wireless keys and complete hardware identifiers are redacted before logging; installation does not read SMS bodies.
|
||||
|
||||
Pause takes effect at a safe boundary. A partition or boot write is not killed. Closing an active window is blocked until a safe pause. Pausing cannot undo an already submitted offline boot request: keep the device powered. After closing the application, restarting the computer or moving the package, reopen it and choose **Continue an unfinished installation**. The completed page stays open.
|
||||
|
||||
@@ -122,6 +148,16 @@ Connect to USB networking or the device hotspot manually. Default management add
|
||||
|
||||
The header, step navigation and bottom actions stay fixed. Installation content, recovery records and expanded logs scroll independently. The transaction-folder shortcut stays at the bottom of the sidebar. Results, errors and phase changes share the notification area at the upper right, away from the final confirmation buttons. Dismiss error notifications manually; consult the log or transaction page for details. Data-impact warnings, waiting instructions and completed results remain on the page. Interface motion follows the Windows animation/reduced-motion preference.
|
||||
|
||||
Detailed logs · DEBUG opens automatically when starting or continuing and can be collapsed at any time. Its bounded list keeps the action buttons visible. On failure, use Copy diagnostics for the developer; the log also supports copying and export. Sharing reads persisted diagnostics rather than only the last 500 UI entries; full rotated logs are included in backup export. Missing debug details from an older release cannot be reconstructed; retrying with this release begins recording them. Backup and transfer bars show measured bytes, speed and progress. Writing, checking, shrink and growth without a reliable percentage show an activity bar, phase and elapsed time. Waiting pauses bar activity and provides the next action.
|
||||
|
||||
Boot-chain backups use device-side `dd` into a private temporary directory under `/data/local/tmp/`, then `adb pull` to the computer. Source, temporary and computer SHA-256 checksums must match. Device temporary files are removed after each item, and the directory is removed when finished. Backup does not use Base64 or compressed streams and stops clearly if temporary space is insufficient. Source partitions are read without writing to them.
|
||||
|
||||
A transfer reaching 100% means only that file finished. Firmware extraction and audio/Bluetooth conversion have separate phases and activity bars, with converter names, output and elapsed time in the log. Host conversion can be safely paused and has a 120-second per-converter timeout. Android setup and authorization waits retain no overall deadline.
|
||||
|
||||
The detailed log displays newest entries first while preserving line order within each traceback. Copied/exported persistent diagnostics retain chronological order for investigation.
|
||||
|
||||
At phase 4, a manual restart requirement appears prominently as “Restart the device now.” Use the device’s normal restart control; do not restart again if OpenWrt is already starting or running. Automatic paths identify the requested restart instead. Once OpenWrt starts, connect this computer to that device’s USB network or hotspot, check its management address and SSH root password, and select “OpenWrt is running — verify now.” Multiple routers can have conflicting default addresses: use the target network and a reachable address. The installer never changes adapters or routes. Wrong-device, connection and authentication errors allow correcting the endpoint/password and retrying without reinstalling. Confirmation requests final device identity and capacity checks; it neither bypasses verification nor repeats partition writes. The endpoint and boot confirmation persist in the original record; passwords remain in memory and must be reentered after restarting the installer.
|
||||
|
||||
### Connection and troubleshooting
|
||||
|
||||
#### Where should a beginner start?
|
||||
@@ -130,7 +166,7 @@ The three-step getting-started guide appears on first launch when no installatio
|
||||
|
||||
#### No devices, or several devices connected?
|
||||
|
||||
Verify the package before refreshing devices. Use a data-capable USB cable, keep power connected and try another cable or USB port if necessary. Check the device and USB driver in Windows Device Manager. Enable Android developer options and USB debugging. With multiple devices, check the model and last four serial characters in the list, explicitly select your target and inspect it. Later operations remain bound to that device.
|
||||
Refreshing devices does not require package verification, and an empty list can be refreshed repeatedly. Entering Install, one-time boot or Advanced options refreshes once automatically. Enumeration does not read partitions or request root; verify the package before device inspection or installation. Use a data-capable USB cable, keep power connected and try another cable or USB port if necessary. Check the device and USB driver in Windows Device Manager. Enable Android developer options and USB debugging. With multiple devices, check the model and last four serial characters in the list, explicitly select your target and inspect it. Later operations remain bound to that device.
|
||||
|
||||
#### Awaiting debugging authorization, or offline?
|
||||
|
||||
|
||||
@@ -2,16 +2,34 @@
|
||||
|
||||
The canonical implementation is `e5-linux/installer`. `sync.py <mu300-repository>` generates the other repository's mirror and `SHARED-SOURCE.json`. Edit the canonical source, synchronize, and run `--check`. Do not independently maintain two frontends/state machines. Both builds use the same Tauri executable and backend; repository-specific behavior is in `backend/adapter.py` and the existing Python/device scripts.
|
||||
|
||||
Protocol 1: one JSON object per line on stdin/stdout. A request is `{"protocol":1,"id":1,"command":"hello","params":{}}`. Responses contain the same `id`, `type:"response"` and `data:{ok,result}` or `{ok:false,error}`. Events use `type:"transaction"`, `"transfer"`, `"log"`. No terminal-text matching. Legacy stdout/stderr is suppressed; named observer callbacks produce events.
|
||||
Protocol 1: one JSON object per line on stdin/stdout. A request is `{"protocol":1,"id":1,"command":"hello","params":{}}`. Responses contain the same `id`, `type:"response"` and `data:{ok,result}` or `{ok:false,error}`. Events use `type:"transaction"`, `"transfer"`, `"log"`. No terminal-text matching. Legacy stdout/stderr becomes sanitized diagnostic log events, independently of named state/effect callbacks.
|
||||
|
||||
Commands are allowlisted in both Rust and Python: hello, snapshot, list, package, devices, probe, probe_update, plan, start, resume, retry, cancel, can_close, export, import. There is no shell/exec command. A frontend-selected serial is checked against an actual device. All ADB operations use that serial; eMMC CID and profile are rechecked after reset. SSH maintenance binds the key fingerprint between planning and execution; final verification binds the hardware CID. A plan cannot become executable without `confirmed:true` on its persisted transaction ID.
|
||||
Commands are allowlisted in both Rust and Python: hello, snapshot, list, package, devices, probe, probe_update, plan, start, resume, retry, cancel, can_close, export, import, diagnostics, verify_openwrt. There is no shell/exec command. A frontend-selected serial is checked against an actual device. All ADB operations use that serial; eMMC CID and profile are rechecked after reset. SSH maintenance binds the key fingerprint between planning and execution; final verification binds the hardware CID. A plan cannot become executable without `confirmed:true` on its persisted transaction ID.
|
||||
|
||||
`verify_openwrt` accepts only the active transaction ID, a management host and in-memory SSH password during safe `openwrt_boot` waiting. It queues an endpoint change/boot acknowledgement for the existing worker and wakes its retry loop; it cannot mark a transaction completed or execute an installation. The worker persists the endpoint and boot acknowledgement, never the password. Details include `reboot_manually`, `boot_confirmed`, `host` and optional `verification_error`. Manual paths wait for user action; automatic reboot paths identify that request. Wrong CID and SSH authentication/connection errors remain editable waits. Actual filesystem-capacity failure remains a failure and cannot be bypassed with confirmation.
|
||||
|
||||
Transactions include format/version, device identity/profile/original slot/storage geometry, selected method/allocation, original partition layout, content-based payload identity, backups, legacy transaction path, completed effects, started/done mutation ledger, current stage/status and final measured result. Writes use flush/fsync plus atomic replacement. Per-CID and per-serial OS locks are shared between repositories. Kernel-released locks survive abnormal process termination correctly. Device scripts retain their own upgrade/partition locks.
|
||||
|
||||
Each saved checkpoint increments `revision`. The UI ignores older snapshots for the same transaction, including a request response delivered after a newer event. Existing version-1 records without a revision acquire one on their next save. An unconfirmed saved plan opens its review/confirmation screen; it cannot be resumed as an authorized installation.
|
||||
|
||||
Stage timing uses persisted `stage_started_at` and terminal `stage_finished_at` timestamps. Repeated waiting/error snapshots within a phase keep its start time; completed, failed and cancelled states freeze it. Retrying starts a new execution segment. Completion retains the preceding verification phase start. The UI stops its interval on terminal states and renders saved times rather than counting after completion.
|
||||
|
||||
Update execution captures the actual SSH runtime's boot UUID in `update_boot_id` before uploading/writing. A completed `update-commit` is a final commit checkpoint: restart goes directly to verification and never repeats the update. The UI announces the automatic restart immediately after commit. Verification requires the bound CID, a valid boot UUID different from the captured one, and measured capacity. A responsive pre-reboot runtime remains a wait; explicit user boot confirmation does not bypass the UUID check. Missing evidence in older update records stops for manual review.
|
||||
|
||||
Expected SSH transport loss during the final wait emits `details.connection_state:"reconnecting"` with no `verification_error`. Automatic restart paths stay `waiting_device`; a manually initiated boot retains its pending user action if necessary. Connection refusals/timeouts, absent network interfaces, EOF and SSH banner loss are logged at DEBUG, not presented as warnings or failures. Retry has no overall deadline. Actual authentication failure and a proven wrong CID retain actionable errors and endpoint correction.
|
||||
|
||||
Restarting during `openwrt_boot` or `verify_capacity` returns directly to SSH hardware/capacity verification. The coordinator also recognizes final verified commit effects before rechecking an obsolete initial Android plan. A stage-one boot effect, partial/started write or root-only E5 TF write is insufficient; legacy preparation records still require their token/geometry-aware resume path.
|
||||
|
||||
Statuses: ready, running, waiting_user, waiting_device, failed, cancelled (a resumable pause), completed. Stages are independent of frontend navigation. Waiting for Android initialization, ADB authorization or root has no transaction deadline. Expected reboot is checkpointed before the reboot command. Every write has a stored intent and a completion checkpoint; completed effects are skipped. Uncertain nonrepeatable writes stop for readback/recovery. Existing backend transaction/geometry/token checks remain authoritative during stage-two resume.
|
||||
|
||||
Safety boundaries are before effects and between verified transfer chunks. Cancellation is requested, not process termination. Close is blocked for active operations; the user first requests a pause. If the host disappears during an unsafe operation, the ledger retains the incomplete intent. Reconnecting is not permission to repeat GPT shrink/format. Backups must be exported before reinstalling Windows or deleting app data. Device-only recovery with insufficient identity/layout/backup evidence is refused.
|
||||
|
||||
Transfer events contain `name`, actual acknowledged `bytes`, `total`, and `bytes_per_second`. Check/format/shrink/grow only emit phase and activity. Final verification reads an ext4 superblock over SSH base64, checks the expected allocated byte count and running OpenWrt, and reports filesystem bytes separately from partition size. No `od` or SFTP is required by that verification.
|
||||
Transfer events contain `name`, actual acknowledged `bytes`, `total`, and `bytes_per_second`. Check/format/shrink/grow only emit phase and activity. Final verification reads raw ext4 superblock bytes over SSH, checks the expected allocated byte count and running OpenWrt, and reports filesystem bytes separately from partition size. No `od` or SFTP is required by that verification.
|
||||
|
||||
`log` events include timestamp, DEBUG/ERROR level, scope, stage and sanitized message. Legacy CLI text is diagnostic output only; no state transition is inferred from it. Command boundaries, output, effect checkpoints, backup/hash results and exception tracebacks persist in `debug.ndjson` with a 4 MiB rotation and one previous file. `diagnostics` returns a bounded redacted sharing report from persisted logs even during an active operation; full logs are included in exported backups. Passwords, wireless keys, hardware identifiers and legacy secrets are masked before disk or UI emission.
|
||||
|
||||
Boot/chain backup uses device-side `dd` into a private shell-owned directory under `/data/local/tmp/`, then ordinary serial-bound `adb pull`. Source, temporary file and computer file SHA-256 must match. The UI observes actual local file growth for byte progress. Per-file staging is deleted in a finally block and the directory is removed on exit. Temporary-space checks run before `dd`; each partition is staged individually. Failed downloads remain `.partial` and cannot replace an existing verified backup. There is no Base64 or compressed-stream backup path or fallback.
|
||||
|
||||
Named `activity` events clear completed transfer counters when another operation starts. `firmware_extract` and `firmware_convert` are preparation stages; the latter includes `details.tool`. Converter changes reset phase timing even within the same stage. Allowlisted host converters run with stdin detached, captured stdout/stderr, hidden Windows processes, five-second diagnostic heartbeats, safe cancellation and a 120-second timeout. Source helper scripts explicitly compile with optimization zero so their docstrings and guards survive the sidecar's optimized build. No installation decision is inferred from their terminal text.
|
||||
|
||||
Content compatibility binds adapter, profile, root layout, kernel family and critical boot/rootfs/filesystem-tool hashes. Package paths and GUI/host-script versions are not compatibility keys. Package checksums are verified again on resume. This is integrity against corruption and accidental mismatch, not a signed release authenticity mechanism.
|
||||
@@ -14,6 +14,8 @@ The artifact also includes ADB and its two Windows USB DLLs under `tools/`, plus
|
||||
|
||||
The host uses fixed Rust commands for dialogs, protocol requests and opening the application-data directory. CSP restricts remote content and scripts. Window-close handling prevents killing an active backend. A missing WebView2 Runtime produces native installation instructions. Portable distribution requires the complete adjacent `tools/backend` directory; the root EXE by itself is not the complete package.
|
||||
|
||||
Host firmware converters are allowlisted under `scripts/tools`. They have detached stdin, captured stdout/stderr, hidden subprocesses, diagnostic heartbeats, safe pause and a 120-second timeout. `--run-tool` compiles source helpers with optimization zero, preserving their docstrings and guards when the sidecar is built with `--optimize 2`. Firmware extraction/conversion have named UI phases; structured activity events clear the preceding file's completed progress bar. Tests include real converter execution after simulated extraction and optimized-host execution, rather than only checking process routing.
|
||||
|
||||
`OPENWRT_GUI_ARTIFACT` can point to an extracted Windows build artifact while packaging on Linux. Existing e5 `install-entrypoints.py` and MU300 `desktop/package.py` call `package_gui.attach` before generating final manifests. GUI sources and binaries are fingerprinted; missing/stale artifacts fail normal packaging. `OPENWRT_GUI_OPTIONAL=1` permits source-only/test fixtures and must not be used for a GUI release. Old optional console EXEs are stored under `tools/legacy`; the root EXE is always Tauri.
|
||||
|
||||
MU300's `--exe` packaging option accepts the GUI artifact **directory**. Legacy console EXE input remains accepted under `tools/legacy`. `tools/build-openwrt-tf-magisk.sh` still calls the same package assembler; set `OPENWRT_GUI_ARTIFACT` (or its existing MU300_DESKTOP_EXE to the directory). e5's profile builder and make-flash-bundle paths use the same attachment. Root Magisk files and a single rootfs remain intact; desktop code is not added to any device initramfs or rootfs.
|
||||
@@ -29,10 +31,22 @@ python installer/sync.py D:\Git\mu300-linux-clean-tf-7.2 --check
|
||||
|
||||
Validation uses fake transports and disposable files. Run POSIX device-script tests in Linux/WSL; Windows path syntax is not valid in those shell test fixtures. Actual hardware erase, resize, boot synchronization and Magisk installation require a separate authorized hardware run. See the verification report for what was actually executed.
|
||||
|
||||
For the complete browser regression suite, install development-only Playwright (`python -m pip install playwright`, then `python -m playwright install chromium`), build the production frontend and run `python -X utf8 installer/tests/run_ui.py`. It starts and stops its own local server, checks all six UI suites and writes `verification/ui-regression.json`. It refuses an occupied test port and never connects to ADB/SSH. Windows CI runs the same suites after its release build.
|
||||
|
||||
## Desktop layout, feedback and motion
|
||||
|
||||
The window has a fixed viewport: header, sidebar, primary actions and footer stay visible. Purpose lists, recovery records, installation content and expanded logs have independent scroll areas. The package extraction reminder and transaction-folder shortcut stay at the bottom of the sidebar. Recovery controls remain compact at the minimum 800×650 window size, including when the log is open.
|
||||
|
||||
Device enumeration is independent of payload verification: the install/advanced/one-time-boot views refresh once on entry, and Refresh devices remains available with an empty list or before verification. Device inspection and installation still require a verified package. Every refresh clears the old inspection so stale root/readiness cannot authorize a later action. Empty responses and enumeration failures clear stale selection; multiple-device responses retain only an explicitly selected device that is still present.
|
||||
|
||||
Installation mode is explicit and stable: probing does not change it, Advanced defaults to reinstall, and returning from review preserves the method and originating page. The review names the selected method. Non-TF probes collect only an optional removable-card availability hint and never call the legacy mandatory SD detector or validate card capacity. Physical card discovery excludes the eMMC carrying userdata instead of assuming `mmcblk1` is the card. TF probes retain strict card/partition selection and failure handling. Execution rejects a method that differs from the saved plan before probing or writing.
|
||||
|
||||
`tests/test_method_routing.py` exercises the actual adapter probe and coordinator planning paths, real E5 legacy GUI-mode SD errors, all method argument/entrypoint mappings and mismatched-plan refusal using simulated reads and mocked write entrypoints. `tests/method_smoke.py` checks the exact frontend protocol parameters, no-card reinstall review, explicit choices with a present card and return-to-edit behavior. Neither test writes to a connected device.
|
||||
|
||||
`tests/frozen_method_smoke.py <package-folders...> --report <report.json>` runs the same no-card probe/plan isolation inside each real bundled backend executable using a simulated transport. It loads the package's actual legacy installer/profile, verifies that all non-TF probes and the internal-reinstall plan succeed without card detection, and confirms that TF installation still rejects a missing card. No external Python is used by the child backend and no device connection is opened.
|
||||
|
||||
Static captions, navigation, button text and headings do not allow text selection. Editable fields, paths, device/plan values, logs, error details and manual body text remain selectable for copying. `tests/refresh_smoke.py` covers empty-list/error retries before verification, multi-device and unauthorized states, stale inspection invalidation, relevant views and selection behavior without device writes.
|
||||
|
||||
[Sonner](https://sonner.emilkowal.ski/) is the single notification surface for request results, native/clipboard errors and transaction changes. Transaction snapshots are deduplicated by identity, stage, status and error; repeated polling does not reset elapsed time or flood notifications. Destructive warnings, actionable waiting guidance, failures and final results also remain in context. Notifications appear above the content, away from the bottom confirmation controls. Loading notifications transition to their result; cancelling a save dialog does not report a successful export.
|
||||
|
||||
[Motion for React](https://motion.dev/docs/react) supplies short page entrances/exits, purpose-row interactions, phase/result entrances and log expansion. `LazyMotion` loads the DOM animation feature set without layout/drag features. `MotionConfig`, `useReducedMotion` and CSS respect the operating system's reduced-motion preference; waiting for the user uses a static device icon rather than an endless execution spinner. No transfer percentages are synthesized.
|
||||
|
||||
@@ -3,44 +3,75 @@
|
||||
"policy": "Generated mirror. Edit upstream then run sync.py; do not fork UI/protocol.",
|
||||
"sha256": {
|
||||
".gitignore": "a5773f83330fc9adddfd159fe0391bccffbf7663dccb2b873f6b2d1b2d2eca11",
|
||||
"backend_entry.py": "b7fea0acd7f3ddbd268c465fb089a258203c1d65f8e4230e35a98d78d7382e90",
|
||||
"backend_entry.py": "238a3534a790ce46ae396040623117299f78b9fc9fc89fe152bfdd5788f7b664",
|
||||
"build.py": "e3adff7e7c6a20e19ed541a4fc22589ba65306cd70dae2b4afde582e8c55a976",
|
||||
"GUIDE.md": "f812f7ee5c2873d7eeade1b5f0a234bf6fefa3c218b88634a4e4b10374cf7671",
|
||||
"GUIDE.md": "479c4d67c28c1004f6db46a67d082c1f494ad1ac8557051d1d3adb085b76d1e3",
|
||||
"package_gui.py": "76435dcfd5c6386f39735b74e8c1dd541dbfdf4da391d02636c4482cc1b6d715",
|
||||
"platform-tools.json": "d8fcf938e150bc314b5e6b2660c540976bb12ea6108fa75a8fb183115ebbd01e",
|
||||
"PROTOCOL.md": "fa1353791fd861a0b7e649e3be3224a91384489b73817ced88a17d6d52bd3dd4",
|
||||
"README.md": "7d906eb6693180b1c05cdf0c928437523240414b55e48a246cbb2434be7505bf",
|
||||
"PROTOCOL.md": "542b7909ffbcc9aa6c3ca5acffdbf8137f5a64487d52ba3997514d8cb5cbd2cc",
|
||||
"README.md": "33e7e52d03bd89d2081b248d6a1d2034c48b68890ef6539ff4636decec6071a3",
|
||||
"release.py": "c1432d3b4e48e094d79753d6be3f432d9e05744abfa816bd4d6e1a04d06b6432",
|
||||
"requirements-build.txt": "762ee573a22c790eb3c5ccba4616632373d947dc88eb91fc85f3c678ac7b2259",
|
||||
"sync.py": "8a6160a68cadbb3295303505c94d6cb5a8229c9ccb2d652408660b1711fccfdf",
|
||||
"VERIFICATION.md": "56048f975f614824f627442f8376234e98c4359d09bf6e7292f83c2c066e288e",
|
||||
"backend/adapter.py": "ea817c559d9abc8748b8b528622620a2abcd215eb6937ad2c80717353f5be52d",
|
||||
"VERIFICATION.md": "054cd33728bc0b152ae288d3b58948609ba34eefb29b63bff990975617aa8936",
|
||||
"backend/adapter.py": "a286a92894b9aa800a9671fb94caf37997a2a0207da0542a484c209f27b4cf77",
|
||||
"backend/diagnostics.py": "9660b22d3bf9be229ce16d6dafd7c26c8180abe5b7e2b00bbb32bec7ce9bb1f5",
|
||||
"backend/gpt.py": "4eca5ccf458ef86b9dfcea6388da61defe61af6389565cadf2fda6616e28b791",
|
||||
"backend/helpers.py": "ac5422e60bcdd0273baa5d5796d64aa5b1e0687a709afc5bdf9c8501a7154d36",
|
||||
"backend/package.py": "5c55e91f2c348ac957d7803810e6396edf3aae573da401ecf46e773ac75e70ee",
|
||||
"backend/service.py": "0bd4137a37cb6346bc5c6ad6f9f580e6fc9e3311e32510022340c4505e95a89c",
|
||||
"backend/state.py": "af15010d0b1cb7b827f2cf69cb4b18139d5f33d408aae47da65b2c7cacc5952a",
|
||||
"backend/transport.py": "91017d0116a0d7b2c6f763ac6c8b092dedca987dce0b686e9b6f57681af25d1b",
|
||||
"backend/service.py": "b80c9bc9a92e2b5ef2fc9fa810be01c65873c76e986bc879d6cb7aa9d12ba7a4",
|
||||
"backend/state.py": "bc17eac46b099524b2f2ad687d9fd6fcd3d867929487ef4a80d528992d6b3d48",
|
||||
"backend/transport.py": "b022c4b6c2bc63090ebc2bf64ce6f3720a71cc90c95cfd5fa81836c156d956ba",
|
||||
"backend/__init__.py": "4227d63763e764fd2de7fc2bc13e474ae5de33176fb57aa0fd51cbb4ad80b88c",
|
||||
"screenshots/complete-dark-en.png": "f8709858ee45e4a562195684cdb17087ce7d6c60dcd7e3e0883f83b5baac4e07",
|
||||
"screenshots/help-recovery-light-zh.png": "7443b3880bcd616e861a436e50778414e246ae299c6ddf3eec65f2e44671c874",
|
||||
"screenshots/help-small-dark-en.png": "001502ca276fb48b5370a95c4211828809ffd53c6a110bc58eb71f30a63c563d",
|
||||
"screenshots/home-light-zh.png": "fe8e87a1c37d05dcc2eee9c688f10d0fd170b6ff0495a71270881378eb366a7a",
|
||||
"screenshots/install-small-light-zh.png": "46b3e5a494c32da5959b4cb5a80694a5a7eefd86f0c6942e9978c5723ea1dd5d",
|
||||
"screenshots/native-home.png": "c5503e2ad3b01508b86cf5802501ce12c8c7b8856d452487941b5fcb44b18c80",
|
||||
"screenshots/automatic-restart-log-en.png": "3556b20363fc5cc825062247a47ab35f7de4829ab5d500756cfed059d2473b90",
|
||||
"screenshots/backup-progress-debug-zh.png": "bf3c0579b42de5bc4256b68cf474a493f5d8c533c0597e6ce8cf8f1e6946d1b8",
|
||||
"screenshots/complete-dark-en.png": "b5e2dcc01b733acb950b13fb58112c88441e93de7a5698d3e669eed6ed33c396",
|
||||
"screenshots/failure-copy-diagnostics-zh.png": "6acd6c41ba95a0454c9ecbcb616d0a89a52fd3152e171f669e693a678313ae1a",
|
||||
"screenshots/firmware-convert-debug-zh.png": "0f1da31afe5956f38b8c5f0d302438a22a4fc1b31ba06d73d24c2496d3679dad",
|
||||
"screenshots/help-recovery-light-zh.png": "d727104e9111ffde9bc498dcf3bb1d3b252fb420882023fa926c48e591032d29",
|
||||
"screenshots/help-small-dark-en.png": "1578a98c7146afa4914865e4c9f0ccb089f74ae2fc357cd83e6e153362d87228",
|
||||
"screenshots/home-light-zh.png": "ecf1f16b74e4c7ad522ad332f6086a6c8a85a25e0e0bcd45be056366a1e4d334",
|
||||
"screenshots/install-activity-debug-zh.png": "61d2eeb1011faa4953f17a6f7b8b1552ae79b293f991ea563a6645b11b682ccb",
|
||||
"screenshots/install-small-light-zh.png": "979b0fbce2626cbdcb909cf665ebf0474f04f960865a588c2b807dd6c2ebd8a9",
|
||||
"screenshots/manual-restart-log-zh.png": "d9f7c306553ce7041152d7fc06a50fa598507d0fef71994c4be2f558d2f6c824",
|
||||
"screenshots/native-home.png": "7b6709a73d05acccba0e199fe31fb0b862e555a5dd18f12ec94584fc80aaddc7",
|
||||
"screenshots/native-mu300-home.png": "48ca20b2732f9a3d9522512ddd6121fc5eac4943d2cd928d7a21f0ba7c82a3a3",
|
||||
"screenshots/onboarding-light-zh.png": "37d8e26be61aff5b7c1851bce83af415666d8b6916775a58ac8e2f0446fbb4be",
|
||||
"screenshots/onboarding-small-dark-en.png": "f4f82bb46596db713021ec3d1398f83b5f96e0413ae7711a7b384c5c11b140fa",
|
||||
"screenshots/plan-light-zh.png": "9ff13ad155cb5c2fc58f34dae0345971787216f3a70ccadcd28d4adf1da37b3c",
|
||||
"screenshots/plan-small-dark-en.png": "13910ce085be317b4f72783a2275728a513257e31b693713510a2bcaa4f1843a",
|
||||
"screenshots/resume-small-light-zh.png": "b6ba295df3405b99434b153874be27f291038d4a61e63155b0914667bdafaa59",
|
||||
"screenshots/wait-root-dark-en.png": "940dd1a9059c32b08acd9adbc626fa5e59ef1999d9e84f2846ca503d9629805d",
|
||||
"screenshots/wait-setup-light-zh.png": "4c5be7057a8e9c7ce15e8fa9294678bda3a28d7a11208ee36ec63e03ead3d1d9",
|
||||
"screenshots/no-device-refresh-light-zh.png": "95b5dde3539e6c62c7444fd410888fcddd60a501a3464c3988b5ee905095e807",
|
||||
"screenshots/onboarding-light-zh.png": "e4af2536e761793a92cd52f2f9d470d889e0f742480d74993eae1064aad4cfec",
|
||||
"screenshots/onboarding-small-dark-en.png": "f0ed612d361dc23e42698fea89d3b7ea6683794334dd9edc00d10a5a94fdde0b",
|
||||
"screenshots/openwrt-endpoint-mismatch-zh.png": "4b1e5ee4e3688e7e280267378b9ef7f93789d7cea4f012bd6186f9a5af2d33f2",
|
||||
"screenshots/plan-light-zh.png": "7d5423a937bc6f7a3ef3c303b888adfc2f0fcae1f7b65e0566c6d66f7261fb94",
|
||||
"screenshots/plan-small-dark-en.png": "ac3892d855da2e5678065215cf2bd97547bd5d458f5ebae34596c31ccad63968",
|
||||
"screenshots/reinstall-no-card-plan-zh.png": "dd34b831ef466640c2f4a1cc69f295ec893fcadd07e31432a368a7db04994add",
|
||||
"screenshots/resume-small-light-zh.png": "41ae73d32f70e5da51dbd99adda4351bdbbb85c6e8174b3037012068efb118ac",
|
||||
"screenshots/update-complete-clock-en.png": "4c0475e7c4a4816ca94b8569182ea76bb4a969cc8ec4d54a670acf7a2ecbf97b",
|
||||
"screenshots/update-reboot-zh.png": "39c598e7ea8a8a483604eae01070b43a54bcd6be7dc148ece04f074aad29f733",
|
||||
"screenshots/update-reconnecting-zh.png": "2e7b99634dd6a0634d154615737903d4b442183088962990be9d68567953a020",
|
||||
"screenshots/wait-root-dark-en.png": "e124ab41e57c1ea67a7f0721c561a999606fbb85da179c7923b2ce1f90c9421f",
|
||||
"screenshots/wait-setup-light-zh.png": "28b006e5aaf0929a66b1a6ecd24fb387647ab8bae3265c213b8125d19cd09e39",
|
||||
"tests/diagnostics_smoke.py": "aefbcb66ae473453b2943d95af1d12ca74d11cae84d05a02f8b49c3e9b1664c1",
|
||||
"tests/enumeration_smoke.py": "289a34ebaf95eb6e41fda57d6386d9aa848ba7f219a16ec05d49497ef93345d9",
|
||||
"tests/frozen_flow_smoke.py": "9c451b8dcfa36154063a68c1690dbe0eefbdc48a73d58e3ace4a3d7ff6afd8af",
|
||||
"tests/frozen_method_smoke.py": "5741114dc5468c36652d832c5206c1f207a10010f43bc29f0f8e4ce68f9da2de",
|
||||
"tests/help_smoke.py": "18469c928604d5e8581c1aa702aa7cb9fae59a0dccca2ddd0a808263ae8b920f",
|
||||
"tests/method_smoke.py": "67cb5d5a3f6a80f8981fec28af25ed6e7801eeeab85fea79e8a935fd8bd5bf32",
|
||||
"tests/ordering_smoke.py": "f4f735dcb3d4a711133b67a7089c5258c9a06881c98d6c89986c36eec0249207",
|
||||
"tests/package_smoke.py": "f9ea830ae0e1801f52c8669b0b06033c6ee8c9a16745acc56c4b70b5f575ed26",
|
||||
"tests/refresh_smoke.py": "f68af963f467f8591aab08d0c18837f0686c8db45b4ac57e5ed069a71fc29df7",
|
||||
"tests/run_ui.py": "862dc5bc66dca2480895a6b4c3e731a9c60d69ad09a8b5011b937fbe4eb72a99",
|
||||
"tests/test_backup.py": "1e9e877b592113c9778367de3fd5e19452d61b96a93163e5430a6328c9113793",
|
||||
"tests/test_diagnostics.py": "7abc3c103cba42a0eb10b62f12edcca3f40efc3a959efb5dbc7cd5fe5f24e581",
|
||||
"tests/test_flow_boundaries.py": "e38366eb46c433ddc5080484f451ff072d2f40242893de3667ea792a89fe87ec",
|
||||
"tests/test_helpers.py": "317f4c2216e8e60c1024931eef3e2a5a23d43ea152a931ae830865362576c4cb",
|
||||
"tests/test_legacy_binding.py": "b2bbae1ef0c2ecdecb2b3caeaee47047293d89507bf890592c1bd23d76908c82",
|
||||
"tests/test_recovery.py": "a3dac4c91f6a7bd5ee0e3f6d7e6ae2e3f692d28224be03bd30c58f1eb0db51c3",
|
||||
"tests/test_state.py": "7fcce0b6788210c6f0378be961aa1561a5f77bcca57e4ed9c9492d2e156b2649",
|
||||
"tests/ui_smoke.py": "d66191f40544b27109f99d6743e80077888f637a1fe9bf47394f359d5229305d",
|
||||
"tests/test_method_routing.py": "b8a7f820c91a97bf73a980972850cacb00bb7968488a695911d55043cd67a744",
|
||||
"tests/test_openwrt_confirmation.py": "ed9fb932cb6be775a52cd569b61a245c787bbe2b2935a21d469f38daf3c0c469",
|
||||
"tests/test_recovery.py": "7b066dc300ee5df2e4e819aa2a7c2ab6a9c1e8a07d044da2ca3d3b2860945a64",
|
||||
"tests/test_state.py": "ee80f34e9b295ffd4a92280836ceb6090b17d531e5914f0f5b86fa3bce0dca19",
|
||||
"tests/test_transfer.py": "9e32e05d43274a1910335c9fca212cd6eeb1c82e3265fdcbcd98612ef9cd14f7",
|
||||
"tests/test_update_lifecycle.py": "2527f1cfc3f51dc332c857d658b9fc44f1e8f4df026ce535bfe406e602a15da0",
|
||||
"tests/ui_smoke.py": "fe42a51381995b8e060ed67d1cbd49bfc021cd63a64737d07eeee4e4ffc70197",
|
||||
"tests/update_smoke.py": "bb16efe0dbd6379b6ab7b6f45cd5cdf1beb56e01bda232bd82cb6c69be5a3fb1",
|
||||
"ui/components.json": "c9956b81d4afe05c5df651ab933d75a4aae6782e499fba9a653fd992381b2fba",
|
||||
"ui/index.html": "0ce43c18781e1d0d6184ab0e4dade150a2a79ab8afc3693c54f491bd19dae5d8",
|
||||
"ui/package-lock.json": "20dc70b3177789a10c9de3f2d6bcdc3cbc570dac47bd8a5c4e31ff137cbe1cda",
|
||||
@@ -50,25 +81,71 @@
|
||||
"ui/tailwind.config.js": "83a2b606389ae80ddc566da9f28fc5a87b6b012c33d0e2140396b81f8c784131",
|
||||
"ui/tsconfig.json": "cd09393aa9aab0b15cb2020d329e9f77a745efaa83c032a81121ea6f80c4face",
|
||||
"ui/vite.config.ts": "0cdd04c180bc500cfbada1781eaba986a84637c820c0bea668c148ed08136d7b",
|
||||
"verification/boot-confirm-e5-sizes.json": "d5a21942ec6359f0d4cbb0697d820e8443a9f8079c21fbe4b040759dd133f6a9",
|
||||
"verification/boot-confirm-frozen-flows.json": "2a729d3fef6054d75fbaf782ec830f4441e6ab5e2b879a134f21b5a5f6dbd0cf",
|
||||
"verification/boot-confirm-frozen-methods.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/boot-confirm-packages.json": "597eed8a4bdb622cc213315c330056e6dde447de15456be62c08dd89bfd4b668",
|
||||
"verification/boot-confirm-record-compatibility.json": "ff91441ec1ea51b87707e5ce8b63498d98b2dfdc1d78e502046654ad6412bc5a",
|
||||
"verification/boot-confirm.json": "b9758a7009b3ee34bb2a59fb1cee62792885e1aefb054557f4fc99470481b37a",
|
||||
"verification/debug-artifact-flow.json": "e5cc619afb32147e5b589d986333a5f367f5809aa119dbc33fc55ba5333dff28",
|
||||
"verification/debug-e5-sizes.json": "10d8bf1462fcec2cc930c964133aae206dc5e1f0425db92b5d2723a8eafa7615",
|
||||
"verification/debug-frozen-flows.json": "4ff97bfcdcd532abe4de81932d9695179134eac07315fd796288d1cc1d39ee78",
|
||||
"verification/debug-frozen-methods.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/debug-packages.json": "7c9bc43eb4c5e1770c8a205413de110aae2fe378d0f82c113b830122afdb5d78",
|
||||
"verification/debug.json": "31e6d428cd8dff6ce125eb1bd819756a77f77d96c8f39bdfdc3e56fe6f082f55",
|
||||
"verification/flow-posix.json": "cf3c3decd20b64b735384b1c64ed8667fea60a3594c7fad115392a28a7b1625d",
|
||||
"verification/help-e5-packages.json": "a2fbf23958da15413d69ec5f5b177bd8628aa2fe54a335308df1374d446f5b88",
|
||||
"verification/help-e5-sizes.json": "78dd447ba24857800450358348e7fad3bba9e81ac11673aad7e00e2e1477f23f",
|
||||
"verification/help-mu300-packages.json": "bdd34148c3fe201dac204166635bbc2c1db7a706472031ea98119319aa6ff3fd",
|
||||
"verification/help-mu300-sizes.json": "7cb880644efb91a6db992746455a6fdbe4019fdb49837c8364ddcaab6a16656b",
|
||||
"verification/help.json": "d96debbb19bb0f25114fba7e6aa3d5dde9078da64c6e53154114904b2267e11b",
|
||||
"verification/helper-real-m8.json": "eaff8e208a69d0d5319c580e408ae2cf5d6094bfe2d17b3e4cace9c96c325d0b",
|
||||
"verification/helpers-e5-sizes.json": "31617688e7456c31cfabf37d1949b259aaad937f714a0e6e472044d3230125fe",
|
||||
"verification/helpers-frozen-flows.json": "4ff97bfcdcd532abe4de81932d9695179134eac07315fd796288d1cc1d39ee78",
|
||||
"verification/helpers-frozen-methods.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/helpers-packages.json": "ad7c0cb7a4f16f7485a302f7604460a99d637b46c9cdba22c9ac385c4f2a25d9",
|
||||
"verification/helpers-record-compatibility.json": "a07fcc27530c98ef4c06b8dda4199a55ef8677e5ff04bf4cfac22ceaa819aa7c",
|
||||
"verification/helpers.json": "89c0ff3a2bb7283efb01e3c377650b899faf8dbf916681e6d2d302850f079d0a",
|
||||
"verification/m8-frozen-backup.json": "e2e1a951745ae8f44a661803a03166db4a968e8041f44f9f85f3a38c1f281a69",
|
||||
"verification/m8-readonly-backup.json": "23020579c3eba9434dcdaaf041f5e9c407ac19a9d667546f9d163f02efe6699a",
|
||||
"verification/payload-invariance.json": "e7b36a11dc32fbbaad6bc58a9fd57dff6578bfe0b63ff99fa8218af3cecb2e62",
|
||||
"verification/reboot-wait-e5-sizes.json": "898f9758613c692f3fb4875bae048e993bf52dbdfa6fa8d3b4112f7f86f7c66e",
|
||||
"verification/reboot-wait-frozen-flows.json": "2165947fc27b3972fd9d1b3b3943d803d92112d0bc4d60c00b4370c538a78b13",
|
||||
"verification/reboot-wait-frozen-methods.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/reboot-wait-packages.json": "274729e2221029c128bf4dfc1cd5a0c4d096cf6fd722a7c076281e3c9e4bd45f",
|
||||
"verification/reboot-wait.json": "e1a1afee5f57a131047fa220584c80543b7070a7d3d405f7f751d236f406edea",
|
||||
"verification/refresh-e5-packages.json": "aac98757b7bef81185dcf22d6fe7929c088de83b5376e4310b1f0bd846777739",
|
||||
"verification/refresh-e5-sizes.json": "153aab3fe70b37b16eb12bbdc488e350b9ad03d02334b12c8a777349ac9e324b",
|
||||
"verification/refresh-enumeration-artifact.json": "1dcb16dae37e1d96e62f387e57f1cf65e573ef2322044ea3a4c613cfc247582e",
|
||||
"verification/refresh-enumeration-packages.json": "32b96af06e999c365fc2ba94e84c8b48f0dd7486c06c4d88ab3ff40d97d6faa8",
|
||||
"verification/refresh-mu300-packages.json": "76d97fecc96070487fae9cb5a17569e4ef5c8f4b8ef2a2095c25829e2ac90440",
|
||||
"verification/refresh-mu300-sizes.json": "415caea4f2d7f6ff97728e6b0c81ac0fb66dfee9c030be92d60e80509eeb36ce",
|
||||
"verification/refresh.json": "53ddb48f87ff32844411a522b81ba5c2f44c4463507532fe012f9f952a234a77",
|
||||
"verification/routing-e5-packages.json": "a9d71e5a85e3c878c08af2177d6f8bb74d82d647c27ca9ef5bd08fb6ded291e4",
|
||||
"verification/routing-e5-sizes.json": "f582e445b4aec4801b654c3fa444909fe428196c2feec3a6d453ab95b637f0af",
|
||||
"verification/routing-frozen-probes.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/routing-mu300-packages.json": "a8de9d59275095dc0efc431fa4ba45844199c1358449b1357ecee95530829bba",
|
||||
"verification/routing-mu300-sizes.json": "696e3c2546ec09bb817d33bb4694730d7c25823dfae164d96566b72168c54f51",
|
||||
"verification/routing.json": "cd8b3b63c413871322a1252755d57e9a08c4254297424aea3be124dc8a77719d",
|
||||
"verification/ui-polish-e5-packages.json": "ae81da39699cdd8fac3acde62928d4299d6c15c5da9ff2cb1dc16ad072983a1f",
|
||||
"verification/ui-polish-e5-sizes.json": "93c7833215d99598951392c2608c82f4c6e23605398db02aae6aebd8f1a4d013",
|
||||
"verification/ui-polish-mu300-packages.json": "0002096d1a12d38c68d09166ed3b63bddc6ec1c199a43ccedc3bac2836f40e86",
|
||||
"verification/ui-polish-mu300-sizes.json": "31e0df9b4645e98f1fe91c5b831b556424d413d2afa31000e6a90e2ea5c8a350",
|
||||
"verification/ui-polish-t551m-package.json": "a59c13ef8903326cafae846b00803de934b28ff128c85c55a5b1c3936685d726",
|
||||
"verification/ui-polish.json": "014d2e86010336d9fafac14eb5852139172cc228c389d5efb1a74fd9acfd7245",
|
||||
"verification/ui-regression.json": "c9ef5029fa4f124503f43d9c2c9097711186e96f8a237cde285c0d12462eba2f",
|
||||
"verification/update-reboot-e5-sizes.json": "d8a2d1aa7d06e48e79198c5374a126a3c69216761d2d060dcfd476313786042f",
|
||||
"verification/update-reboot-frozen-flows.json": "8c40288dfb40fbe9c4933730f47c2d6789725bfb51f96d27e5af5e91346e4ef9",
|
||||
"verification/update-reboot-frozen-methods.json": "f91e016535fd1d473a87dcca44919f2aa338372945dbf79716c982a20114f0d0",
|
||||
"verification/update-reboot-packages.json": "861a7816829aeb3c94ea0a1297e457a01ae70e82999b95a5690b02a9bb30adb5",
|
||||
"verification/update-reboot.json": "26d586d25315c1d290d3e6ddae83322dd294a00a43a60ec232d7e47af7f61dee",
|
||||
"verification/windows-packages.json": "2527a520a27d9eb0f9243aa9e2ed05b0e4b90caefc8257ea3afe76acdb75a19d",
|
||||
"ui/src/help-data.ts": "3559333ab059b60829b7aef8fbdf92b932c2ce01cee5d7d8b5eef40cae42e4b6",
|
||||
"ui/src/help-i18n.ts": "ffc22b67831f01ae70e8d3d98c6e3c0a351f22a1049e05b998bc072ca9b2864a",
|
||||
"ui/src/i18n.ts": "7f8c2f012a05f0b929b5e24d5474b3757416c2676e96f416134555c11d6db35f",
|
||||
"ui/src/main.tsx": "04503826ce30559f2f7ad491336de8adcb68970fe5fa20b50f5a0121a1955cbe",
|
||||
"ui/src/protocol.ts": "c2395c2a4bfea8f0ee399d121087f70c9be1c110f794848648689600c9bbe653",
|
||||
"ui/src/style.css": "3ce3723977143c46d9ed0bc996540aea0f6b509608a8e4742ff99de24890df8a",
|
||||
"ui/src/i18n.ts": "b288b30cc15eed937f602c9df39047107debea45a7ac0517ff2b0858e2c84940",
|
||||
"ui/src/main.tsx": "13ef14c117f3c95318a26c3fda58cd534727ee9a256da5a5a988dfd52ff9534f",
|
||||
"ui/src/protocol.ts": "acee2ee6a5608024563087a194998ebc4f2b55df01b449075bac3cb8e9f7e723",
|
||||
"ui/src/style.css": "9a9de3abad20439ec00fdf97d4abb7c2428ed47b835ebba657905b8f0df406d9",
|
||||
"ui/src/utils.ts": "dd51582c0905c3507bd5dc3d32215a43fc156f6432042a7deb393fe4258b05ba",
|
||||
"ui/src/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
|
||||
"ui/src-tauri/build.rs": "8af41c0062014fc594e4bb9899e60ee9930ab57d4cf0c73041ff557d6ec736e6",
|
||||
@@ -81,7 +158,7 @@
|
||||
"ui/src/components/ui/sonner.tsx": "59738d9ced20160c9d74971beb4fd23b794e5ff0682b998af55f604f92fdc9f8",
|
||||
"ui/src-tauri/capabilities/default.json": "84a9a609f4cae132de6b7ee626a8d5c396eee5c2030d416922f4db5dc9624299",
|
||||
"ui/src-tauri/icons/icon.ico": "5851131da4274abc593d41fa701a14ea3a99fda2da02bc5845c70664f7766094",
|
||||
"ui/src-tauri/src/main.rs": "41368ae5682cd8e71af470ce07685b50267324b9082d87f05bbce08e332c5024",
|
||||
"ui/src-tauri/src/main.rs": "d2056aab9e8cc7597518c3c7f9dc95c6d1d2c52c6c6dbf382ff927dc7e7aa0d1",
|
||||
"ui/src-tauri/gen/schemas/acl-manifests.json": "bdc3ced2ae416f11b23bc9c9b62341a3a59aa7bb5322f04f197bb08cb610409f",
|
||||
"ui/src-tauri/gen/schemas/capabilities.json": "a4a9ce710aadc06946c296cfb8a0df506767ed310de13e32b5914d295fc81e56",
|
||||
"ui/src-tauri/gen/schemas/desktop-schema.json": "4a946fe48fbb0c7c535ea53e6070bd8276f3f3d74f96efbaa6d85bd7b53b0f05",
|
||||
|
||||
@@ -6,14 +6,19 @@ Implemented in both repositories with one canonical shared source and a hash-che
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| Persistent protocol/state/recovery tests | 27 passed on Windows; real temporary journals, CLI selection among multiple devices and a separate-process OS lock contender |
|
||||
| Persistent protocol/state/recovery/routing/diagnostic/backup/helper tests | E5: 79 passed. MU300: 79 run, 77 passed and two E5-source-specific tests skipped. Includes adapter/routing/recovery/backup/converter tests, endpoint correction, mandatory capacity checks, pre-update boot capture, commit without replay, old-runtime rejection before reboot, manual confirmation retaining reboot proof, missing/invalid evidence, frozen phase clocks, connection refusal/timeout/absent interface/EOF/SSH-banner loss as neutral waits, disconnect during remote reads and SSH close without a command exit status |
|
||||
| e5 targeted installer suites | 65 passed across entrypoints (7), installed detection (3), diagnostics (22), two-stage preparation (9), TF growth (5), partition boot (5), userdata size/failure ordering (6), hybrid package/Magisk fixtures (8) |
|
||||
| MU300 desktop suites | 43 run in WSL; 39 passed, 4 environment-dependent checks skipped |
|
||||
| Expanded device-script regression | 27 suites pass in WSL (12 E5 and 15 MU300). One additional E5 GPT allocation-plan suite is environment-blocked because its required local Docker image is missing. No Docker/image was installed. `verification/flow-posix.json` records exact outputs/skips. MU300 BusyBox fault injection initially bypassed PATH; the fixture now explicitly invokes its injected dd, and all 33 boot-chain tests pass |
|
||||
| React/TypeScript/Vite release | Passed; main JS about 430 kB (138 kB gzip), help module about 184 kB (61 kB gzip), CSS about 26 kB; help/Markdown code loads on demand |
|
||||
| Tauri Windows x64 release | Passed with Rust 1.90.0/MSVC, size optimization, LTO and strip |
|
||||
| Native Windows launch | Passed using system WebView2; real native window captured in `screenshots/native-home.png` |
|
||||
| UI interaction smoke | Passed: fixed 1120×900 and 800×650 viewport; 120 recovery records; 500-line bounded log; independent scrolling; fixed titles/actions/footer; bottom sidebar reminder; Sonner results/errors and repeated-state deduplication; native dialog/export error handling; light/dark/system themes, Chinese/English, reduced motion, explicit multi-device selection, confirmation, waiting states and completion |
|
||||
| Onboarding/help smoke | Passed: first launch, three steps/back/finish/skip/replay, persistent acknowledgement, saved-record suppression, offline manual/search/no matches, keyboard focus trapping/restoration, Escape/F1, contextual help during a waiting transaction without sending backend commands, English/Chinese, dark/light and minimum-window bounds |
|
||||
| Device refresh/copy regression | Passed: refresh before package verification, repeated empty results and errors leave retry enabled, multiple/unauthorized devices, stale root inspection cleared, install/advanced/boot views, bounded layout and selective text copying |
|
||||
| Installation method UI regression | Passed: Advanced defaults to reinstall; explicit internal/TF/image choices survive device inspection; no-card reinstall sends reinstall to probe and plan; review names the internal method/target/impact; returning preserves origin and method; no start command sent |
|
||||
| Ordering/debug/progress UI regression | Passed: older responses/events cannot replace newer checkpoints; unconfirmed saved plans reopen confirmation; rejected pause has no success toast; DEBUG logs automatically open and collapse/reopen; real-byte backup bar; activity bar without fake percentages; actionable exception and one-click persisted diagnostics; all six browser suites pass |
|
||||
| M8 physical backup and metadata verification | Saved identity matched VIPME M8. All 13 misc/A-B boot-chain backups, 159,387,648 bytes, completed in 17.70 s via dd to a private `/data/local/tmp/` directory plus adb pull. Source, staged and PC SHA-256 agree; staging cleaned. Original backup preserved. GPT/model/slot/root/existing 10 GiB partition inspected read-only. No device partition writes. See `verification/m8-readonly-backup.json` |
|
||||
| Visible button contrast | Home/install pages: minimum 4.91:1 in light mode and 8.76:1 in dark mode (computed colors with alpha compositing; hidden/disabled controls excluded) |
|
||||
| Frozen backend and CLI | All five final package folders pass real NDJSON hello/package/list and bundled CLI package verification; stdout is strict UTF-8 |
|
||||
| Frozen MU300 boot builder | Both kernel families pass `--check-boot`, constructing actual boot images for Android A/B on the computer without device access |
|
||||
@@ -40,6 +45,18 @@ Device-script tests ran in WSL Ubuntu 22.04 with disposable files and mock block
|
||||
- [Offline help and recovery FAQ, Chinese](screenshots/help-recovery-light-zh.png).
|
||||
- [Help at 800×650, dark English](screenshots/help-small-dark-en.png).
|
||||
- [Getting started at 800×650, dark English](screenshots/onboarding-small-dark-en.png).
|
||||
- [No-device state with enabled refresh before package verification](screenshots/no-device-refresh-light-zh.png).
|
||||
- [Reinstall internal partition plan without a TF card](screenshots/reinstall-no-card-plan-zh.png).
|
||||
- [Measured backup byte progress and DEBUG log](screenshots/backup-progress-debug-zh.png).
|
||||
- [Installation activity bar and DEBUG log](screenshots/install-activity-debug-zh.png).
|
||||
- [Failure details and one-click diagnostic copying](screenshots/failure-copy-diagnostics-zh.png).
|
||||
- [Named firmware conversion stage with stale transfer progress cleared](screenshots/firmware-convert-debug-zh.png).
|
||||
- [Manual restart guidance and explicit OpenWrt confirmation with logs expanded](screenshots/manual-restart-log-zh.png).
|
||||
- [Correcting a management address belonging to another device](screenshots/openwrt-endpoint-mismatch-zh.png).
|
||||
- [Automatic restart guidance and editable verification target, dark English](screenshots/automatic-restart-log-en.png).
|
||||
- [Update submitted and automatic restart guidance](screenshots/update-reboot-zh.png).
|
||||
- [Expected update reboot disconnect as a neutral reconnection wait](screenshots/update-reconnecting-zh.png).
|
||||
- [Update verified with a stopped phase clock, dark English](screenshots/update-complete-clock-en.png).
|
||||
|
||||
The browser screenshots use the production React bundle with a **test-only** protocol fixture in `tests/ui_smoke.py` and `tests/help_smoke.py`. That fixture is not imported into production, does not exist in the firmware packages, and does not open ADB/SSH. These screenshots verify rendering and interaction, not a completed hardware installation. The native screenshot verifies an actual Windows launch.
|
||||
|
||||
@@ -49,7 +66,9 @@ Onboarding and help use the same source in both repositories. The detailed manua
|
||||
|
||||
## Hardware boundary and recovery limitations
|
||||
|
||||
No connected-device installation, formatting, GPT mutation, userdata reset/shrink, boot-chain synchronization, misc write, live SSH upgrade or Magisk flash was performed in this task. ADB enumeration during read-only package smoke found zero devices. Hardware behavior of those paths is therefore **not newly hardware-validated**. Their existing device code is reused; automatic tests exercise the host protocol and recovery logic with simulated transports.
|
||||
No connected-device installation, formatting, GPT mutation, userdata reset/shrink, boot-chain synchronization, misc write, live SSH upgrade or Magisk flash was performed. The physical M8 validation was limited to identity/root/GPT inspection and source-partition reads for backup. As explicitly requested, dd wrote ordinary temporary files under `/data/local/tmp/`; adb pulled and verified them, then removed those files and their private directory. Device partitions were not written. Installation/update/reset behavior remains **not newly hardware-validated**; automatic tests use simulated transports.
|
||||
|
||||
The supplied M8 failure record stopped at `backup`, with no effects/completed writes. The old whole-boot Base64 read reproduced a 120-second timeout on 64 MiB `boot_a`, which was hidden by the generic interruption message. The final implementation removes Base64 and custom compressed/raw-stream backup paths entirely. It uses staged dd/adb pull, reports actual local bytes, preserves verified files on failed download, and records the concrete exception/traceback. DEBUG logs persist across restarts and are redacted before disk/UI emission. Copy diagnostics reads the persisted report rather than only the UI's recent 500 entries.
|
||||
|
||||
Uncertain interrupted writes do not automatically repeat partition preparation. A trusted host transaction plus matching hardware/geometry/token is required to enter stage two. A completed effect is skipped; a started nonrepeatable effect without conclusive completion stops for recovery. Missing host records with insufficient backups/markers stop rather than infer a partition layout. This is deliberate fail-closed behavior, not a guarantee that every power-loss point can recover without manual backup-based repair.
|
||||
|
||||
@@ -68,6 +87,22 @@ The polished UI refresh is delivered separately in e5 `out/gui-releases/20261015
|
||||
|
||||
The subsequent onboarding/offline-help revision is in e5 `out/gui-releases/20261015-guide/` and MU300 `release/gui-20261015-guide/`. It retains the same system/boot payloads and independent package directories. Use these `guide` paths for the latest local build. Per-package sizes and frozen-backend checks are recorded under `verification/help-*.json`.
|
||||
|
||||
The device-refresh and text-selection fix is in e5 `out/gui-releases/20261015-refresh/` and MU300 `release/gui-20261015-refresh/`. Use these `refresh` paths for the latest build; earlier local packages remain separate. The refresh button no longer depends on payload verification. Enumeration is read-only; device inspection and writing retain the payload gate. Per-package checks and sizes are under `verification/refresh-*.json`.
|
||||
|
||||
The internal-reinstall/method-routing fix is in e5 `out/gui-releases/20261015-routing/` and MU300 `release/gui-20261015-routing/`. Root cause: the shared E5 probe called the mandatory SD detector for every mode and caught `SystemExit`, while GUI-mode `die()` raises `ValueError`. The fix removes that detector/capacity check from non-TF modes rather than swallowing errors. A separate UI issue that replaced selected methods with recommendations was removed, and Advanced's hidden `part` default and review-back reset were corrected.
|
||||
|
||||
The debug/progress/fast-backup revision is in e5 `out/gui-releases/20261015-debug/` and MU300 `release/gui-20261015-debug/`. It includes the routing fixes, recovery checkpoint fixes, detailed diagnostic sharing and staged dd/adb pull. Earlier local releases and the user's original backup ZIP are left intact. Firmware payload hashes remain unchanged. Per-archive sizes, checksums and frozen-backend checks use `verification/debug-*.json`.
|
||||
|
||||
The latest local build fixes host firmware conversion: e5 `out/gui-releases/20261015-helpers/` and MU300 `release/gui-20261015-helpers/`. The optimized frozen backend stripped the VBC helper's module docstring, causing its argparse initialization to fail. The old unbounded, uncaptured child execution also left the UI displaying the preceding transfer's 100%. Helpers now run with source docstrings/assertions preserved, detached stdin, captured diagnostics, named stages, safe host-child cancellation and a 120-second converter timeout. The exact internal reason the original child remained alive is not established; the missing-docstring exception was reproduced independently.
|
||||
|
||||
Both real converters were executed by the rebuilt frozen backend against six preserved M8 input files, with no device access. All five generated files matched normal-Python reference bytes, completing together in 0.547 seconds in the first run. Only output sizes and pass/fail evidence appear in `verification/helper-real-m8.json`; private input files and Bluetooth addresses are excluded. Backend tests include an optimized-host regression, timeout/cancellation/errors, and the actual extraction-to-conversion path with simulated ADB. Browser regression verifies that structured activity clears stale transfer percentages within a stage. `verification/helpers-*.json` records the new package sizes and frozen-package checks. A real reinstall remains unperformed.
|
||||
|
||||
Each extracted folder contains `OpenWrt-Installer.exe`, compatible `OpenWrt-Installer.py`, bilingual `START-HERE.md`, Magisk root entries and subdirectories for tools/resources. The EXE must be kept with its package. `verification/windows-packages.json` contains actual frozen-backend/CLI results. Machine-readable per-archive size reports distinguish root GUI executable, host backend/tools (`tools/`, `scripts/`, `desktop/`), firmware payload (`files/` or `payload/`) and compressed ZIP bytes. Counts do not include build caches or development dependencies.
|
||||
|
||||
The newest-first log/restart/explicit-verification revision is in e5 `out/gui-releases/20261015-boot-confirm/` and MU300 `release/gui-20261015-boot-confirm/`. Use these paths for the latest build. Manual restart instructions remain above the scrolling content; phase 4 includes editable host/password and a boot-confirmation button. Multiple routers with the same default address cannot be disambiguated by clicking confirmation alone: the computer must reach the intended endpoint, whose CID is checked before root-device/capacity reads. Wrong-device/authentication/connection failures allow retargeting while the original worker keeps the device mutex. UI logs reverse whole entries, preserving multiline tracebacks; copied/exported diagnostics remain chronological. Tests use simulated SSH only; no device restart or installation was performed for this revision. Evidence uses `verification/boot-confirm-*.json` and `verification/ui-regression.json`.
|
||||
|
||||
See [build instructions](README.md), [user guide](GUIDE.md) and [protocol contract](PROTOCOL.md).
|
||||
|
||||
The latest update/reboot/timer revision is in e5 `out/gui-releases/20261015-update-reboot/` and MU300 `release/gui-20261015-update-reboot/`. The prior version could verify the still-running old system during the three-second scheduled reboot delay. Update completion now requires a new boot UUID from the same CID before capacity reads, and committed updates resume verification without replaying uploads or writes. A missing pre-update boot UUID in an older saved update is reported explicitly rather than guessed. Plans, persistent progress guidance, notifications and update-specific results explain the automatic reboot. Completed/failed/paused clocks use saved phase bounds and do not keep ticking. Seven browser suites include these states; frozen-package simulation tests the old/new boot sequence for all five packages. This revision did not reboot, update or install any real device. Reports use `verification/update-reboot-*.json`.
|
||||
|
||||
The latest reconnection correction is in e5 `out/gui-releases/20261015-reboot-wait/` and MU300 `release/gui-20261015-reboot-wait/`. Expected transport loss now keeps automatic update reboot in `waiting_device`, clears stale verification errors and shows a neutral restarting/reconnecting heading. The old generic connection warning is removed from this wait; DEBUG retains the transport exception. Authentication and wrong-device errors remain actionable. Unit tests cover five connection-loss types in both adapters and SSH loss during command reads; browser tests check neutral toasts, deduplication and editable controls. Frozen-package tests inject EOF and refusal before an old/new boot sequence. No hardware access was performed. Evidence uses `verification/reboot-wait-*.json`.
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Repository adapters call existing installation code, never frontend shell."""
|
||||
from contextlib import redirect_stdout, redirect_stderr
|
||||
from contextlib import contextmanager, redirect_stdout, redirect_stderr
|
||||
import gzip
|
||||
import hashlib
|
||||
import importlib.util
|
||||
@@ -17,6 +17,7 @@ from types import SimpleNamespace
|
||||
from . import gpt
|
||||
from .state import Pending, RecoveryRequired, atomic_json, sha
|
||||
from .transport import Adb, push_chunks
|
||||
from .diagnostics import DebugStream, traced
|
||||
|
||||
|
||||
def load(path, name):
|
||||
@@ -26,11 +27,14 @@ def load(path, name):
|
||||
return module
|
||||
|
||||
|
||||
class Quiet(io.TextIOBase):
|
||||
def write(self, text):
|
||||
return len(text)
|
||||
def flush(self):
|
||||
pass
|
||||
@contextmanager
|
||||
def debug_output(context):
|
||||
stream = DebugStream(context)
|
||||
try:
|
||||
with redirect_stdout(stream), redirect_stderr(stream):
|
||||
yield
|
||||
finally:
|
||||
stream.flush()
|
||||
|
||||
|
||||
def args_for(record, directory):
|
||||
@@ -46,6 +50,25 @@ def args_for(record, directory):
|
||||
serial=record['device']['serial'], adb=None, host=choices.get('host'))
|
||||
|
||||
|
||||
def installation_committed(record):
|
||||
"""Only final, verified effects can bypass the initial Android plan.
|
||||
|
||||
A stage-one boot selection is not a final installation. Legacy two-stage
|
||||
records must still use their geometry/token-aware resume implementation.
|
||||
"""
|
||||
method = record['choices']['method']
|
||||
if record.get('legacy') or record['plan'].get('method') != method:
|
||||
return False
|
||||
done = {name for name, value in record['effects'].items() if value['state'] == 'done'}
|
||||
if method == 'update':
|
||||
return 'update-commit' in done
|
||||
if record['package']['adapter'] == 'e5':
|
||||
return method in ('tf', 'part', 'image', 'boot') and 'misc-trial' in done
|
||||
return record['package']['adapter'] == 'mu300' and (
|
||||
method == 'tf' and 'root-tf-write' in done or
|
||||
method in ('part', 'reinstall', 'image') and any(name.startswith('boot-and-misc-') for name in done))
|
||||
|
||||
|
||||
class Adapter:
|
||||
def __init__(self, package, context=None):
|
||||
self.package = package
|
||||
@@ -61,6 +84,19 @@ class Adapter:
|
||||
self.adb = None
|
||||
self.password = ''
|
||||
self.expected_ssh_key = None
|
||||
if self.ctx:
|
||||
if self.kind == 'e5':
|
||||
original = self.legacy.adb
|
||||
def observed(*args, **kwargs):
|
||||
return traced(self.ctx, 'legacy ADB '+shlex.join(map(str,args)),
|
||||
lambda:original(*args, **kwargs), output=True)
|
||||
self.legacy.adb = observed
|
||||
else:
|
||||
original = self.legacy.Android.call
|
||||
def observed(android, *args, **kwargs):
|
||||
return traced(self.ctx, 'legacy ADB '+shlex.join(map(str,args)),
|
||||
lambda:original(android, *args, **kwargs), output=False)
|
||||
self.legacy.Android.call = observed
|
||||
|
||||
def stage(self, stage, status='running', **details):
|
||||
if self.ctx:
|
||||
@@ -70,13 +106,21 @@ class Adapter:
|
||||
if self.ctx:
|
||||
self.ctx.transfer(name, done, total, since)
|
||||
|
||||
def run_tool(self, script, *arguments):
|
||||
from .helpers import run_helper
|
||||
return run_helper(self.ctx, self.root, script, arguments)
|
||||
|
||||
def action(self, name, operation, retry_safe=False):
|
||||
if not self.ctx:
|
||||
raise ValueError('Writes are unavailable during a probe')
|
||||
if self.ctx.record.get('legacy') and name in ('bootchain-sync', 'misc-trial'):
|
||||
state = json.loads(Path(self.ctx.record['legacy']).read_text(encoding='utf-8'))
|
||||
name += '-' + state.get('phase', state.get('state', 'unknown'))
|
||||
return self.ctx.effect(name, operation, retry_safe=retry_safe)
|
||||
result = self.ctx.effect(name, operation, retry_safe=retry_safe)
|
||||
if name == 'update-commit':
|
||||
self.stage('openwrt_boot','waiting_device',reboot_manually=False,
|
||||
host=self.ctx.record['choices'].get('host'))
|
||||
return result
|
||||
|
||||
def saved(self, path, record):
|
||||
if self.ctx:
|
||||
@@ -98,7 +142,8 @@ class Adapter:
|
||||
|
||||
def reboot(self):
|
||||
# Persist expected loss of transport BEFORE sending reboot.
|
||||
self.stage('android_boot' if self.ctx.record['plan'].get('two_stage') else 'openwrt_boot', 'waiting_device')
|
||||
self.stage('android_boot' if self.ctx.record['plan'].get('two_stage') else 'openwrt_boot',
|
||||
'waiting_device', reboot_manually=False)
|
||||
|
||||
def push(self, call, shell, local, remote):
|
||||
return push_chunks(call, shell, local, remote, self.ctx)
|
||||
@@ -107,10 +152,19 @@ class Adapter:
|
||||
fingerprint = hashlib.sha256(client.get_transport().get_remote_server_key().asbytes()).hexdigest()
|
||||
if self.expected_ssh_key and fingerprint != self.expected_ssh_key:
|
||||
raise ValueError('SSH device identity changed / SSH 设备身份改变')
|
||||
if self.ctx and self.ctx.record['choices']['method'] == 'update':
|
||||
_, out, _ = client.exec_command('cat /proc/sys/kernel/random/boot_id', timeout=15)
|
||||
boot_id = out.read().decode().strip()
|
||||
if out.channel.recv_exit_status() or not re.fullmatch(r'[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}',boot_id):
|
||||
raise ValueError('Cannot establish pre-update boot identity / 无法确认更新前的启动标识')
|
||||
self.ctx.record['update_boot_id'] = boot_id
|
||||
self.ctx.store.save(self.ctx.record)
|
||||
self.stage('transfer_install')
|
||||
return fingerprint
|
||||
|
||||
def bind(self, serial):
|
||||
self.adb = Adb(self.root, serial)
|
||||
self.adb.context = self.ctx
|
||||
if self.kind == 'e5':
|
||||
self.legacy.ADB = self.adb.exe
|
||||
self.legacy.SERIAL = serial
|
||||
@@ -118,6 +172,8 @@ class Adapter:
|
||||
self.legacy.find_adb = lambda: None
|
||||
|
||||
def probe(self, serial, method='part'):
|
||||
if method not in ('tf', 'part', 'reinstall', 'image', 'boot'):
|
||||
raise ValueError('Unsupported Android installation method / 不支持的 Android 安装方式')
|
||||
self.bind(serial)
|
||||
devices = self.adb.devices()
|
||||
entry = next((d for d in devices if d['serial'] == serial), None)
|
||||
@@ -159,8 +215,12 @@ class Adapter:
|
||||
'echo SOURCE=$(awk \'$2=="/data" {print $1;exit}\' /proc/mounts); '
|
||||
'for u in /sys/class/block/${b}p*/uevent; do '
|
||||
'grep -qE "^PARTNAME=(e5root|mu300root)$" "$u" && { n=${u%/uevent}; echo ROOT=${n##*/}; } || true; done; '
|
||||
'if [ -b /dev/block/mmcblk1p1 ]; then echo TF=/dev/block/mmcblk1p1; '
|
||||
'elif [ -b /dev/block/mmcblk1 ]; then echo TF=/dev/block/mmcblk1; fi', root=True)
|
||||
'cards=""; for p in /sys/class/block/mmcblk*; do k=${p##*/}; '
|
||||
'case $k in *p[0-9]*|*boot*) continue;; esac; '
|
||||
'[ "$k" = "$b" ] || cards="$cards $k"; done; '
|
||||
'set -- $cards; if [ "$#" -eq 1 ]; then '
|
||||
'if [ -b /dev/block/"${1}p1" ]; then echo TF=/dev/block/"${1}p1"; '
|
||||
'elif [ -b /dev/block/"$1" ]; then echo TF=/dev/block/"$1"; fi; fi', root=True)
|
||||
storage = dict(line.split('=', 1) for line in text.splitlines() if '=' in line)
|
||||
if not re.fullmatch(r'mmcblk\d+p\d+', storage['NODE']) or not re.fullmatch('[a-f0-9]{32}', storage['CID']):
|
||||
raise ValueError('Cannot establish eMMC identity / 无法确认闪存身份')
|
||||
@@ -169,7 +229,9 @@ class Adapter:
|
||||
encrypted = properties['ro.crypto.state'] == 'encrypted' or properties['ro.crypto.type'] in ('file', 'block') or storage['SOURCE'].startswith(('/dev/block/dm-', '/dev/mapper/'))
|
||||
device.update(cid=storage['CID'], storage=storage, encrypted=encrypted, existing=bool(storage.get('ROOT')),
|
||||
tf=storage.get('TF'), userdata_bytes=storage['SIZE']*512, free_bytes=storage['FREE']*1024)
|
||||
if storage.get('TF'):
|
||||
# Other modes need only a read-only availability hint for recommendations.
|
||||
# A removable card and its readable capacity are prerequisites only for TF.
|
||||
if method == 'tf' and self.kind != 'e5' and storage.get('TF'):
|
||||
node = storage['TF'].rsplit('/', 1)[-1]
|
||||
device['tf_bytes'] = int(self.adb.shell('cat /sys/class/block/' + node + '/size', root=True).strip())*512
|
||||
disk_node = re.sub(r'p\d+$', '', node)
|
||||
@@ -182,26 +244,23 @@ class Adapter:
|
||||
if method != 'boot':
|
||||
space = self.read_gpt(storage)
|
||||
device['gpt'] = {k: v for k, v in space.items() if k not in ('first', 'last')}
|
||||
if self.kind == 'e5':
|
||||
if self.kind == 'e5' and method == 'tf':
|
||||
# Reuse the existing internal-vs-removable selection policy.
|
||||
try:
|
||||
disk = self.legacy.device_sd()
|
||||
node = disk.rsplit('/', 1)[-1]
|
||||
if self.adb.shell('test -b '+disk+'p1; echo $?', root=True).strip() == '0':
|
||||
target = disk+'p1'
|
||||
else:
|
||||
parts = self.adb.shell('ls /sys/class/block/'+node+'p* 2>/dev/null; true', root=True).strip()
|
||||
if parts: raise ValueError('TF has partitions but no p1; cannot select the whole card')
|
||||
target = disk
|
||||
device['tf'] = target
|
||||
device['tf_bytes'] = int(self.legacy.device_size(target))
|
||||
device['tf_identity'] = {'cid': self.adb.shell('cat /sys/class/block/'+node+'/device/cid', root=True).strip(),
|
||||
'sectors': device['tf_bytes']//512,
|
||||
'start': self.adb.shell('cat /sys/class/block/'+target.rsplit('/',1)[-1]+'/start 2>/dev/null || echo 0', root=True).strip()}
|
||||
storage['TF'] = target
|
||||
except SystemExit:
|
||||
device['tf'] = None
|
||||
storage.pop('TF', None)
|
||||
# Do not catch discovery failures: TF must stop on missing/ambiguous cards.
|
||||
disk = self.legacy.device_sd()
|
||||
node = disk.rsplit('/', 1)[-1]
|
||||
if self.adb.shell('test -b '+disk+'p1; echo $?', root=True).strip() == '0':
|
||||
target = disk+'p1'
|
||||
else:
|
||||
parts = self.adb.shell('ls /sys/class/block/'+node+'p* 2>/dev/null; true', root=True).strip()
|
||||
if parts: raise ValueError('TF has partitions but no p1; cannot select the whole card')
|
||||
target = disk
|
||||
device['tf'] = target
|
||||
device['tf_bytes'] = int(self.legacy.device_size(target))
|
||||
device['tf_identity'] = {'cid': self.adb.shell('cat /sys/class/block/'+node+'/device/cid', root=True).strip(),
|
||||
'sectors': device['tf_bytes']//512,
|
||||
'start': self.adb.shell('cat /sys/class/block/'+target.rsplit('/',1)[-1]+'/start 2>/dev/null || echo 0', root=True).strip()}
|
||||
storage['TF'] = target
|
||||
return device
|
||||
|
||||
def read_gpt(self, storage):
|
||||
@@ -249,17 +308,12 @@ class Adapter:
|
||||
(destination/'gpt-first.bin').write_bytes(space['first'])
|
||||
(destination/'gpt-last.bin').write_bytes(space['last'])
|
||||
atomic_json(destination/'identity.json', device)
|
||||
for name in ['misc'] + [f'{n}_{slot}' for n in ('boot', 'uboot', 'sml', 'teecfg', 'trustos', 'vbmeta') for slot in ('a', 'b')]:
|
||||
self.ctx.boundary()
|
||||
script = f'dd if=/dev/block/by-name/{name} bs=4096 count=1 2>/dev/null' if name == 'misc' else f'cat /dev/block/by-name/{name}'
|
||||
data = self.adb.read(script)
|
||||
if not data:
|
||||
raise ValueError('Empty backup / 备份为空: ' + name)
|
||||
(destination/(name+'.bin')).write_bytes(data)
|
||||
expected = hashlib.sha256(data).hexdigest()
|
||||
actual = self.adb.shell('(set -o pipefail; ' + script + ') | sha256sum', root=True, timeout=120).split()[0]
|
||||
if expected != actual:
|
||||
raise ValueError('Backup readback checksum mismatch / 备份回读校验失败: ' + name)
|
||||
try:
|
||||
for name in ['misc'] + [f'{n}_{slot}' for n in ('boot', 'uboot', 'sml', 'teecfg', 'trustos', 'vbmeta') for slot in ('a', 'b')]:
|
||||
self.ctx.boundary()
|
||||
self.adb.backup_partition(name, destination/(name+'.bin'), self.ctx)
|
||||
finally:
|
||||
self.adb.cleanup_backup(self.ctx)
|
||||
atomic_json(destination/'checksums.json', {p.name: sha(p) for p in destination.iterdir() if p.is_file() and p.name != 'checksums.json'})
|
||||
self.ctx.record['completed'].append('backup')
|
||||
self.ctx.store.save(self.ctx.record)
|
||||
@@ -268,12 +322,14 @@ class Adapter:
|
||||
record = self.ctx.record
|
||||
choices = record['choices']
|
||||
method = choices['method']
|
||||
if method not in ('tf', 'part', 'reinstall', 'image', 'boot', 'update') or record['plan'].get('method') != method:
|
||||
raise RecoveryRequired('Installation method differs from the saved plan / 安装方式与已保存计划不一致,已停止')
|
||||
a = args_for(record, self.ctx.directory)
|
||||
if method != 'update':
|
||||
self.bind(record['device']['serial'])
|
||||
a.adb = self.adb.exe
|
||||
self.expected_ssh_key = record['device'].get('ssh_key')
|
||||
with redirect_stdout(Quiet()), redirect_stderr(Quiet()):
|
||||
with debug_output(self.ctx):
|
||||
if method == 'update':
|
||||
self.stage('transfer_install')
|
||||
if self.kind == 'e5':
|
||||
@@ -302,9 +358,7 @@ class Adapter:
|
||||
a.resume = True
|
||||
a.transaction = record['legacy']
|
||||
return self.legacy.install(a, self.root, json.loads((self.root/'desktop/manifest.json').read_text()))
|
||||
done = {name for name, value in record['effects'].items() if value['state'] == 'done'}
|
||||
if (self.kind == 'e5' and 'misc-trial' in done or self.kind == 'mu300' and
|
||||
('root-tf-write' in done or any(name.startswith('boot-and-misc-') for name in done))):
|
||||
if installation_committed(record):
|
||||
# Final selection is after image/root readback in the legacy
|
||||
# installers. A crash before the coordinator's next checkpoint
|
||||
# must only wait for boot, never replay the full entrypoint.
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
"""Bounded, redacted diagnostic text; never used to drive installation state."""
|
||||
import io
|
||||
import re
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
def redact(text, secrets=()):
|
||||
text = str(text)
|
||||
for value in sorted({str(v) for v in secrets if v}, key=len, reverse=True):
|
||||
text = text.replace(value, '[redacted]')
|
||||
# Mask credentials even when a legacy helper creates its own settings.
|
||||
text = re.sub(r"(?im)((?:[\w-]*(?:password|passwd|wifi_key|pwhash|token)|密码|密钥|key)\s*[:=]\s*)(?:'[^']*'|\"[^\"]*\"|[^\s;,]+)",
|
||||
r'\1[redacted]', text)
|
||||
text = re.sub(r'\b[a-fA-F0-9]{32}\b', '[redacted-id]', text)
|
||||
# Strip terminal control sequences; these are text records, not a terminal.
|
||||
return re.sub(r'\x1b\[[0-?]*[ -/]*[@-~]', '', text).replace('\x00', '')
|
||||
|
||||
|
||||
class DebugStream(io.TextIOBase):
|
||||
def __init__(self, context):
|
||||
self.context = context
|
||||
self.pending = ''
|
||||
self.lock = threading.RLock()
|
||||
|
||||
def write(self, value):
|
||||
with self.lock:return self._write(value)
|
||||
|
||||
def _write(self, value):
|
||||
self.pending += value.replace('\r', '\n')
|
||||
while '\n' in self.pending or len(self.pending) > 8192:
|
||||
line, separator, rest = self.pending.partition('\n')
|
||||
if not separator:
|
||||
line, rest = self.pending[:8192], self.pending[8192:]
|
||||
self.pending = rest
|
||||
if line.strip():self.context.log(line, scope='legacy')
|
||||
return len(value)
|
||||
|
||||
def flush(self):
|
||||
with self.lock:
|
||||
if self.pending.strip():self.context.log(self.pending, scope='legacy')
|
||||
self.pending = ''
|
||||
|
||||
|
||||
def traced(context, label, operation, output=False):
|
||||
if context is None:return operation()
|
||||
context.activity(label)
|
||||
context.log('BEGIN '+label, scope='transport')
|
||||
started = time.monotonic()
|
||||
try:
|
||||
result = operation()
|
||||
except BaseException as error:
|
||||
context.log(f'FAILED {label}: {type(error).__name__}: {error} ({time.monotonic()-started:.2f}s)',
|
||||
level='error', scope='transport')
|
||||
raise
|
||||
context.log(f'END {label} ({time.monotonic()-started:.2f}s)', scope='transport')
|
||||
if output and isinstance(result, str) and result.strip():
|
||||
# Large base64/root-image output is not a useful CLI diagnostic.
|
||||
if len(result) > 32768:context.log(f'Captured {len(result)} characters; tail:\n'+result[-4096:], scope='transport')
|
||||
else:context.log(result, scope='transport')
|
||||
return result
|
||||
@@ -0,0 +1,68 @@
|
||||
"""Allowlisted host converters with bounded execution and captured diagnostics."""
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import types
|
||||
|
||||
from .diagnostics import traced
|
||||
from .transport import hidden_process
|
||||
|
||||
|
||||
def execute_script(path, arguments):
|
||||
"""Keep script docstrings/guards even when the sidecar uses -OO.
|
||||
|
||||
Helpers are separate source files. Their semantics must not depend on the
|
||||
optimization used to build the host executable.
|
||||
"""
|
||||
path = Path(path).resolve()
|
||||
previous_main = sys.modules.get('__main__')
|
||||
previous_argv, previous_path = sys.argv, sys.path[:]
|
||||
module = types.ModuleType('__main__')
|
||||
module.__file__ = str(path)
|
||||
sys.modules['__main__'] = module
|
||||
sys.argv = [str(path), *arguments]
|
||||
sys.path.insert(0, str(path.parent))
|
||||
try:
|
||||
exec(compile(path.read_bytes(), str(path), 'exec', optimize=0), module.__dict__)
|
||||
finally:
|
||||
sys.argv, sys.path[:] = previous_argv, previous_path
|
||||
if previous_main is None:sys.modules.pop('__main__', None)
|
||||
else:sys.modules['__main__'] = previous_main
|
||||
|
||||
|
||||
def run_helper(context, package, script, arguments, timeout=120):
|
||||
root = Path(package).resolve()
|
||||
script = Path(script).resolve()
|
||||
allowed = {root/'scripts/tools/sprd-bt-config.py', root/'scripts/tools/vbc-profile/vbc-profile.py'}
|
||||
if script not in allowed or not script.is_file():
|
||||
raise ValueError('Unsupported firmware converter / 不支持的固件转换器')
|
||||
context.boundary()
|
||||
context.stage('firmware_convert', tool=script.name)
|
||||
command = [sys.executable, *(['--run-tool'] if getattr(sys, 'frozen', False) else []), str(script), *map(str, arguments)]
|
||||
def perform():
|
||||
process = subprocess.Popen(command, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT, **hidden_process())
|
||||
since = time.monotonic(); heartbeat = since
|
||||
try:
|
||||
while True:
|
||||
context.boundary()
|
||||
try:
|
||||
output, _ = process.communicate(timeout=.2)
|
||||
break
|
||||
except subprocess.TimeoutExpired:
|
||||
now = time.monotonic()
|
||||
if now-since >= timeout:
|
||||
raise TimeoutError(f'Firmware converter {script.name} exceeded {timeout}s / 固件转换超时')
|
||||
if now-heartbeat >= 5:
|
||||
context.log(f'{script.name}: running, {now-since:.0f}s elapsed', scope='helper')
|
||||
heartbeat = now
|
||||
if output:
|
||||
context.log(output.decode('utf-8', 'replace')[-32768:], scope='helper')
|
||||
if process.returncode:
|
||||
detail = context.sanitize(output.decode('utf-8', 'replace')[-4000:])
|
||||
raise ValueError(f'Firmware converter {script.name} failed ({process.returncode}) / 固件转换失败:\n{detail}')
|
||||
finally:
|
||||
if process.poll() is None:process.kill()
|
||||
process.communicate(timeout=5)
|
||||
return traced(context, 'firmware converter '+script.name, perform)
|
||||
@@ -12,9 +12,10 @@ import shutil
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
import zipfile
|
||||
|
||||
from .adapter import Adapter
|
||||
from .adapter import Adapter, installation_committed
|
||||
from .package import inspect_package
|
||||
from .state import Cancelled, Context, DeviceLock, Pending, RecoveryRequired, Store, compatible
|
||||
from .transport import Adb
|
||||
@@ -91,6 +92,9 @@ class Service:
|
||||
self.package = None
|
||||
self.adapters = Adapter
|
||||
self.stop = threading.Event()
|
||||
self.verification_lock = threading.Lock()
|
||||
self.verification_request = None
|
||||
self.verification_wake = threading.Event()
|
||||
|
||||
def emit(self, kind, data, request_id=None):
|
||||
event = {'protocol': 1, 'type': kind, 'data': data}
|
||||
@@ -120,7 +124,7 @@ class Service:
|
||||
if command == 'list':
|
||||
return [self.public(r) for r in self.store.list()]
|
||||
if command == 'cancel':
|
||||
if self.active:
|
||||
if self.active and self.worker and self.worker.is_alive():
|
||||
self.active.cancel = True
|
||||
self.active.record['cancel_requested'] = True
|
||||
self.store.save(self.active.record)
|
||||
@@ -128,6 +132,39 @@ class Service:
|
||||
return {'accepted': False}
|
||||
if command == 'can_close':
|
||||
return not self.worker or not self.worker.is_alive()
|
||||
if command == 'verify_openwrt':
|
||||
context = self.active
|
||||
if (not context or not self.worker or not self.worker.is_alive() or
|
||||
p.get('transaction') != context.record['id'] or context.record['unsafe'] or
|
||||
context.record['stage'] != 'openwrt_boot' or
|
||||
context.record['status'] not in ('waiting_user','waiting_device')):
|
||||
raise ValueError('OpenWrt verification is unavailable at this stage / 当前阶段不能确认 OpenWrt 启动')
|
||||
host = p.get('host', '')
|
||||
password = p.get('password', '')
|
||||
if not isinstance(host,str) or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9.-]{0,252}',host):
|
||||
raise ValueError('Enter an IP address or hostname / 请输入 IP 地址或主机名')
|
||||
if not isinstance(password,str) or len(password)>4096:
|
||||
raise ValueError('Invalid SSH password / SSH 密码无效')
|
||||
with self.verification_lock:
|
||||
self.verification_request = (context.record['id'], host, password)
|
||||
self.verification_wake.set()
|
||||
return {'accepted':True}
|
||||
if command == 'diagnostics':
|
||||
record = self.store.load(p['transaction'])
|
||||
ctx = Context(self.store, record, lambda *_:None)
|
||||
header = {key:record.get(key) for key in ('version','revision','stage','status','choices','plan','completed','error')}
|
||||
header['model'] = record['device'].get('model')
|
||||
header['package'] = {key:record['package'].get(key) for key in ('adapter','profile','kernel','layout')}
|
||||
parts = ['OpenWrt Installer diagnostics (redacted)\n'+ctx.sanitize(json.dumps(header,ensure_ascii=False,indent=2))]
|
||||
for name in ('debug.previous.ndjson','debug.ndjson'):
|
||||
path = ctx.directory/name
|
||||
if path.is_file():
|
||||
with path.open('rb') as stream:
|
||||
size = stream.seek(0, 2)
|
||||
stream.seek(max(0, size-512*1024))
|
||||
parts.append(name+'\n'+stream.read().decode('utf-8','replace'))
|
||||
if len(parts)==1:parts.append('This older transaction has no debug log. Retry with the current installer to record detailed diagnostics.')
|
||||
return {'text':'\n\n'.join(parts)}
|
||||
if self.worker and self.worker.is_alive() and command not in ('export',):
|
||||
raise ValueError('An operation is active / 任务正在执行')
|
||||
if command == 'package':
|
||||
@@ -172,12 +209,16 @@ class Service:
|
||||
raise ValueError('This plan has not been confirmed / 此计划尚未确认')
|
||||
self.store.save(record)
|
||||
context = Context(self.store, record, self.emit)
|
||||
context.private.append(p.get('password', ''))
|
||||
adapter = self.adapter(current, context)
|
||||
adapter.password = p.get('password', '')
|
||||
context.cancel = False
|
||||
record['cancel_requested'] = False
|
||||
record['error'] = None
|
||||
self.active = context
|
||||
with self.verification_lock:
|
||||
self.verification_request = None
|
||||
self.verification_wake.clear()
|
||||
self.worker = threading.Thread(target=self.run, args=(context, adapter), daemon=False)
|
||||
self.worker.start()
|
||||
return self.public(record)
|
||||
@@ -225,12 +266,13 @@ class Service:
|
||||
client.connect(host, username='root', password=p.get('password', ''), timeout=12,
|
||||
auth_timeout=15, look_for_keys=False, allow_agent=False)
|
||||
key = hashlib.sha256(client.get_transport().get_remote_server_key().asbytes()).hexdigest()
|
||||
def read(script):
|
||||
def read_bytes(script):
|
||||
_, out, err = client.exec_command(script, timeout=15)
|
||||
data = out.read().decode('utf-8', 'replace').strip()
|
||||
data = out.read()
|
||||
if out.channel.recv_exit_status():
|
||||
raise ValueError('OpenWrt preflight failed / OpenWrt 预检失败')
|
||||
return data
|
||||
def read(script):return read_bytes(script).decode('utf-8','replace').strip()
|
||||
if read('id -u') != '0':
|
||||
raise ValueError('SSH root required')
|
||||
kind = self.package['adapter']
|
||||
@@ -241,11 +283,10 @@ class Service:
|
||||
if not re.fullmatch('[a-f0-9]{32}', cid):
|
||||
raise ValueError('Cannot establish OpenWrt eMMC identity')
|
||||
capacity = int(read("df -Pk / | awk 'END {print $2}'"))*1024
|
||||
import base64
|
||||
root_dev = read('cat /run/mu300/disk-dev' if kind == 'mu300' else
|
||||
"readlink -f $(awk '$2==\"/\" {print $1}' /proc/mounts | tail -1)")
|
||||
if re.fullmatch(r'/dev/(?:block/)?(?:mmcblk\d+(?:p\d+)?|loop\d+)', root_dev):
|
||||
raw = base64.b64decode(read(f'dd if={root_dev} bs=1024 skip=1 count=1 2>/dev/null | base64'))
|
||||
raw = read_bytes(f'dd if={root_dev} bs=1024 skip=1 count=1 2>/dev/null')
|
||||
capacity = verify_ext4_capacity(raw, 0)
|
||||
return dict(serial='ssh:'+key, cid=cid, ssh_key=key, host=host, profile=profile,
|
||||
model=profile.upper(), system='OpenWrt', slot=read('cat /run/mu300/linux-slot') if kind == 'mu300' else 'B',
|
||||
@@ -259,7 +300,8 @@ class Service:
|
||||
with ExitStack() as locks:
|
||||
for identity in sorted({r['device']['serial'], r['device']['cid']}):
|
||||
locks.enter_context(DeviceLock(self.store.base, identity))
|
||||
if r['stage'] == 'openwrt_boot':
|
||||
if r['stage'] in ('openwrt_boot', 'verify_capacity') or installation_committed(r):
|
||||
self.openwrt_wait_stage(context)
|
||||
return self.wait_openwrt(context, adapter)
|
||||
if r.get('legacy'):
|
||||
self.wait_android(context, adapter)
|
||||
@@ -282,13 +324,14 @@ class Service:
|
||||
if result is not None and getattr(result, 'state', '') == 'pending' and r.get('legacy'):
|
||||
self.wait_android(context, adapter)
|
||||
result = adapter.execute()
|
||||
context.stage('openwrt_boot', 'waiting_device', reboot_manually=True)
|
||||
self.openwrt_wait_stage(context)
|
||||
self.wait_openwrt(context, adapter)
|
||||
except Cancelled:
|
||||
context.stage(r['stage'], 'cancelled')
|
||||
except BaseException as error:
|
||||
message = str(error)[:2000] if isinstance(error, (ValueError, RecoveryRequired)) else \
|
||||
'Operation interrupted; keep backups and retry from the saved record / 操作中断,请保留备份并从记录续装'
|
||||
context.private.append(adapter.password)
|
||||
context.log(''.join(traceback.format_exception(error)), level='error', scope='exception')
|
||||
message = context.sanitize(f'{type(error).__name__}: {error}')[:2000]
|
||||
for private in (r['device'].get('serial'), r['device'].get('cid'), adapter.password,
|
||||
r.get('secrets', {}).get('wifi_key')):
|
||||
if private: message = message.replace(private, '[redacted]')
|
||||
@@ -320,6 +363,19 @@ class Service:
|
||||
if self.stop.wait(3):
|
||||
raise Cancelled()
|
||||
|
||||
def openwrt_wait_stage(self, context, error=None, connection_state=None):
|
||||
r = context.record
|
||||
# These entrypoints send their own reboot request. The other install
|
||||
# paths finish after verified writes and explicitly leave reboot to the user.
|
||||
manual = r['choices']['method'] != 'update' and not (
|
||||
r['package']['adapter'] == 'e5' and r['choices']['method'] == 'boot')
|
||||
manual = manual and not r.get('openwrt_confirmed',False)
|
||||
host = r['choices'].get('host') or ('192.168.9.1' if r['package']['adapter'] == 'e5' else
|
||||
'192.168.78.1' if r['device']['profile'] == 'u30air' else '192.168.77.1')
|
||||
context.stage('openwrt_boot', 'waiting_user' if manual or error else 'waiting_device',
|
||||
host=host, reboot_manually=manual, boot_confirmed=bool(r.get('openwrt_confirmed')),
|
||||
verification_error=error, connection_state=connection_state)
|
||||
|
||||
def wait_openwrt(self, context, adapter):
|
||||
import paramiko
|
||||
r = context.record
|
||||
@@ -328,30 +384,53 @@ class Service:
|
||||
# No network/interface changes and no automatic hotspot connection.
|
||||
while True:
|
||||
context.boundary()
|
||||
with self.verification_lock:
|
||||
pending = self.verification_request
|
||||
self.verification_request = None
|
||||
self.verification_wake.clear()
|
||||
if pending and pending[0] == r['id']:
|
||||
_, host, adapter.password = pending
|
||||
context.private.append(adapter.password)
|
||||
r['choices']['host'] = host
|
||||
r['openwrt_confirmed'] = True
|
||||
self.openwrt_wait_stage(context)
|
||||
context.log('User confirmed OpenWrt boot; checking the selected management address', scope='verification')
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
try:
|
||||
client.connect(host, username='root', password=adapter.password or 'root', timeout=5,
|
||||
auth_timeout=5, look_for_keys=False, allow_agent=False)
|
||||
def read(script):
|
||||
def read_bytes(script):
|
||||
_, out, _ = client.exec_command(script, timeout=15)
|
||||
value = out.read().decode().strip()
|
||||
if out.channel.recv_exit_status():
|
||||
value = out.read()
|
||||
status = out.channel.recv_exit_status()
|
||||
if status < 0:
|
||||
raise EOFError('SSH closed before a command exit status was received')
|
||||
if status:
|
||||
raise ValueError('Final verification command failed')
|
||||
return value
|
||||
def read(script):return read_bytes(script).decode().strip()
|
||||
cid = read('cat /sys/class/block/mmcblk0/device/cid')
|
||||
if cid != r['device']['cid']:
|
||||
raise RecoveryRequired('Management address belongs to another device / 管理地址对应另一台设备')
|
||||
if r['choices']['method'] == 'update':
|
||||
before = r.get('update_boot_id')
|
||||
if not before:
|
||||
raise ValueError('Update record lacks pre-update boot evidence; automatic completion cannot be verified / 旧更新记录缺少重启前标识,无法自动确认更新完成,请保留记录人工复核')
|
||||
boot_id = read('cat /proc/sys/kernel/random/boot_id')
|
||||
if not re.fullmatch(r'[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}',boot_id):
|
||||
raise ValueError('Cannot verify post-update boot identity / 无法校验更新后的启动标识')
|
||||
if boot_id == before:
|
||||
raise Pending()
|
||||
context.stage('verify_capacity')
|
||||
# Read superblock via SSH base64; no od/SFTP dependency.
|
||||
import base64
|
||||
# SSH exec preserves raw stdout bytes; no encoding/od/SFTP.
|
||||
if r['package']['adapter'] == 'e5':
|
||||
dev = read("readlink -f $(awk '$2==\"/\" {print $1}' /proc/mounts | tail -1)")
|
||||
else:
|
||||
dev = read('cat /run/mu300/disk-dev')
|
||||
if not re.fullmatch(r'/dev/(?:block/)?(?:mmcblk\d+(?:p\d+)?|loop\d+)', dev):
|
||||
raise ValueError('Cannot identify installed root block device')
|
||||
raw = base64.b64decode(read(f'dd if={dev} bs=1024 skip=1 count=1 2>/dev/null | base64'))
|
||||
raw = read_bytes(f'dd if={dev} bs=1024 skip=1 count=1 2>/dev/null')
|
||||
capacity = verify_ext4_capacity(raw, r['plan']['openwrt_bytes'] if r['plan'].get('grow', True) else 0)
|
||||
# Mounted and usable, not just a larger partition entry.
|
||||
read('test -s /etc/openwrt_release && test -x /sbin/init')
|
||||
@@ -360,14 +439,29 @@ class Service:
|
||||
'temporary': r['choices']['method'] == 'boot'}
|
||||
context.stage('complete', 'completed')
|
||||
return
|
||||
except (RecoveryRequired, ValueError):
|
||||
except Pending:
|
||||
# The old runtime can still answer during the scheduled reboot
|
||||
# delay. It is not proof that the new system has started.
|
||||
self.openwrt_wait_stage(context)
|
||||
except RecoveryRequired as error:
|
||||
# The default address can belong to another router. Keep all
|
||||
# writes blocked, but let the user select the intended endpoint.
|
||||
self.openwrt_wait_stage(context, str(error))
|
||||
except ValueError:
|
||||
raise
|
||||
except (OSError, EOFError, paramiko.SSHException):
|
||||
context.stage('openwrt_boot', 'waiting_device', host=host, reboot_manually=True)
|
||||
except paramiko.AuthenticationException:
|
||||
self.openwrt_wait_stage(context, 'SSH authentication failed; check the root password / SSH 认证失败,请核对 root 密码')
|
||||
except (OSError, EOFError, paramiko.SSHException) as error:
|
||||
# Transport loss is expected during restart, including refused
|
||||
# connections, missing interfaces, timeouts and SSH EOF. Keep
|
||||
# retrying without a user-facing warning or arbitrary deadline.
|
||||
context.log(f'Waiting for OpenWrt reconnection: {type(error).__name__}: {error}', scope='reconnect')
|
||||
self.openwrt_wait_stage(context, connection_state='reconnecting')
|
||||
finally:
|
||||
client.close()
|
||||
if self.stop.wait(4):
|
||||
raise Cancelled()
|
||||
for _ in range(40):
|
||||
if self.verification_wake.is_set():break
|
||||
if self.stop.wait(.1):raise Cancelled()
|
||||
|
||||
|
||||
def verify_ext4_capacity(superblock, expected):
|
||||
@@ -392,8 +486,8 @@ def main():
|
||||
a = p.parse_args()
|
||||
output = sys.stdout
|
||||
service = Service(a.package_root, Store(a.data_dir), output)
|
||||
# Legacy prints are suppressed at the source; service replies always use
|
||||
# this captured protocol stream, even while legacy code redirects stdout.
|
||||
# Legacy prints become sanitized diagnostic events; protocol replies use
|
||||
# this captured stream even while legacy code redirects stdout.
|
||||
for line in sys.stdin:
|
||||
if len(line) > 1024*1024:
|
||||
continue
|
||||
@@ -403,7 +497,11 @@ def main():
|
||||
value = service.dispatch(request)
|
||||
service.emit('response', {'ok': True, 'result': value}, request.get('id'))
|
||||
except Exception as error:
|
||||
service.emit('response', {'ok': False, 'error': str(error)[:2000]}, request.get('id'))
|
||||
from .diagnostics import redact
|
||||
params = request.get('params', {})
|
||||
private = [params.get(key) for key in ('serial','password')] if isinstance(params,dict) else []
|
||||
message = redact(f'{type(error).__name__}: {error}',private)[:2000]
|
||||
service.emit('response', {'ok': False, 'error': message}, request.get('id'))
|
||||
# EOF requests safe cancellation; never kill a storage operation.
|
||||
if service.active:
|
||||
service.active.cancel = True
|
||||
|
||||
@@ -6,8 +6,10 @@ import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
from .diagnostics import redact
|
||||
|
||||
VERSION = 1
|
||||
TERMINAL = {'completed', 'cancelled'}
|
||||
@@ -101,6 +103,7 @@ class Store:
|
||||
return self.base / 'transactions' / tid
|
||||
|
||||
def save(self, record):
|
||||
record['revision'] = record.get('revision', 0) + 1
|
||||
record['updated'] = time.time()
|
||||
atomic_json(self.directory(record['id']) / 'transaction.json', record)
|
||||
|
||||
@@ -145,6 +148,15 @@ class Context:
|
||||
self.store, self.record, self.emit = store, record, emit
|
||||
self.cancel = False
|
||||
self.clock = time.monotonic()
|
||||
self.private = []
|
||||
self.log_lock = threading.Lock()
|
||||
self.last_transfer = {}
|
||||
if record.get('legacy'):
|
||||
try:
|
||||
old = json.loads(Path(record['legacy']).read_text(encoding='utf-8'))
|
||||
self.private.extend(old.get(key) for key in ('key','token','password') if old.get(key))
|
||||
except (OSError,ValueError):
|
||||
pass
|
||||
|
||||
@property
|
||||
def directory(self):
|
||||
@@ -170,17 +182,34 @@ class Context:
|
||||
return out
|
||||
|
||||
def stage(self, stage, status='running', **details):
|
||||
now = time.time()
|
||||
previous = self.record
|
||||
phase_changed = stage != previous['stage'] or details.get('tool') != previous.get('details',{}).get('tool')
|
||||
resumed = previous['status'] in ('ready','failed','cancelled') and status in ('running','waiting_user','waiting_device')
|
||||
if (phase_changed and stage != 'complete') or resumed:
|
||||
previous['stage_started_at'] = now
|
||||
elif 'stage_started_at' not in previous:
|
||||
previous['stage_started_at'] = previous.get('updated',now)
|
||||
if status in ('completed','failed','cancelled'):
|
||||
previous['stage_finished_at'] = now
|
||||
else:
|
||||
previous.pop('stage_finished_at',None)
|
||||
self.record.update(stage=stage, status=status, details=details)
|
||||
self.store.save(self.record)
|
||||
self.snapshot()
|
||||
self.log(f'STAGE {stage} / {status}', scope='state')
|
||||
|
||||
def boundary(self):
|
||||
if self.cancel or self.record.get('cancel_requested'):
|
||||
raise Cancelled()
|
||||
|
||||
def activity(self, name):
|
||||
self.emit('activity', {'name':self.sanitize(name)})
|
||||
|
||||
def effect(self, name, operation, *, retry_safe=False):
|
||||
entry = self.record['effects'].get(name)
|
||||
if entry and entry['state'] == 'done':
|
||||
self.log('SKIP verified effect: '+name, scope='effect')
|
||||
return entry.get('result')
|
||||
if entry and not retry_safe:
|
||||
raise RecoveryRequired('Interrupted write requires readback / 写入中断,必须复核: ' + name)
|
||||
@@ -189,6 +218,7 @@ class Context:
|
||||
self.record['unsafe'] = not retry_safe
|
||||
self.store.save(self.record)
|
||||
self.snapshot()
|
||||
self.log('BEGIN effect: '+name, scope='effect')
|
||||
result = operation()
|
||||
self.record['effects'][name] = {'state': 'done', 'time': time.time(), 'result': result}
|
||||
self.record['unsafe'] = False
|
||||
@@ -196,10 +226,12 @@ class Context:
|
||||
self.record['completed'].append(name)
|
||||
self.store.save(self.record)
|
||||
self.snapshot()
|
||||
self.log('VERIFIED effect: '+name, scope='effect')
|
||||
self.boundary()
|
||||
return result
|
||||
|
||||
def legacy_record(self, path, value):
|
||||
self.private.extend(value.get(key) for key in ('key','token','password') if value.get(key))
|
||||
self.record['legacy'] = str(Path(path).resolve())
|
||||
self.record['legacy_phase'] = value.get('phase', value.get('state'))
|
||||
self.store.save(self.record)
|
||||
@@ -207,12 +239,28 @@ class Context:
|
||||
def transfer(self, name, done, total, since):
|
||||
self.emit('transfer', dict(name=name, bytes=done, total=total,
|
||||
bytes_per_second=done / max(time.monotonic() - since, .001)))
|
||||
previous = self.last_transfer.get(name)
|
||||
if previous is None or done == total or done < previous or done-previous >= 8*1024*1024:
|
||||
self.last_transfer[name] = done
|
||||
self.log(f'TRANSFER {name}: {done}/{total} bytes, {done/max(time.monotonic()-since,.001):.0f} bytes/s',scope='transfer')
|
||||
|
||||
def log(self, message):
|
||||
# Legacy stdout can contain hotspot credentials, SMS or raw identifiers.
|
||||
# It is intentionally not forwarded. Only named structured events log.
|
||||
safe = str(message)
|
||||
for value in (self.record['device'].get('serial'), self.record['device'].get('cid')):
|
||||
if value:
|
||||
safe = safe.replace(value, '[redacted]')
|
||||
self.emit('log', {'time': time.time(), 'message': safe[:2000]})
|
||||
def sanitize(self, message):
|
||||
device = self.record.get('device', {})
|
||||
return redact(message, [device.get('serial'), device.get('cid'), device.get('ssh_key'),
|
||||
*self.record.get('secrets', {}).values(), *self.private])
|
||||
|
||||
def log(self, message, level='debug', scope='backend'):
|
||||
event = {'time':time.time(), 'level':level, 'scope':scope,
|
||||
'stage':self.record['stage'], 'message':self.sanitize(message)[:32768]}
|
||||
# Persist diagnostics across application restarts. Logging failure must
|
||||
# never interrupt a partition write or hide the original exception.
|
||||
try:
|
||||
with self.log_lock:
|
||||
path = self.directory/'debug.ndjson'
|
||||
if path.exists() and path.stat().st_size > 4*1024*1024:
|
||||
os.replace(path, self.directory/'debug.previous.ndjson')
|
||||
with path.open('a', encoding='utf-8') as stream:
|
||||
stream.write(json.dumps(event, ensure_ascii=False)+'\n')
|
||||
except OSError:
|
||||
pass
|
||||
self.emit('log', event)
|
||||
@@ -1,14 +1,15 @@
|
||||
"""Serial-bound ADB operations. Frontend never supplies shell text."""
|
||||
import base64
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import secrets
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from .state import sha
|
||||
from .diagnostics import traced
|
||||
|
||||
|
||||
def hidden_process():
|
||||
@@ -23,15 +24,20 @@ class Adb:
|
||||
if not self.exe:
|
||||
raise ValueError('ADB is missing from tools / 安装包缺少 ADB 工具')
|
||||
self.su = None
|
||||
self.context = None
|
||||
self.backup_staging = None
|
||||
|
||||
def call(self, *args, timeout=20, check=True):
|
||||
cmd = [self.exe]
|
||||
if self.serial and args[0] != 'devices':
|
||||
cmd += ['-s', self.serial]
|
||||
result = subprocess.run(cmd + list(args), capture_output=True, timeout=timeout, **hidden_process())
|
||||
if check and result.returncode:
|
||||
raise ConnectionError('ADB connection interrupted / ADB 连接中断')
|
||||
return result.stdout.decode('utf-8', 'replace').replace('\r', '')
|
||||
def perform():
|
||||
result = subprocess.run(cmd + list(args), capture_output=True, timeout=timeout, **hidden_process())
|
||||
if check and result.returncode:
|
||||
detail = (result.stderr or result.stdout).decode('utf-8', 'replace')[-4000:].strip()
|
||||
raise ConnectionError('ADB command failed / ADB 命令失败'+(': '+detail if detail else ''))
|
||||
return result.stdout.decode('utf-8', 'replace').replace('\r', '')
|
||||
return traced(self.context, 'ADB '+shlex.join(list(args)), perform, output=True)
|
||||
|
||||
def devices(self):
|
||||
result = []
|
||||
@@ -68,8 +74,96 @@ class Adb:
|
||||
return 'root_permission' if found else 'magisk'
|
||||
|
||||
def read(self, script):
|
||||
encoded = self.shell('set -o pipefail; ' + script + ' | base64', root=True, timeout=120)
|
||||
return base64.b64decode(''.join(encoded.split()), validate=True)
|
||||
"""Small binary metadata reads; partition backups use dd + adb pull."""
|
||||
if self.su is None:raise ValueError('Root has not been verified / 尚未验证 root')
|
||||
command=(self.su+' -c ' if self.su else 'sh -c ')+shlex.quote('stty raw -echo -onlcr 2>/dev/null || true; '+script)
|
||||
args=[self.exe]+(['-s',self.serial] if self.serial else [])+['exec-out',command]
|
||||
def perform():
|
||||
result=subprocess.run(args,capture_output=True,timeout=45,**hidden_process())
|
||||
if result.returncode or not result.stdout:
|
||||
raise ConnectionError('ADB metadata read failed / ADB 元数据读取失败')
|
||||
return result.stdout
|
||||
return traced(self.context,'ADB metadata read '+script,perform)
|
||||
|
||||
def _backup_directory(self, context, total):
|
||||
free=int(self.shell("df -Pk /data/local/tmp | tail -n1 | awk '{print $4}'").strip())*1024
|
||||
if free<total+(64<<20):
|
||||
raise ValueError('Insufficient Android staging space for backup / Android 备份临时空间不足')
|
||||
if not self.backup_staging:
|
||||
self.backup_staging='/data/local/tmp/openwrt-backup-'+secrets.token_hex(12)
|
||||
# A shell-owned private directory lets adb pull read root-created
|
||||
# images without making the directory accessible to other apps.
|
||||
context.record['backup_staging']=self.backup_staging
|
||||
context.store.save(context.record)
|
||||
self.shell('umask 077; mkdir '+self.backup_staging)
|
||||
return self.backup_staging
|
||||
|
||||
def _pull_backup(self, remote, local, total, name, context):
|
||||
args=[self.exe]+(['-s',self.serial] if self.serial else [])+['pull',remote,str(local)]
|
||||
since=time.monotonic();last_change=since;previous=-1
|
||||
process=subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.PIPE,**hidden_process())
|
||||
try:
|
||||
while True:
|
||||
context.boundary()
|
||||
try:
|
||||
out,err=process.communicate(timeout=.1)
|
||||
finished=True
|
||||
except subprocess.TimeoutExpired:
|
||||
finished=False
|
||||
received=local.stat().st_size if local.exists() else 0
|
||||
if received>total:raise ValueError('Backup is larger than the selected partition / 备份大小超出分区范围')
|
||||
if received!=previous:
|
||||
last_change=time.monotonic();previous=received
|
||||
context.transfer('backup/'+name,received,total,since)
|
||||
if finished:
|
||||
if process.returncode:
|
||||
raise ConnectionError('ADB pull failed / ADB 拉取失败: '+err.decode('utf-8','replace')[-2000:])
|
||||
context.log(out.decode('utf-8','replace')+err.decode('utf-8','replace'),scope='adb-pull')
|
||||
if received!=total:raise ValueError('Incomplete backup / 备份文件不完整: '+name)
|
||||
return
|
||||
if time.monotonic()-last_change>45:
|
||||
raise TimeoutError('ADB pull received no data for 45 seconds / ADB 拉取 45 秒未收到数据')
|
||||
finally:
|
||||
if process.poll() is None:process.kill()
|
||||
process.communicate(timeout=5)
|
||||
|
||||
def backup_partition(self, name, destination, context):
|
||||
if not re.fullmatch(r'(misc|(?:boot|uboot|sml|teecfg|trustos|vbmeta)_[ab])',name):
|
||||
raise ValueError('Unsupported backup partition')
|
||||
source='/dev/block/by-name/'+name
|
||||
total=4096 if name=='misc' else int(self.shell('blockdev --getsize64 '+source,root=True).strip())
|
||||
if total<=0:raise ValueError('Invalid backup partition size: '+name)
|
||||
remote=self._backup_directory(context,total)+'/'+name+'.img'
|
||||
local=Path(str(destination)+'.partial')
|
||||
context.log(f'Backing up {name}: {total} bytes; device dd -> adb pull',scope='backup')
|
||||
try:
|
||||
command=f'dd if={source} of={remote} bs=4M'
|
||||
if name=='misc':command=f'dd if={source} of={remote} bs=4096 count=1'
|
||||
self.shell('set -e; umask 077; '+command+'; chmod 644 '+remote,root=True,timeout=120)
|
||||
expected=self.shell('sha256sum '+remote,root=True,timeout=120).split()[0]
|
||||
original=f'dd if={source} bs=4096 count=1 2>/dev/null' if name=='misc' else 'cat '+source
|
||||
actual=self.shell('(set -o pipefail; '+original+') | sha256sum',root=True,timeout=120).split()[0]
|
||||
if not re.fullmatch('[a-f0-9]{64}',expected) or expected!=actual:
|
||||
raise ValueError('Device backup checksum mismatch / 设备临时备份校验失败: '+name)
|
||||
self._pull_backup(remote,local,total,name,context)
|
||||
if sha(local)!=expected:raise ValueError('Computer backup checksum mismatch / 电脑备份校验失败: '+name)
|
||||
with local.open('r+b') as stream:os.fsync(stream.fileno())
|
||||
os.replace(local,destination)
|
||||
context.log(f'Backup verified: {name}, {total} bytes, SHA256 {expected}',scope='backup')
|
||||
finally:
|
||||
try:self.shell('rm -f '+remote,root=True)
|
||||
except Exception as error:context.log('Backup staging cleanup: '+str(error),level='warning',scope='backup')
|
||||
if local.exists():local.unlink()
|
||||
|
||||
def cleanup_backup(self, context):
|
||||
if not self.backup_staging:return
|
||||
try:
|
||||
self.shell('rmdir '+self.backup_staging)
|
||||
context.record.pop('backup_staging',None)
|
||||
context.store.save(context.record)
|
||||
self.backup_staging=None
|
||||
except Exception as error:
|
||||
context.log('Backup staging directory cleanup: '+str(error),level='warning',scope='backup')
|
||||
|
||||
def properties(self):
|
||||
names = ('ro.product.model', 'ro.product.device', 'ro.board.platform', 'ro.boot.slot_suffix',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Frozen NDJSON entry; no console window is created by the Tauri host."""
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import sys
|
||||
from backend.service import main
|
||||
|
||||
@@ -12,8 +11,8 @@ for stream in (sys.stdin, sys.stdout, sys.stderr):
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 2 and sys.argv[1] == '--run-tool':
|
||||
tool = sys.argv[2]
|
||||
sys.argv = [tool, *sys.argv[3:]]
|
||||
runpy.run_path(tool, run_name='__main__')
|
||||
from backend.helpers import execute_script
|
||||
execute_script(tool, sys.argv[3:])
|
||||
elif '--cli' in sys.argv:
|
||||
from backend.adapter import load
|
||||
parser = argparse.ArgumentParser(add_help=False)
|
||||
|
||||
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 76 KiB |
@@ -0,0 +1,109 @@
|
||||
"""Debug-log controls, diagnostic copying and honest progress presentation."""
|
||||
from playwright.sync_api import sync_playwright
|
||||
from ui_smoke import BRIDGE,ROOT,layout,settle
|
||||
|
||||
|
||||
def main():
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch()
|
||||
context=browser.new_context(viewport={'width':800,'height':650})
|
||||
context.add_init_script(BRIDGE+"localStorage.setItem('onboarding-v1','seen');")
|
||||
page=context.new_page();errors=[]
|
||||
page.on('pageerror',lambda e:errors.append(str(e)))
|
||||
page.goto('http://127.0.0.1:1420')
|
||||
page.evaluate("Object.defineProperty(navigator.clipboard,'writeText',{configurable:true,value:async(text)=>{window.__copied=text}})")
|
||||
page.get_by_role('button',name='继续未完成的安装',exact=False).click();settle(page)
|
||||
page.get_by_role('button',name='确认安装计划',exact=True).click();settle(page)
|
||||
page.get_by_role('checkbox').check()
|
||||
page.get_by_role('button',name='确认并开始').click();settle(page)
|
||||
toggle=page.get_by_role('button',name='详细日志',exact=False)
|
||||
assert toggle.get_attribute('aria-expanded')=='true'
|
||||
def event(kind,data):
|
||||
page.evaluate('''({kind,data})=>window.__fixture.callbacks.get(window.__fixture.event)({event:'backend',id:1,payload:{type:kind,data}})''',{'kind':kind,'data':data})
|
||||
page.evaluate("window.__emitFixture({stage:'backup',status:'running',revision:10})")
|
||||
event('log',{'level':'debug','scope':'backup','message':'Backing up boot_a: 67108864 bytes; 1 MiB chunks'})
|
||||
event('transfer',{'name':'backup/boot_a','bytes':33554432,'total':67108864,'bytes_per_second':1048576})
|
||||
settle(page);layout(page)
|
||||
progress=page.locator('progress')
|
||||
assert progress.get_attribute('value')=='33554432' and progress.get_attribute('max')=='67108864'
|
||||
assert page.locator('.transfer').get_by_text('50%',exact=True).count()==1
|
||||
assert '[DEBUG] [backup] Backing up boot_a' in page.locator('.log-panel pre').inner_text()
|
||||
event('log',{'level':'debug','scope':'order','message':'OLDER-BLOCK\nolder detail'})
|
||||
event('log',{'level':'debug','scope':'order','message':'NEWER-BLOCK\nnewer detail'})
|
||||
settle(page)
|
||||
text=page.locator('.log-panel pre').inner_text()
|
||||
assert text.index('NEWER-BLOCK')<text.index('newer detail')<text.index('OLDER-BLOCK')<text.index('older detail')
|
||||
assert page.locator('.log-panel pre').evaluate('(el)=>el.scrollTop')==0
|
||||
page.screenshot(path=str(ROOT/'screenshots/backup-progress-debug-zh.png'))
|
||||
event('transfer',{'name':'android-bootchain.sh','bytes':2048,'total':2048,'bytes_per_second':1024})
|
||||
settle(page)
|
||||
assert page.locator('.transfer').get_by_text('100%',exact=True).count()==1
|
||||
event('activity',{'name':'checking firmware'})
|
||||
settle(page)
|
||||
assert page.locator('progress').count()==0
|
||||
page.evaluate("window.__emitFixture({stage:'firmware_convert',status:'running',revision:11,details:{tool:'vbc-profile.py'}})")
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='转换本机音频与蓝牙固件'
|
||||
assert page.locator('.activity').get_by_text('m8-openwrt-gui-1.0.0',exact=True).count()==0
|
||||
assert page.locator('.activity').get_by_text('e5-openwrt-release · vbc-profile.py',exact=True).count()==1
|
||||
page.screenshot(path=str(ROOT/'screenshots/firmware-convert-debug-zh.png'))
|
||||
toggle.click();settle(page)
|
||||
assert page.locator('.log-panel pre').count()==0
|
||||
toggle.click();settle(page)
|
||||
assert '[DEBUG] [backup]' in page.locator('.log-panel pre').inner_text()
|
||||
page.evaluate("window.__emitFixture({stage:'transfer_install',status:'running',revision:12,details:{}})")
|
||||
settle(page)
|
||||
bar=page.get_by_role('progressbar',name='当前阶段进度')
|
||||
assert bar.get_attribute('aria-valuenow') is None
|
||||
assert page.locator('progress').count()==0
|
||||
assert page.get_by_text('此操作没有可靠百分比,正在显示真实阶段与耗时。',exact=True).count()==1
|
||||
page.screenshot(path=str(ROOT/'screenshots/install-activity-debug-zh.png'))
|
||||
page.evaluate("window.__emitFixture({stage:'openwrt_boot',status:'waiting_user',revision:13,details:{host:'192.168.9.1',reboot_manually:true}})")
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='请现在手动重启设备'
|
||||
guidance=page.locator('.boot-guidance')
|
||||
assert '已开始重启或已进入 OpenWrt' in guidance.inner_text()
|
||||
box=guidance.bounding_box()
|
||||
assert box['y']>=page.locator('header').bounding_box()['height'] and box['y']+box['height']<page.locator('.log-panel').bounding_box()['y']
|
||||
assert page.get_by_role('button',name='在安全边界暂停',exact=True).bounding_box()['y']<page.locator('.log-panel').bounding_box()['y']
|
||||
confirm=page.get_by_role('button',name='我已进入 OpenWrt,开始校验',exact=True)
|
||||
assert confirm.bounding_box()['y']+confirm.bounding_box()['height']<page.locator('.log-panel').bounding_box()['y']
|
||||
page.get_by_label('设备管理 IP / 主机名').fill('192.168.9.22')
|
||||
page.get_by_label('SSH root 密码(仅在内存中使用)').fill('fixture-private')
|
||||
page.screenshot(path=str(ROOT/'screenshots/manual-restart-log-zh.png'))
|
||||
confirm.click();settle(page)
|
||||
assert page.evaluate("window.__fixture.calls.filter(c=>c.command==='verify_openwrt').at(-1).params")=={'transaction':'a'*32,'host':'192.168.9.22','password':'fixture-private'}
|
||||
assert page.locator('h1').inner_text()=='请现在手动重启设备'
|
||||
page.evaluate("window.__emitFixture({stage:'openwrt_boot',status:'waiting_user',revision:14,details:{host:'192.168.9.22',boot_confirmed:true,reboot_manually:false,verification_error:'Management address belongs to another device / 管理地址对应另一台设备'}})")
|
||||
settle(page);layout(page)
|
||||
assert '另一台设备' in page.locator('.verification-error').inner_text()
|
||||
assert page.get_by_label('设备管理 IP / 主机名').input_value()=='192.168.9.22'
|
||||
assert page.get_by_role('button',name='我已进入 OpenWrt,开始校验',exact=True).is_enabled()
|
||||
before=guidance.bounding_box()
|
||||
page.locator('.page-scroll').evaluate('(el)=>el.scrollTop=el.scrollHeight')
|
||||
assert guidance.bounding_box()==before
|
||||
page.screenshot(path=str(ROOT/'screenshots/openwrt-endpoint-mismatch-zh.png'))
|
||||
page.get_by_label('语言').select_option('en');page.get_by_label('Theme').select_option('dark')
|
||||
page.evaluate("window.__emitFixture({stage:'openwrt_boot',status:'waiting_device',revision:15,details:{host:'192.168.9.1',reboot_manually:false}})")
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='Waiting for OpenWrt to start'
|
||||
assert 'automatic restart was requested' in guidance.inner_text()
|
||||
assert page.get_by_text('Newest entries first',exact=True).count()==1
|
||||
page.screenshot(path=str(ROOT/'screenshots/automatic-restart-log-en.png'))
|
||||
page.get_by_label('Language').select_option('zh');page.get_by_label('主题').select_option('light')
|
||||
page.evaluate("window.__emitFixture({stage:'backup',status:'failed',revision:16,error:{message:'TimeoutExpired: backup boot_a timed out after 120 seconds',retryable:true,code:'operation_failed'}})")
|
||||
event('log',{'level':'error','scope':'exception','message':'Traceback: TimeoutExpired in backup_partition'})
|
||||
settle(page);layout(page)
|
||||
page.get_by_role('button',name='复制诊断信息给开发者',exact=True).click();settle(page)
|
||||
assert 'DEBUG fixture diagnostics' in page.evaluate('window.__copied')
|
||||
assert page.evaluate("window.__fixture.requests.includes('diagnostics')")
|
||||
assert page.get_by_text('日志已复制',exact=True).count()==1
|
||||
page.screenshot(path=str(ROOT/'screenshots/failure-copy-diagnostics-zh.png'))
|
||||
page.get_by_label('语言').select_option('en');page.get_by_label('Theme').select_option('dark');settle(page);layout(page)
|
||||
assert page.get_by_role('button',name='Copy diagnostics for the developer').count()==1
|
||||
assert not errors,errors
|
||||
browser.close()
|
||||
print('Diagnostics smoke passed: newest-first multiline logs, pinned manual/automatic restart guidance with logs expanded at 800x650, persistent collapse/reopen, real byte progress, honest activity, traceback copying and bounded bilingual layout')
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,35 @@
|
||||
"""Read-only ADB enumeration through a real bundled backend before package checks."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
|
||||
def check(package):
|
||||
package=Path(package).resolve()
|
||||
with tempfile.TemporaryDirectory(prefix='openwrt-enumeration-') as directory:
|
||||
commands=['hello','devices','devices','list']
|
||||
requests=''.join(json.dumps({'protocol':1,'id':i,'command':command,'params':{}})+'\n' for i,command in enumerate(commands))
|
||||
result=subprocess.run([str(package/'tools/backend/openwrt-backend.exe'),'--package-root',str(package),'--data-dir',directory],input=requests.encode('utf-8'),capture_output=True,timeout=90)
|
||||
events=[json.loads(line) for line in result.stdout.decode('utf-8').splitlines()]
|
||||
if result.returncode or len(events)!=4 or not all(event['data']['ok'] for event in events):
|
||||
raise RuntimeError('Bundled enumeration failed: '+package.name)
|
||||
lists=[event['data']['result'] for event in events[1:3]]
|
||||
if not all(isinstance(values,list) for values in lists):raise AssertionError('Expected device lists')
|
||||
# Device identity remains private; report only count and transport state.
|
||||
row={'package':package.name,'commands':commands,'verified_package_required':False,
|
||||
'device_counts':[len(values) for values in lists],
|
||||
'states':[[device['state'] for device in values] for values in lists],
|
||||
'device_writes':False}
|
||||
print(package.name+': enumeration passed, counts='+str(row['device_counts']),flush=True)
|
||||
return row
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('packages',nargs='+',type=Path)
|
||||
parser.add_argument('--report',type=Path)
|
||||
args=parser.parse_args()
|
||||
rows=[check(package) for package in args.packages]
|
||||
if args.report:args.report.write_text(json.dumps(rows,indent=2)+'\n',encoding='utf-8')
|
||||
@@ -0,0 +1,234 @@
|
||||
"""Exercise the actual shipped Python coordinator/backup code with fake transports."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def child(package):
|
||||
if not getattr(sys, 'frozen', False):
|
||||
raise AssertionError('Frozen check failed')
|
||||
import hashlib
|
||||
import io
|
||||
import shlex
|
||||
import struct
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import paramiko
|
||||
import backend.transport as transport
|
||||
from backend.service import Service
|
||||
from backend.state import Context, Store
|
||||
from backend.package import inspect_package
|
||||
package_info = inspect_package(package)
|
||||
cid = 'b' * 32
|
||||
serial = 'simulated-only'
|
||||
data = bytes(range(256)) * 4096
|
||||
rows = []
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
store = Store(directory)
|
||||
device = {'serial': serial, 'cid': cid, 'profile': package_info['profile'], 'model': 'Simulated device'}
|
||||
record = store.create(package_info, device, {'method': 'reinstall'}, {'method': 'reinstall', 'openwrt_bytes': 4 << 30, 'grow': True})
|
||||
context = Context(store, record, lambda *_: None)
|
||||
adb = transport.Adb.__new__(transport.Adb)
|
||||
adb.exe = 'fixture-adb'
|
||||
adb.serial = serial
|
||||
adb.su = 'su'
|
||||
adb.context = context
|
||||
adb.backup_staging = None
|
||||
files = {}
|
||||
calls = []
|
||||
|
||||
def shell(command, **kwargs):
|
||||
calls.append(command)
|
||||
if command.startswith('blockdev'):
|
||||
return str(len(data))
|
||||
if command.startswith('df '):
|
||||
return str(1024 * 1024)
|
||||
if command.startswith('umask 077; mkdir '):
|
||||
return ''
|
||||
if command.startswith('set -e; umask 077; dd '):
|
||||
target = next((word[3:] for word in command.split() if word.startswith('of='))).rstrip(';')
|
||||
files[target] = data
|
||||
return ''
|
||||
if command.startswith('sha256sum '):
|
||||
return hashlib.sha256(files[shlex.split(command)[1]]).hexdigest() + ' file'
|
||||
if command.startswith('(set -o pipefail; cat '):
|
||||
return hashlib.sha256(data).hexdigest() + ' file'
|
||||
if command.startswith('rm -f '):
|
||||
files.pop(shlex.split(command)[2], None)
|
||||
return ''
|
||||
if command.startswith('rmdir '):
|
||||
return ''
|
||||
raise AssertionError('Unexpected simulated command')
|
||||
|
||||
class Pull:
|
||||
returncode = 0
|
||||
|
||||
def __init__(self, args, **kwargs):
|
||||
if not args[:4] == ['fixture-adb', '-s', serial, 'pull']:
|
||||
raise AssertionError('Frozen check failed')
|
||||
Path(args[-1]).write_bytes(files[args[-2]])
|
||||
|
||||
def communicate(self, **kwargs):
|
||||
return (b'1 file pulled', b'')
|
||||
|
||||
def poll(self):
|
||||
return 0
|
||||
adb.shell = shell
|
||||
original = transport.subprocess.Popen
|
||||
try:
|
||||
transport.subprocess.Popen = Pull
|
||||
destination = Path(directory) / 'boot_a.bin'
|
||||
adb.backup_partition('boot_a', destination, context)
|
||||
adb.cleanup_backup(context)
|
||||
if not (destination.read_bytes() == data and (not files)):
|
||||
raise AssertionError('Frozen check failed')
|
||||
if not not any(('base64' in call or 'gzip' in call for call in calls)):
|
||||
raise AssertionError('Frozen check failed')
|
||||
finally:
|
||||
transport.subprocess.Popen = original
|
||||
rows.append('device dd -> adb pull, full hash and staging cleanup')
|
||||
service = Service(package, store, io.StringIO())
|
||||
superblock = bytearray(1024)
|
||||
superblock[56:58] = b'S\xef'
|
||||
struct.pack_into('<I', superblock, 24, 2)
|
||||
struct.pack_into('<I', superblock, 4, (4 << 30) // 4096)
|
||||
|
||||
class SSH:
|
||||
|
||||
def set_missing_host_key_policy(self, *_):
|
||||
pass
|
||||
|
||||
def connect(self, *_, **kwargs):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def exec_command(self, command, **kwargs):
|
||||
if command == 'cat /sys/class/block/mmcblk0/device/cid':
|
||||
value = cid.encode()
|
||||
elif command.startswith('readlink -f') or command == 'cat /run/mu300/disk-dev':
|
||||
value = b'/dev/mmcblk0p74'
|
||||
elif command.startswith('dd if='):
|
||||
value = bytes(superblock)
|
||||
elif command == 'test -s /etc/openwrt_release && test -x /sbin/init':
|
||||
value = b''
|
||||
else:
|
||||
raise AssertionError('Unexpected simulated SSH command')
|
||||
return (None, SimpleNamespace(read=lambda: value, channel=SimpleNamespace(recv_exit_status=lambda: 0)), None)
|
||||
|
||||
def forbidden(*_):
|
||||
raise AssertionError('Installation/probe replayed')
|
||||
adapter = SimpleNamespace(password='', probe=forbidden, execute=forbidden)
|
||||
original = paramiko.SSHClient
|
||||
try:
|
||||
paramiko.SSHClient = SSH
|
||||
for stage in ('openwrt_boot', 'verify_capacity'):
|
||||
record.update(stage=stage, status='failed')
|
||||
store.save(record)
|
||||
loaded = Store(directory).load(record['id'])
|
||||
service.run(Context(store, loaded, service.emit), adapter)
|
||||
if not (loaded['status'] == 'completed' and loaded['result']['filesystem_bytes'] == 4 << 30):
|
||||
raise AssertionError('Frozen check failed')
|
||||
record.update(stage='prepare', status='running', legacy=None, choices={'method': 'tf'}, plan={'method': 'tf', 'openwrt_bytes': 4 << 30, 'grow': True}, effects={'misc-trial' if package_info['adapter'] == 'e5' else 'root-tf-write': {'state': 'done'}})
|
||||
store.save(record)
|
||||
service.run(Context(store, record, service.emit), adapter)
|
||||
if not record['status'] == 'completed':
|
||||
raise AssertionError('Frozen check failed')
|
||||
finally:
|
||||
paramiko.SSHClient = original
|
||||
rows.append('restart during final verification and final commit without replay')
|
||||
# Exercise the actual frozen command handler and retry loop. Two fake
|
||||
# routers share a default address; only the selected target has this CID.
|
||||
record.update(stage='openwrt_boot',status='waiting_user')
|
||||
record['choices']['host']='192.0.2.1'
|
||||
context=Context(store,record,service.emit)
|
||||
service.active=context
|
||||
service.worker=SimpleNamespace(is_alive=lambda:True)
|
||||
hosts=[]
|
||||
class Routers(SSH):
|
||||
def connect(self,host,**kwargs):
|
||||
hosts.append(host)
|
||||
self.host=host
|
||||
def exec_command(self,command,**kwargs):
|
||||
if self.host=='192.0.2.1':
|
||||
if command!='cat /sys/class/block/mmcblk0/device/cid':
|
||||
raise AssertionError('Read another router beyond identity')
|
||||
response=service.dispatch({'protocol':1,'command':'verify_openwrt','params':{
|
||||
'transaction':record['id'],'host':'192.0.2.2','password':'frozen-private-password'}})
|
||||
if not response['accepted']:raise AssertionError('Confirmation rejected')
|
||||
return None,SimpleNamespace(read=lambda:b'0'*32,channel=SimpleNamespace(recv_exit_status=lambda:0)),None
|
||||
return super().exec_command(command,**kwargs)
|
||||
try:
|
||||
paramiko.SSHClient=Routers
|
||||
service.wait_openwrt(context,adapter)
|
||||
finally:paramiko.SSHClient=original
|
||||
if hosts!=['192.0.2.1','192.0.2.2'] or record['status']!='completed' or not record['openwrt_confirmed']:
|
||||
raise AssertionError('Explicit confirmation bypassed or failed verification')
|
||||
if 'frozen-private-password' in (context.directory/'transaction.json').read_text():
|
||||
raise AssertionError('SSH password was persisted')
|
||||
rows.append('explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay')
|
||||
old_boot='11111111-1111-4111-8111-111111111111'
|
||||
new_boot='22222222-2222-4222-8222-222222222222'
|
||||
observed=[];root_reads=[];connection_attempts=[]
|
||||
record.update(stage='prepare',status='running',update_boot_id=old_boot,
|
||||
effects={'update-commit':{'state':'done'}},choices={'method':'update','host':'192.0.2.2'},
|
||||
plan={'method':'update','openwrt_bytes':4<<30,'grow':True})
|
||||
class UpdateSSH(SSH):
|
||||
def connect(self,*args,**kwargs):
|
||||
connection_attempts.append(True)
|
||||
if len(connection_attempts)==1:raise EOFError('Expected reboot disconnect')
|
||||
if len(connection_attempts)==2:raise ConnectionRefusedError('OpenWrt restarting')
|
||||
def exec_command(self,command,**kwargs):
|
||||
if command=='cat /proc/sys/kernel/random/boot_id':
|
||||
value=old_boot if not observed else new_boot
|
||||
observed.append(value)
|
||||
return None,SimpleNamespace(read=lambda:value.encode(),channel=SimpleNamespace(recv_exit_status=lambda:0)),None
|
||||
if command.startswith('dd if='):root_reads.append(observed[-1])
|
||||
return super().exec_command(command,**kwargs)
|
||||
original_wait=service.stop.wait
|
||||
try:
|
||||
paramiko.SSHClient=UpdateSSH
|
||||
service.stop.wait=lambda _:False
|
||||
service.run(Context(store,record,service.emit),adapter)
|
||||
finally:
|
||||
paramiko.SSHClient=original
|
||||
service.stop.wait=original_wait
|
||||
if record['status']!='completed' or observed!=[old_boot,new_boot] or root_reads!=[new_boot]:
|
||||
raise AssertionError('Old runtime completed update before actual reboot')
|
||||
if not record['stage_finished_at']>=record['stage_started_at']:
|
||||
raise AssertionError('Terminal phase time not saved')
|
||||
events=[json.loads(line) for line in service.output.getvalue().splitlines()]
|
||||
reconnects=[e['data'] for e in events if e['type']=='transaction' and e['data'].get('details',{}).get('connection_state')=='reconnecting']
|
||||
if len(reconnects)!=2 or any(r['status']!='waiting_device' or r['details'].get('verification_error') for r in reconnects):
|
||||
raise AssertionError('Expected restart disconnect became a warning or failure')
|
||||
rows.append('committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen')
|
||||
diagnostics = service.dispatch({'protocol': 1, 'command': 'diagnostics', 'params': {'transaction': record['id']}})['text']
|
||||
if not '"level": "debug"' in diagnostics:
|
||||
raise AssertionError('Frozen check failed')
|
||||
if not (serial not in diagnostics and cid not in diagnostics):
|
||||
raise AssertionError('Frozen check failed')
|
||||
if not ('Backup verified' in diagnostics and 'verify_capacity' in diagnostics):
|
||||
raise AssertionError('Frozen check failed')
|
||||
rows.append('persistent redacted diagnostic sharing')
|
||||
print(json.dumps({'package': package.name, 'frozen_backend': True, 'simulated_transport': True, 'checks': rows, 'hardware_access': False}))
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '--child':
|
||||
child(Path(sys.argv[2]).resolve())
|
||||
else:
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('packages', nargs='+', type=Path)
|
||||
parser.add_argument('--report', type=Path)
|
||||
parser.add_argument('--backend', type=Path)
|
||||
args = parser.parse_args()
|
||||
rows = []
|
||||
for package in args.packages:
|
||||
backend = args.backend.resolve() if args.backend else package.resolve() / 'tools/backend/openwrt-backend.exe'
|
||||
result = subprocess.run([str(backend), '--run-tool', str(Path(__file__).resolve()), '--child', str(package.resolve())], capture_output=True, timeout=60)
|
||||
if result.returncode:
|
||||
raise RuntimeError(result.stderr.decode('utf-8'))
|
||||
rows.append(json.loads(result.stdout.decode('utf-8')))
|
||||
print(package.name + ': frozen backup/recovery/diagnostics passed', flush=True)
|
||||
if args.report:
|
||||
args.report.write_text(json.dumps(rows, indent=2) + '\n', encoding='utf-8')
|
||||
@@ -0,0 +1,82 @@
|
||||
"""Run no-card probes through the actual frozen backend, with simulated ADB only."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def child(package):
|
||||
if not getattr(sys, 'frozen', False):
|
||||
raise AssertionError('Run this check through the frozen backend')
|
||||
from backend.adapter import Adapter
|
||||
from backend.service import plan_install
|
||||
mu = (package / 'desktop/manifest.json').is_file()
|
||||
meta = {'path': str(package), 'adapter': 'mu300' if mu else 'e5'}
|
||||
a = Adapter(meta)
|
||||
model = 'MU300' if mu else a.legacy.package_profile()['android_models'][0]
|
||||
calls = []
|
||||
|
||||
class Transport:
|
||||
su = 'su'
|
||||
|
||||
def devices(self):
|
||||
return [{'serial': 'test-device', 'state': 'device'}]
|
||||
|
||||
def properties(self):
|
||||
return {'ro.product.model': model, 'ro.product.device': 'F50', 'ro.board.platform': 'ums9620', 'ro.boot.slot_suffix': '_a', 'ro.boot.verifiedbootstate': 'orange', 'ro.crypto.state': 'unencrypted', 'ro.crypto.type': '', 'sys.boot_completed': '1'}
|
||||
|
||||
def root_status(self):
|
||||
return 'ready'
|
||||
|
||||
def shell(self, script, root=False):
|
||||
if script == 'cat /proc/sys/kernel/random/boot_id':
|
||||
return 'test-boot'
|
||||
if script == 'settings get secure user_setup_complete':
|
||||
return '1'
|
||||
if script.startswith('set -e; d='):
|
||||
return 'NODE=mmcblk1p16\nCID=' + 'b' * 32 + '\nSTART=2048\nSIZE=33554432\nDISK_SIZE=134217728\nFREE=12582912\nSOURCE=/dev/block/mmcblk1p16\nROOT=mmcblk1p20\n'
|
||||
if script == 'cat /sys/class/block/mmcblk1p20/start /sys/class/block/mmcblk1p20/size':
|
||||
return '33556480 8388608'
|
||||
raise AssertionError('Unexpected simulated read')
|
||||
|
||||
def missing_card():
|
||||
calls.append('sd')
|
||||
raise ValueError('expected one SD card, found 0 (none): is a card in the slot?')
|
||||
a.adb = Transport()
|
||||
a.bind = lambda _serial: None
|
||||
a.read_gpt = lambda _storage: {'empty': [1], 'safe_gaps': []}
|
||||
a.legacy.device_sd = missing_card
|
||||
for method in ('part', 'reinstall', 'image', 'boot'):
|
||||
device = a.probe('test-device', method)
|
||||
if not (device['existing'] and device['root']):
|
||||
raise AssertionError('Frozen check failed')
|
||||
plan = plan_install(meta, device, {'method': 'reinstall', 'grow': True})
|
||||
if not (plan['method'] == 'reinstall' and plan['target'] == 'mmcblk1p20' and (plan['openwrt_bytes'] == 4 << 30) and (not plan['wipe'])):
|
||||
raise AssertionError('Frozen check failed')
|
||||
if not not calls:
|
||||
raise AssertionError('Frozen check failed')
|
||||
try:
|
||||
target = a.probe('test-device', 'tf')
|
||||
plan_install(meta, target, {'method': 'tf'})
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
raise AssertionError('Missing card must block TF installation')
|
||||
print(json.dumps({'package': package.name, 'frozen_backend': True, 'simulated_transport': True, 'non_tf_probes': ['part', 'reinstall', 'image', 'boot'], 'reinstall_target': plan['target'], 'reinstall_bytes': plan['openwrt_bytes'], 'tf_missing_card_rejected': True, 'hardware_access': False}))
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '--child':
|
||||
child(Path(sys.argv[2]).resolve())
|
||||
else:
|
||||
import argparse
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
p.add_argument('packages', nargs='+', type=Path)
|
||||
p.add_argument('--report', type=Path)
|
||||
args = p.parse_args()
|
||||
rows = []
|
||||
for package in args.packages:
|
||||
result = subprocess.run([str(package.resolve() / 'tools/backend/openwrt-backend.exe'), '--run-tool', str(Path(__file__).resolve()), '--child', str(package.resolve())], capture_output=True, timeout=30)
|
||||
if result.returncode:
|
||||
raise RuntimeError(result.stderr.decode('utf-8'))
|
||||
rows.append(json.loads(result.stdout.decode('utf-8')))
|
||||
print(package.name + ': actual frozen backend method isolation passed', flush=True)
|
||||
if args.report:
|
||||
args.report.write_text(json.dumps(rows, indent=2) + '\n', encoding='utf-8')
|
||||
@@ -0,0 +1,62 @@
|
||||
"""Verify explicit UI methods survive probing, review and back navigation."""
|
||||
from playwright.sync_api import sync_playwright
|
||||
from ui_smoke import BRIDGE, ROOT, settle
|
||||
|
||||
|
||||
def last(page,command):
|
||||
return page.evaluate('(command)=>window.__fixture.calls.filter(call=>call.command===command).at(-1).params',command)
|
||||
|
||||
|
||||
def main():
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch()
|
||||
context=browser.new_context(viewport={'width':1120,'height':900})
|
||||
context.add_init_script(BRIDGE+"localStorage.setItem('onboarding-v1','seen');window.__fixture.probed={existing:true,tf:null};")
|
||||
page=context.new_page();errors=[]
|
||||
page.on('pageerror',lambda error:errors.append(str(error)))
|
||||
page.goto('http://127.0.0.1:1420')
|
||||
page.get_by_role('button',name='高级选项',exact=False).click();settle(page)
|
||||
button=page.get_by_role('button',name='重装已有内置分区',exact=False)
|
||||
assert button.get_attribute('aria-pressed')=='true'
|
||||
page.get_by_role('button',name='校验安装包',exact=True).click()
|
||||
page.get_by_label('请选择设备').select_option('fixture-1234')
|
||||
page.get_by_role('button',name='检查设备',exact=True).click();settle(page)
|
||||
assert last(page,'probe')['method']=='reinstall'
|
||||
page.get_by_role('button',name='查看安装计划',exact=True).click();settle(page)
|
||||
assert last(page,'plan')['choices']['method']=='reinstall'
|
||||
assert page.locator('.plan-list').get_by_text('重装已有内置分区',exact=True).count()==1
|
||||
assert page.locator('.plan-list').get_by_text('mmcblk1p20',exact=True).count()==1
|
||||
assert page.get_by_text('已有 OpenWrt 系统与设置会被替换,Android 用户数据保留。',exact=True).count()==1
|
||||
assert page.get_by_role('button',name='确认并开始',exact=True).is_disabled()
|
||||
page.screenshot(path=str(ROOT/'screenshots/reinstall-no-card-plan-zh.png'))
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
assert page.locator('h1').inner_text()=='高级选项'
|
||||
assert button.get_attribute('aria-pressed')=='true'
|
||||
page.get_by_role('button',name='检查设备',exact=True).click();settle(page)
|
||||
assert last(page,'probe')['method']=='reinstall'
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
# A present card must never replace an explicit internal choice.
|
||||
for method,label,existing in [('part','独立内置分区',False),('reinstall','重装已有内置分区',True),('tf','TF 卡',False)]:
|
||||
page.evaluate('(existing)=>window.__fixture.probed={existing,tf:"/dev/block/mmcblk0p1"}',existing)
|
||||
page.get_by_role('button',name='安装 OpenWrt',exact=False).click();settle(page)
|
||||
choice=page.get_by_role('button',name=label,exact=False);choice.click()
|
||||
page.get_by_role('button',name='检查设备',exact=True).click();settle(page)
|
||||
assert last(page,'probe')['method']==method
|
||||
assert choice.get_attribute('aria-pressed')=='true'
|
||||
page.get_by_role('button',name='查看安装计划',exact=True).click();settle(page)
|
||||
assert last(page,'plan')['choices']['method']==method
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
assert choice.get_attribute('aria-pressed')=='true'
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
page.get_by_role('button',name='高级选项',exact=False).click();settle(page)
|
||||
page.get_by_role('button',name='userdata 镜像',exact=True).click()
|
||||
page.get_by_role('button',name='检查设备',exact=True).click();settle(page)
|
||||
assert last(page,'probe')['method']=='image'
|
||||
assert page.get_by_role('button',name='userdata 镜像',exact=True).get_attribute('aria-pressed')=='true'
|
||||
assert not errors,errors
|
||||
assert not {'start','resume','retry','cancel'} & set(page.evaluate('window.__fixture.requests'))
|
||||
print('Method smoke passed: no-card reinstall, explicit part/reinstall/TF/image preserved, exact probe/plan parameters, review target/impact and return-to-origin; no device writes')
|
||||
browser.close()
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,40 @@
|
||||
"""Exercise out-of-order checkpoints and saved unconfirmed plans in the UI."""
|
||||
from playwright.sync_api import sync_playwright
|
||||
from ui_smoke import BRIDGE, settle
|
||||
|
||||
|
||||
def main():
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch()
|
||||
context=browser.new_context(viewport={'width':800,'height':650})
|
||||
context.add_init_script(BRIDGE+"localStorage.setItem('onboarding-v1','seen');window.__fixture.startRace=true;")
|
||||
page=context.new_page();errors=[]
|
||||
page.on('pageerror',lambda error:errors.append(str(error)))
|
||||
page.goto('http://127.0.0.1:1420')
|
||||
page.get_by_role('button',name='继续未完成的安装',exact=False).click();settle(page)
|
||||
assert page.locator('.record').get_by_text('独立内置分区 · ••••1234',exact=True).count()==1
|
||||
page.get_by_role('button',name='确认安装计划',exact=True).click();settle(page)
|
||||
assert page.get_by_role('button',name='确认并开始').is_disabled()
|
||||
assert not {'start','resume','retry'} & set(page.evaluate('window.__fixture.requests'))
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
assert page.locator('h1').inner_text()=='继续未完成的安装'
|
||||
page.get_by_role('button',name='确认安装计划',exact=True).click();settle(page)
|
||||
page.get_by_role('checkbox').check()
|
||||
page.get_by_role('button',name='确认并开始').click()
|
||||
page.get_by_role('heading',name='OpenWrt 已安装并通过校验',exact=True).wait_for();settle(page)
|
||||
# A late request response and arbitrarily late events must not undo completion.
|
||||
for i in range(20):
|
||||
page.evaluate("window.__emitFixture({stage:'root_permission',status:'waiting_user',revision:1})")
|
||||
settle(page)
|
||||
assert page.locator('h1').inner_text()=='OpenWrt 已安装并通过校验'
|
||||
assert page.get_by_role('button',name='在安全边界暂停',exact=True).count()==0
|
||||
page.evaluate("window.__emitFixture({stage:'root_permission',status:'waiting_user',revision:3});window.__fixture.cancelAccepted=false")
|
||||
page.get_by_role('button',name='在安全边界暂停',exact=True).click();settle(page)
|
||||
assert page.get_by_text('已请求暂停,将在安全边界生效。',exact=True).count()==0
|
||||
assert page.evaluate("window.__fixture.calls.filter(c=>c.command==='start').length")==1
|
||||
assert not errors,errors
|
||||
browser.close()
|
||||
print('Ordering smoke passed: saved plans require confirmation, no stale response/event regression, 20 late events ignored, rejected pause has no success toast')
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,86 @@
|
||||
"""Device enumeration remains available without a package; text selection is scoped."""
|
||||
from playwright.sync_api import sync_playwright
|
||||
from ui_smoke import BRIDGE, ROOT, layout, settle
|
||||
|
||||
|
||||
def selection(page,selector,expected):
|
||||
assert page.locator(selector).first.evaluate('(el)=>getComputedStyle(el).userSelect')==expected,selector
|
||||
|
||||
|
||||
def main():
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch()
|
||||
context=browser.new_context(viewport={'width':800,'height':650})
|
||||
context.add_init_script(BRIDGE+"window.__fixture.devices=[];localStorage.setItem('onboarding-v1','seen');")
|
||||
page=context.new_page();errors=[]
|
||||
page.on('pageerror',lambda error:errors.append(str(error)))
|
||||
page.goto('http://127.0.0.1:1420')
|
||||
page.get_by_role('button',name='安装 OpenWrt',exact=False).click();settle(page)
|
||||
refresh=page.get_by_role('button',name='刷新设备',exact=True)
|
||||
assert refresh.is_enabled()
|
||||
assert page.get_by_role('button',name='检查设备',exact=True).is_disabled()
|
||||
assert page.get_by_role('button',name='查看安装计划',exact=True).is_disabled()
|
||||
assert 'package' not in page.evaluate('window.__fixture.requests')
|
||||
for _ in range(3):
|
||||
refresh.click();settle(page)
|
||||
assert refresh.is_enabled()
|
||||
assert page.get_by_label('请选择设备').locator('option:checked').inner_text()=='未发现设备'
|
||||
selection(page,'h1','none');selection(page,'.stepper','none');selection(page,'.ui-button','none')
|
||||
selection(page,'.file-path','text')
|
||||
page.screenshot(path=str(ROOT/'screenshots/no-device-refresh-light-zh.png'))
|
||||
# A transient enumeration failure clears stale readiness and leaves retry available.
|
||||
page.evaluate("window.__fixture.fail='devices'")
|
||||
refresh.click()
|
||||
page.get_by_text('Error: Fixture: operation rejected',exact=True).wait_for();settle(page)
|
||||
assert refresh.is_enabled()
|
||||
selection(page,'.toast-description','text')
|
||||
page.evaluate("window.__fixture.fail=null;window.__fixture.devices=[{serial:'second-5678',state:'unauthorized',label:'Other'}, {serial:'chosen-1234',state:'device',label:'E5'}]")
|
||||
refresh.click();settle(page)
|
||||
assert page.get_by_label('请选择设备').input_value()==''
|
||||
page.get_by_label('请选择设备').select_option('chosen-1234')
|
||||
assert page.get_by_role('button',name='检查设备',exact=True).is_disabled()
|
||||
assert 'probe' not in page.evaluate('window.__fixture.requests')
|
||||
page.get_by_role('button',name='校验安装包',exact=True).click()
|
||||
page.get_by_role('button',name='检查设备',exact=True).click();settle(page)
|
||||
assert page.get_by_role('button',name='查看安装计划',exact=True).is_enabled()
|
||||
selection(page,'.device-card small','none');selection(page,'.device-card strong','text')
|
||||
# Refresh invalidates old root inspection; no-device response cannot leave install enabled.
|
||||
page.evaluate('window.__fixture.devices=[]')
|
||||
refresh.click();settle(page)
|
||||
assert page.get_by_label('请选择设备').input_value()==''
|
||||
assert page.locator('.device-card').count()==0
|
||||
assert page.get_by_role('button',name='查看安装计划',exact=True).is_disabled()
|
||||
page.evaluate("window.__fixture.devices=[{serial:'single-1234',state:'unauthorized',label:'E5'}]")
|
||||
refresh.click();settle(page)
|
||||
assert page.get_by_label('请选择设备').input_value()=='single-1234'
|
||||
assert '等待调试授权' in page.get_by_label('请选择设备').locator('option:checked').inner_text()
|
||||
page.get_by_role('button',name='详细日志',exact=False).click();settle(page)
|
||||
selection(page,'.log-toggle','none');selection(page,'.log-panel pre','text')
|
||||
page.locator('.log-panel pre').dblclick(position={'x':95,'y':20})
|
||||
assert page.evaluate('getSelection().toString().length')>0
|
||||
page.evaluate('getSelection().removeAllRanges()')
|
||||
page.locator('h1').dblclick()
|
||||
assert page.evaluate('getSelection().toString()')==''
|
||||
page.get_by_role('button',name='详细日志',exact=False).click();settle(page)
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
for name in ['高级选项','临时启动已安装的 OpenWrt']:
|
||||
page.get_by_role('button',name=name,exact=False).click();settle(page)
|
||||
assert refresh.is_enabled()
|
||||
page.get_by_role('button',name='返回',exact=True).click();settle(page)
|
||||
page.get_by_label('语言').select_option('en')
|
||||
page.get_by_role('button',name='Advanced options',exact=False).click();settle(page)
|
||||
page.locator('.page-scroll').evaluate('(el)=>el.scrollTop=el.scrollHeight')
|
||||
page.get_by_role('button',name='Userdata image',exact=True).click()
|
||||
selection(page,'input[type=number]','text')
|
||||
page.get_by_role('button',name='Help and user guide',exact=True).click();settle(page)
|
||||
page.get_by_role('dialog').get_by_role('button',name='Connection and troubleshooting',exact=True).click()
|
||||
selection(page,'.help-article>h2','none');selection(page,'.help-markdown p','text')
|
||||
selection(page,'.help-topics button','none')
|
||||
page.keyboard.press('Escape');settle(page);layout(page)
|
||||
assert not errors,errors
|
||||
assert not {'plan','start','cancel','resume','retry'} & set(page.evaluate('window.__fixture.requests'))
|
||||
print('Refresh smoke passed: unverified package, repeated empty-list retry, error retry, multiple/unauthorized devices, stale-root clearing, install/advanced/boot pages, bounded layout and selective copying; no device writes')
|
||||
browser.close()
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,52 @@
|
||||
"""Run all production-bundle browser checks with an owned, temporary server."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
from urllib.request import urlopen
|
||||
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
CHECKS=('ui_smoke','help_smoke','refresh_smoke','method_smoke','ordering_smoke','diagnostics_smoke','update_smoke')
|
||||
|
||||
|
||||
def main():
|
||||
if not (ROOT/'ui/dist/index.html').is_file():
|
||||
raise SystemExit('Build the production frontend first: npm run build in installer/ui')
|
||||
# Never attach tests to, or terminate, somebody else's running application.
|
||||
with socket.socket() as check:
|
||||
check.bind(('127.0.0.1',1420))
|
||||
results=[]
|
||||
with tempfile.TemporaryFile() as log:
|
||||
server=subprocess.Popen([sys.executable,'-m','http.server','1420','--bind','127.0.0.1',
|
||||
'--directory',str(ROOT/'ui/dist')],stdout=log,stderr=log)
|
||||
try:
|
||||
deadline=time.monotonic()+15
|
||||
while True:
|
||||
if server.poll() is not None:raise RuntimeError('Test server exited')
|
||||
try:
|
||||
with urlopen('http://127.0.0.1:1420',timeout=1) as response:
|
||||
if response.status==200:break
|
||||
except OSError:
|
||||
if time.monotonic()>deadline:raise RuntimeError('Test server did not start')
|
||||
time.sleep(.1)
|
||||
for name in CHECKS:
|
||||
result=subprocess.run([sys.executable,'-X','utf8',str(ROOT/'tests'/(name+'.py'))],
|
||||
capture_output=True,timeout=180)
|
||||
row={'test':name,'exit':result.returncode,'output':result.stdout.decode('utf-8'),
|
||||
'error':result.stderr.decode('utf-8')}
|
||||
results.append(row)
|
||||
print(name+(': PASS' if result.returncode==0 else ': FAIL'),flush=True)
|
||||
if result.returncode:print(row['error'],flush=True)
|
||||
finally:
|
||||
server.terminate()
|
||||
server.wait(timeout=10)
|
||||
report=ROOT/'verification/ui-regression.json'
|
||||
report.parent.mkdir(exist_ok=True)
|
||||
report.write_text(json.dumps(results,indent=2,ensure_ascii=False)+'\n',encoding='utf-8')
|
||||
return 1 if any(row['exit'] for row in results) else 0
|
||||
|
||||
|
||||
if __name__=='__main__':raise SystemExit(main())
|
||||
@@ -0,0 +1,116 @@
|
||||
"""Device dd -> adb pull backup tests; transport and device files are simulated."""
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.state import Context,Store,Cancelled
|
||||
from backend.transport import Adb
|
||||
|
||||
|
||||
class Pull:
|
||||
def __init__(self,args,data,corrupt=False):
|
||||
self.args=args;self.path=Path(args[-1]);self.data=data;self.steps=0
|
||||
self.returncode=None;self.killed=False;self.corrupt=corrupt
|
||||
def communicate(self,timeout=None):
|
||||
if self.killed:return b'',b'cancelled'
|
||||
self.steps+=1
|
||||
if self.steps==1:
|
||||
self.path.write_bytes(self.data[:len(self.data)//2])
|
||||
raise subprocess.TimeoutExpired(self.args,timeout)
|
||||
if self.steps==2:self.path.write_bytes((b'X'+self.data[1:]) if self.corrupt else self.data)
|
||||
self.returncode=0
|
||||
return b'1 file pulled',b''
|
||||
def poll(self):return self.returncode
|
||||
def kill(self):self.killed=True;self.returncode=-1
|
||||
|
||||
|
||||
class Backup(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory();self.store=Store(self.temp.name)
|
||||
self.record=self.store.create({}, {}, {}, {})
|
||||
self.events=[];self.ctx=Context(self.store,self.record,lambda k,d:self.events.append((k,d)))
|
||||
with patch('backend.transport.shutil.which',return_value='adb'):self.adb=Adb('.', 'selected')
|
||||
self.adb.su='su';self.adb.context=self.ctx
|
||||
self.data=bytes(range(256))*8192+b'last sector'
|
||||
self.target=Path(self.temp.name)/'boot_a.bin'
|
||||
self.remote={};self.commands=[];self.process=None;self.corrupt=False
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def shell(self,script,**_):
|
||||
self.commands.append(script)
|
||||
if script.startswith('blockdev'):return str(len(self.data))
|
||||
if script.startswith('df '):return str(1024*1024)
|
||||
if script.startswith('umask 077; mkdir '):return ''
|
||||
if script.startswith('set -e; umask 077; dd '):
|
||||
match=re.search(r'of=(\S+)',script)
|
||||
self.remote[match[1]]=self.data;return ''
|
||||
if script.startswith('sha256sum '):return hashlib.sha256(self.remote[shlex.split(script)[1]]).hexdigest()+' file'
|
||||
if script.startswith('(set -o pipefail; cat '):return hashlib.sha256(self.data).hexdigest()+' -'
|
||||
if script.startswith('rm -f '):self.remote.pop(shlex.split(script)[2],None);return ''
|
||||
if script.startswith('rmdir '):return ''
|
||||
self.fail('Unexpected backup command: '+script)
|
||||
|
||||
def popen(self,args,**_):
|
||||
self.assertEqual(args[:4],['adb','-s','selected','pull'])
|
||||
self.assertTrue(args[4].startswith('/data/local/tmp/openwrt-backup-'))
|
||||
self.process=Pull(args,self.remote[args[4]],self.corrupt)
|
||||
return self.process
|
||||
|
||||
def run_backup(self):
|
||||
with patch.object(self.adb,'shell',side_effect=self.shell),patch('backend.transport.subprocess.Popen',side_effect=self.popen):
|
||||
try:self.adb.backup_partition('boot_a',self.target,self.ctx)
|
||||
finally:self.adb.cleanup_backup(self.ctx)
|
||||
|
||||
def test_stages_in_private_android_directory_and_pulls_with_true_progress(self):
|
||||
self.run_backup()
|
||||
self.assertEqual(self.target.read_bytes(),self.data)
|
||||
events=[d for k,d in self.events if k=='transfer']
|
||||
self.assertEqual([d['bytes'] for d in events],[len(self.data)//2,len(self.data)])
|
||||
self.assertTrue(all(d['total']==len(self.data) for d in events))
|
||||
self.assertFalse(self.remote)
|
||||
self.assertTrue(any('chmod 644 ' in command for command in self.commands))
|
||||
self.assertFalse(any('base64' in command or 'gzip' in command for command in self.commands))
|
||||
self.assertNotIn('backup_staging',self.record)
|
||||
|
||||
def test_bad_download_preserves_existing_backup_and_cleans_staging(self):
|
||||
self.target.write_bytes(b'existing verified backup');self.corrupt=True
|
||||
with self.assertRaisesRegex(ValueError,'Computer backup checksum'):self.run_backup()
|
||||
self.assertEqual(self.target.read_bytes(),b'existing verified backup')
|
||||
self.assertFalse(Path(str(self.target)+'.partial').exists())
|
||||
self.assertFalse(self.remote)
|
||||
|
||||
def test_cancel_kills_only_readonly_pull_and_cleans_partial_files(self):
|
||||
def emit(kind,data):
|
||||
if kind=='transfer':self.ctx.cancel=True
|
||||
self.ctx.emit=emit
|
||||
with self.assertRaises(Cancelled):self.run_backup()
|
||||
self.assertTrue(self.process.killed)
|
||||
self.assertFalse(self.target.exists())
|
||||
self.assertFalse(self.remote)
|
||||
|
||||
def test_low_staging_space_stops_before_dd(self):
|
||||
def shell(script,**kwargs):
|
||||
if script.startswith('df '):return '1'
|
||||
return self.shell(script,**kwargs)
|
||||
with patch.object(self.adb,'shell',side_effect=shell):
|
||||
with self.assertRaisesRegex(ValueError,'staging space'):self.adb.backup_partition('boot_a',self.target,self.ctx)
|
||||
self.assertFalse(any('dd if=' in command for command in self.commands))
|
||||
|
||||
def test_metadata_read_is_binary_and_serial_bound(self):
|
||||
result=type('Result',(),{'returncode':0,'stdout':self.data,'stderr':b''})()
|
||||
with patch('backend.transport.subprocess.run',return_value=result) as run:
|
||||
self.assertEqual(self.adb.read('bounded read'),self.data)
|
||||
args=run.call_args.args[0]
|
||||
self.assertEqual(args[:4],['adb','-s','selected','exec-out'])
|
||||
self.assertNotIn('base64',args[-1])
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -0,0 +1,72 @@
|
||||
"""Detailed diagnostics must remain actionable, durable and safe to share."""
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.adapter import debug_output
|
||||
from backend.service import Service,plan_install
|
||||
from backend.state import Context,Store
|
||||
from test_state import PACKAGE,DEVICE
|
||||
|
||||
|
||||
class Diagnostics(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory();self.store=Store(self.temp.name)
|
||||
self.record=self.store.create(PACKAGE,DEVICE.copy(),{'method':'part','size_gib':4},
|
||||
plan_install(PACKAGE,DEVICE,{'method':'part','size_gib':4}))
|
||||
self.record['secrets']={'wifi_key':'private-wireless-secret'}
|
||||
self.events=[]
|
||||
self.ctx=Context(self.store,self.record,lambda kind,data:self.events.append((kind,data)))
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def test_split_cli_output_and_trace_details_are_redacted_and_persisted(self):
|
||||
self.ctx.private.append('private-root-password')
|
||||
with debug_output(self.ctx) as _:
|
||||
sys.stdout.write('partition backup started\npassword=private-')
|
||||
sys.stdout.write('root-password\n'+DEVICE['serial']+'\n')
|
||||
sys.stderr.write('E5_WIFI_KEY=private-wireless-secret\n')
|
||||
text=(self.ctx.directory/'debug.ndjson').read_text(encoding='utf-8')
|
||||
self.assertIn('partition backup started',text)
|
||||
for secret in (DEVICE['serial'],'private-root-password','private-wireless-secret'):
|
||||
self.assertNotIn(secret,text)
|
||||
self.assertTrue(all(data['level']=='debug' for kind,data in self.events))
|
||||
|
||||
def test_actual_exception_is_visible_in_error_and_copyable_after_restart(self):
|
||||
service=Service('.',self.store,io.StringIO())
|
||||
def fail(*_):raise subprocess.TimeoutExpired(['adb','-s',DEVICE['serial'],'private-root-password'],120)
|
||||
adapter=SimpleNamespace(password='private-root-password',probe=fail)
|
||||
service.run(self.ctx,adapter)
|
||||
self.assertIn('TimeoutExpired',self.record['error']['message'])
|
||||
reopened=Service('.',Store(self.temp.name),io.StringIO())
|
||||
reopened.worker=SimpleNamespace(is_alive=lambda:True)
|
||||
result=reopened.dispatch({'protocol':1,'command':'diagnostics','params':{'transaction':self.record['id']}})['text']
|
||||
self.assertIn('Traceback',result)
|
||||
self.assertIn('120',result)
|
||||
for secret in (DEVICE['serial'],DEVICE['cid'],'private-root-password','private-wireless-secret'):
|
||||
self.assertNotIn(secret,result)
|
||||
|
||||
def test_log_rotation_and_copy_size_are_bounded(self):
|
||||
path=self.ctx.directory/'debug.ndjson';path.write_text('x'*(4*1024*1024+1))
|
||||
self.ctx.log('latest failure detail',level='error')
|
||||
self.assertTrue((self.ctx.directory/'debug.previous.ndjson').is_file())
|
||||
service=Service('.',self.store,io.StringIO())
|
||||
copied=service.dispatch({'protocol':1,'command':'diagnostics','params':{'transaction':self.record['id']}})['text']
|
||||
self.assertIn('latest failure detail',copied)
|
||||
self.assertLess(len(copied),1100000)
|
||||
|
||||
def test_resumed_legacy_secret_does_not_leak(self):
|
||||
legacy=self.ctx.directory/'legacy.json';legacy.write_text(json.dumps({'key':'old-legacy-secret'}))
|
||||
self.record['legacy']=str(legacy)
|
||||
resumed=Context(self.store,self.record,lambda *_:None)
|
||||
resumed.log('old-legacy-secret')
|
||||
self.assertNotIn('old-legacy-secret',(self.ctx.directory/'debug.ndjson').read_text())
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -0,0 +1,151 @@
|
||||
"""Restart/fault matrix using real coordinator, journals and SSH verification.
|
||||
|
||||
Every transport is replaced before execution; no device is contacted.
|
||||
"""
|
||||
import io
|
||||
import struct
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from backend.service import Service, plan_install
|
||||
from backend.state import Context, Store
|
||||
from test_state import PACKAGE, DEVICE
|
||||
|
||||
|
||||
class FlowBoundaries(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp = tempfile.TemporaryDirectory()
|
||||
self.store = Store(self.temp.name)
|
||||
self.service = Service('.', self.store, io.StringIO())
|
||||
self.record = self.store.create(PACKAGE, DEVICE.copy(), {'method':'part', 'size_gib':4},
|
||||
plan_install(PACKAGE, DEVICE, {'method':'part', 'size_gib':4}))
|
||||
|
||||
def tearDown(self):
|
||||
self.temp.cleanup()
|
||||
|
||||
def restart_and_verify(self, expected_failure=False, disconnect=False):
|
||||
# Load from disk with a new Store/Context, as after a computer restart.
|
||||
store = Store(self.temp.name)
|
||||
record = store.load(self.record['id'])
|
||||
context = Context(store, record, self.service.emit)
|
||||
adapter = SimpleNamespace(password='', probe=Mock(side_effect=AssertionError('Android probe replayed')),
|
||||
execute=Mock(side_effect=AssertionError('Device writes replayed')))
|
||||
raw = bytearray(1024)
|
||||
raw[56:58] = b'\x53\xef'
|
||||
struct.pack_into('<I', raw, 24, 2)
|
||||
struct.pack_into('<I', raw, 4, ((2 if expected_failure else 4) << 30)//4096)
|
||||
def read(command, timeout=15):
|
||||
if command == 'cat /sys/class/block/mmcblk0/device/cid':
|
||||
value = DEVICE['cid']
|
||||
elif command.startswith('readlink -f') or command == 'cat /run/mu300/disk-dev':
|
||||
value = '/dev/mmcblk0p20'
|
||||
elif command.startswith('dd if='):
|
||||
value = bytes(raw)
|
||||
elif command == 'test -s /etc/openwrt_release && test -x /sbin/init':
|
||||
value = ''
|
||||
else:
|
||||
raise AssertionError('Unexpected SSH command: '+command)
|
||||
return None, SimpleNamespace(read=lambda:value if isinstance(value,bytes) else value.encode(), channel=SimpleNamespace(recv_exit_status=lambda:0)), None
|
||||
client = Mock()
|
||||
client.exec_command.side_effect = read
|
||||
if disconnect:
|
||||
client.connect.side_effect = [EOFError('Expected SSH loss during reboot'), None]
|
||||
with patch('paramiko.SSHClient', return_value=client), patch.object(self.service.stop, 'wait', return_value=False):
|
||||
self.service.run(context, adapter)
|
||||
adapter.probe.assert_not_called()
|
||||
adapter.execute.assert_not_called()
|
||||
saved = store.load(record['id'])
|
||||
self.assertEqual(saved['status'], 'failed' if expected_failure else 'completed')
|
||||
if expected_failure:
|
||||
self.assertIn('capacity', saved['error']['message'])
|
||||
self.assertTrue(saved['error']['retryable'])
|
||||
else:
|
||||
self.assertEqual(saved['result']['filesystem_bytes'], 4 << 30)
|
||||
return saved
|
||||
|
||||
def test_restart_during_final_capacity_check_only_verifies_openwrt(self):
|
||||
for status in ('running', 'cancelled', 'failed'):
|
||||
with self.subTest(status=status):
|
||||
self.record.update(stage='verify_capacity', status=status)
|
||||
self.store.save(self.record)
|
||||
self.restart_and_verify()
|
||||
|
||||
def test_capacity_failure_retry_does_not_reinstall(self):
|
||||
self.record.update(stage='verify_capacity', status='failed')
|
||||
self.store.save(self.record)
|
||||
self.restart_and_verify(expected_failure=True)
|
||||
self.restart_and_verify()
|
||||
|
||||
def test_restart_between_final_write_and_wait_checkpoint(self):
|
||||
for kind, method, final in [('e5','tf','misc-trial'), ('e5','part','misc-trial'),
|
||||
('e5','image','misc-trial'), ('e5','boot','misc-trial'),
|
||||
('mu300','tf','root-tf-write'), ('mu300','part','boot-and-misc-1234'),
|
||||
('mu300','reinstall','boot-and-misc-5678'), ('mu300','image','boot-and-misc-90ab')]:
|
||||
with self.subTest(adapter=kind,method=method):
|
||||
self.record.update(package={**PACKAGE,'adapter':kind}, choices={'method':method},
|
||||
stage='prepare', status='running', effects={final:{'state':'done'}}, legacy=None)
|
||||
self.record['plan']['method'] = method
|
||||
self.store.save(self.record)
|
||||
self.restart_and_verify()
|
||||
|
||||
def test_preparation_or_partial_effect_is_not_a_final_commit(self):
|
||||
from backend.adapter import installation_committed
|
||||
for kind, effects, legacy in [('e5',{'root-tf-write':{'state':'done'}},None),
|
||||
('e5',{'misc-trial':{'state':'started'}},None),
|
||||
('mu300',{'root-tf-write':{'state':'started'}},None),
|
||||
('mu300',{'boot-and-misc-1234':{'state':'done'}},'stage-one.json'),
|
||||
('e5',{'misc-trial-prepared':{'state':'done'}},'stage-one.json')]:
|
||||
with self.subTest(kind=kind,effects=effects):
|
||||
record={**self.record,'package':{**PACKAGE,'adapter':kind},'effects':effects,'legacy':legacy}
|
||||
self.assertFalse(installation_committed(record))
|
||||
|
||||
def test_transaction_revisions_increase_across_restart(self):
|
||||
original = self.record.get('revision', 0)
|
||||
store = Store(self.temp.name)
|
||||
record = store.load(self.record['id'])
|
||||
Context(store, record, lambda *_:None).stage('android_boot', 'waiting_device')
|
||||
self.assertGreater(store.load(record['id'])['revision'], original)
|
||||
|
||||
def test_expected_ssh_reboot_disconnect_is_waiting_then_verified(self):
|
||||
self.record.update(stage='openwrt_boot', status='waiting_device')
|
||||
self.store.save(self.record)
|
||||
self.restart_and_verify(disconnect=True)
|
||||
import json
|
||||
events=[json.loads(line) for line in self.service.output.getvalue().splitlines()]
|
||||
self.assertNotIn('failed',[e['data'].get('status') for e in events])
|
||||
|
||||
def test_final_wait_distinguishes_manual_restart_from_requested_reboot(self):
|
||||
for kind, method, manual in [('e5','reinstall',True), ('e5','part',True),
|
||||
('e5','tf',True), ('e5','image',True), ('e5','boot',False),
|
||||
('e5','update',False), ('mu300','boot',True),
|
||||
('mu300','reinstall',True), ('mu300','update',False)]:
|
||||
with self.subTest(adapter=kind, method=method):
|
||||
self.record.update(package={**PACKAGE,'adapter':kind},
|
||||
choices={'method':method,'host':'192.0.2.1'})
|
||||
context=Context(self.store,self.record,self.service.emit)
|
||||
self.service.openwrt_wait_stage(context)
|
||||
self.assertEqual(self.record['stage'],'openwrt_boot')
|
||||
self.assertEqual(self.record['status'],'waiting_user' if manual else 'waiting_device')
|
||||
self.assertEqual(self.record['details']['host'],'192.0.2.1')
|
||||
self.assertEqual(self.record['details']['reboot_manually'],manual)
|
||||
# Reconnection failure and an application restart must retain
|
||||
# the same instruction, without replaying an installation.
|
||||
context=Context(self.store,self.store.load(self.record['id']),self.service.emit)
|
||||
self.service.openwrt_wait_stage(context)
|
||||
self.assertEqual(context.record['details']['reboot_manually'],manual)
|
||||
|
||||
def test_finished_worker_does_not_accept_pause(self):
|
||||
self.service.active = Context(self.store, self.record, self.service.emit)
|
||||
self.service.worker = SimpleNamespace(is_alive=lambda:False)
|
||||
result = self.service.dispatch({'protocol':1,'command':'cancel','params':{}})
|
||||
self.assertFalse(result['accepted'])
|
||||
self.assertFalse(self.record['cancel_requested'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,120 @@
|
||||
"""Real host subprocesses, synthetic converters; no ADB or device writes."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import importlib.util
|
||||
import shutil
|
||||
import tarfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.helpers import execute_script,run_helper
|
||||
from backend.state import Context,Store,Cancelled
|
||||
|
||||
|
||||
class Helpers(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory();self.root=Path(self.temp.name)
|
||||
self.script=self.root/'scripts/tools/vbc-profile/vbc-profile.py'
|
||||
self.script.parent.mkdir(parents=True)
|
||||
self.store=Store(self.root/'app');self.record=self.store.create({}, {}, {}, {})
|
||||
self.events=[];self.ctx=Context(self.store,self.record,lambda k,d:self.events.append((k,d)))
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def test_converter_runs_captures_both_streams_and_has_named_phase(self):
|
||||
self.script.write_text('import sys\nprint("conversion stdout")\nprint("conversion stderr",file=sys.stderr)\n')
|
||||
run_helper(self.ctx,self.root,self.script,[])
|
||||
text=(self.ctx.directory/'debug.ndjson').read_text()
|
||||
self.assertIn('conversion stdout',text);self.assertIn('conversion stderr',text)
|
||||
self.assertEqual(self.record['stage'],'firmware_convert')
|
||||
self.assertEqual(self.record['details']['tool'],'vbc-profile.py')
|
||||
self.assertTrue(any(kind=='activity' for kind,data in self.events))
|
||||
|
||||
def test_converter_failure_contains_its_actual_traceback(self):
|
||||
self.script.write_text('raise RuntimeError("converter-specific failure")\n')
|
||||
with self.assertRaisesRegex(ValueError,'converter-specific failure'):
|
||||
run_helper(self.ctx,self.root,self.script,[])
|
||||
self.assertIn('Traceback',(self.ctx.directory/'debug.ndjson').read_text())
|
||||
|
||||
def test_converter_timeout_is_bounded(self):
|
||||
self.script.write_text('import time\ntime.sleep(30)\n')
|
||||
with self.assertRaisesRegex(TimeoutError,'vbc-profile.py'):
|
||||
run_helper(self.ctx,self.root,self.script,[],timeout=.3)
|
||||
|
||||
def test_pause_terminates_only_host_converter(self):
|
||||
self.script.write_text('import time\ntime.sleep(30)\n')
|
||||
processes=[];original=subprocess.Popen
|
||||
def capture(*args,**kwargs):
|
||||
process=original(*args,**kwargs);processes.append(process);return process
|
||||
def emit(kind,data):
|
||||
if kind=='activity':self.ctx.cancel=True
|
||||
self.ctx.emit=emit
|
||||
with patch('backend.helpers.subprocess.Popen',side_effect=capture):
|
||||
with self.assertRaises(Cancelled):run_helper(self.ctx,self.root,self.script,[])
|
||||
self.assertEqual(len(processes),1);self.assertIsNotNone(processes[0].poll())
|
||||
self.assertFalse(self.record['effects'])
|
||||
|
||||
def test_arbitrary_host_script_is_refused_before_launch(self):
|
||||
outside=self.root/'anything.py';outside.write_text('raise RuntimeError("must never execute")')
|
||||
with self.assertRaisesRegex(ValueError,'Unsupported'):run_helper(self.ctx,self.root,outside,[])
|
||||
self.assertEqual(self.record['stage'],'plan')
|
||||
|
||||
def test_tool_docstrings_and_asserts_survive_optimized_host(self):
|
||||
self.script.write_text('"""converter description"""\nimport argparse\na=argparse.ArgumentParser(description=__doc__.splitlines()[0]);print(a.description)\n')
|
||||
code='import sys;sys.path.insert(0,sys.argv[1]);from backend.helpers import execute_script;execute_script(sys.argv[2],[])'
|
||||
result=subprocess.run([sys.executable,'-OO','-c',code,str(Path(__file__).resolve().parents[1]),str(self.script)],capture_output=True,timeout=10)
|
||||
self.assertEqual(result.returncode,0,result.stderr.decode('utf-8','replace'))
|
||||
self.assertIn(b'converter description',result.stdout)
|
||||
self.script.write_text('assert False, "helper guard retained"\n')
|
||||
result=subprocess.run([sys.executable,'-OO','-c',code,str(Path(__file__).resolve().parents[1]),str(self.script)],capture_output=True,timeout=10)
|
||||
self.assertNotEqual(result.returncode,0);self.assertIn(b'helper guard retained',result.stderr)
|
||||
|
||||
def test_script_execution_restores_interpreter_state_after_failure(self):
|
||||
argv=sys.argv;main=sys.modules['__main__'];paths=sys.path[:]
|
||||
self.script.write_text('raise RuntimeError("test")\n')
|
||||
with self.assertRaises(RuntimeError):execute_script(self.script,['argument'])
|
||||
self.assertIs(sys.argv,argv);self.assertIs(sys.modules['__main__'],main);self.assertEqual(sys.path,paths)
|
||||
|
||||
def test_actual_firmware_extraction_runs_both_converters_before_device_pack(self):
|
||||
repo=Path(__file__).resolve().parents[2]
|
||||
source=repo/'openwrt/bundle/flash.py'
|
||||
if not source.is_file():self.skipTest('Real E5 extraction is exercised in the E5 repository')
|
||||
spec=importlib.util.spec_from_file_location('helper_extraction_fixture',source)
|
||||
legacy=importlib.util.module_from_spec(spec);spec.loader.exec_module(legacy)
|
||||
shutil.copy2(repo/'tools/vbc-profile/vbc-profile.py',self.script)
|
||||
shutil.copy2(repo/'tools/sprd-bt-config.py',self.root/'scripts/tools/sprd-bt-config.py')
|
||||
names={'wcnmodem.bin':b'wcn','bt_configure_pskey.xpe.ini':b'#[0.0]__/L=176\nvalue=0\n',
|
||||
'bt_configure_rf.xpe.ini':b'#[0.0]__/L=252\nvalue=0\n','btmac.txt':b'02:00:00:00:00:01',
|
||||
'l_agdsp_a.img':b'SharkL5_AUD'+bytes(6291456-11)}
|
||||
for name in ('dsp_vbc','audio_structure','cvs'):
|
||||
names[name+'.xml']=(f'<{name} num_mode="1" struct_size="4"><item mode="0"><x id="0" t="u32" val="123"/></item></{name}>').encode()
|
||||
legacy.SCRIPTS=str(self.root/'scripts');legacy.F=str(self.root/'files')
|
||||
legacy.GUI=SimpleNamespace(stage=self.ctx.stage,run_tool=lambda script,*args:run_helper(self.ctx,self.root,script,args))
|
||||
def shell(command):
|
||||
if command.startswith('ls /odm/firmware'):return ''
|
||||
if command=='ls /data/local/tmp/e5pull':return '\n'.join(names)
|
||||
if 'e5-collect.sh' in command:return 'E5-COLLECT-OK 123'
|
||||
return ''
|
||||
pushes=[]
|
||||
def adb(command,source,target,**kwargs):
|
||||
if command=='pull':Path(target).write_bytes(names[Path(source).name])
|
||||
elif command=='push':pushes.append((source,target))
|
||||
else:self.fail('Unexpected fixture transport')
|
||||
legacy.su=shell;legacy.adb=adb
|
||||
work=self.root/'work';work.mkdir()
|
||||
with patch('sys.stdout',__import__('io').StringIO()):self.assertEqual(legacy.pull_device_files(str(work)),'123')
|
||||
with tarfile.open(work/'firmware.tar') as archive:
|
||||
for name in ('audio_structure','dsp_vbc','cvs'):
|
||||
self.assertEqual(len(archive.extractfile('lib/firmware/'+name).read()),28)
|
||||
self.assertEqual(len(archive.extractfile('lib/firmware/sprd/marlin3lite_pskey.bin').read()),176)
|
||||
self.assertEqual(len(archive.extractfile('lib/firmware/sprd/marlin3lite_rf.bin').read()),252)
|
||||
self.assertTrue(any(target.endswith('e5-firmware.tar') for source,target in pushes))
|
||||
self.assertFalse(self.record['effects'])
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -0,0 +1,133 @@
|
||||
"""Exercise real probe/routing code with read-only simulated ADB, never hardware."""
|
||||
import io
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.adapter import Adapter, args_for
|
||||
from backend.service import Service
|
||||
from backend.state import Context, RecoveryRequired, Store
|
||||
|
||||
TOP=Path(__file__).resolve().parents[2]
|
||||
SERIAL='fixture-selected'
|
||||
CID='b'*32
|
||||
|
||||
|
||||
class ReadOnlyAdb:
|
||||
exe='test-adb'
|
||||
su='su'
|
||||
card=False
|
||||
commands=[]
|
||||
|
||||
def devices(self):return [{'serial':SERIAL,'state':'device'}]
|
||||
def properties(self):return {'ro.product.model':'E5','ro.product.device':'fixture','ro.board.platform':'fixture','ro.boot.slot_suffix':'_a','ro.boot.verifiedbootstate':'orange','ro.crypto.state':'unencrypted','ro.crypto.type':'','sys.boot_completed':'1'}
|
||||
def root_status(self):return 'ready'
|
||||
def shell(self,script,root=False):
|
||||
self.commands.append(script)
|
||||
if script=='cat /proc/sys/kernel/random/boot_id':return 'boot-fixture'
|
||||
if script=='settings get secure user_setup_complete':return '1'
|
||||
if script.startswith('set -e; d='):
|
||||
return f'NODE=mmcblk1p16\nCID={CID}\nSTART=2048\nSIZE=33554432\nDISK_SIZE=134217728\nFREE=12582912\nSOURCE=/dev/block/mmcblk1p16\nROOT=mmcblk1p20\n'+('TF=/dev/block/mmcblk0p1\n' if self.card else '')
|
||||
if script=='cat /sys/class/block/mmcblk1p20/start /sys/class/block/mmcblk1p20/size':return '33556480 8388608'
|
||||
if script=='test -b /dev/block/mmcblk0p1; echo $?':return '0'
|
||||
if script=='cat /sys/class/block/mmcblk0p1/size':return '16777216'
|
||||
if script=='cat /sys/class/block/mmcblk0/device/cid':return 'c'*32
|
||||
if script=='cat /sys/class/block/mmcblk0p1/start 2>/dev/null || echo 0':return '2048'
|
||||
raise AssertionError('Unexpected simulated ADB command: '+script)
|
||||
|
||||
|
||||
class MethodRouting(unittest.TestCase):
|
||||
def adapter(self,kind='e5',card=False):
|
||||
a=Adapter.__new__(Adapter);a.kind=kind;a.root=Path('.');a.ctx=None;a.password=''
|
||||
a.package={'adapter':kind,'path':'.','profile':'e5' if kind=='e5' else 'mu300-family'}
|
||||
a.adb=ReadOnlyAdb();a.adb.card=card;a.adb.commands=[]
|
||||
a.bind=Mock()
|
||||
a.legacy=SimpleNamespace(package_profile=Mock(return_value={'profile':'e5','android_models':['E5']}),android_profile=Mock(return_value='f50'),device_sd=Mock(side_effect=AssertionError('Internal mode touched TF discovery')),device_size=Mock(side_effect=AssertionError('Internal mode read TF capacity')))
|
||||
a.read_gpt=Mock(return_value={'empty':[1],'safe_gaps':[]})
|
||||
return a
|
||||
|
||||
def test_internal_modes_do_not_require_or_validate_a_card(self):
|
||||
for kind in ('e5','mu300'):
|
||||
for card in (False,True):
|
||||
for method in ('part','reinstall','image','boot'):
|
||||
with self.subTest(kind=kind,card=card,method=method):
|
||||
a=self.adapter(kind,card)
|
||||
device=a.probe(SERIAL,method)
|
||||
self.assertTrue(device['root']);self.assertTrue(device['existing'])
|
||||
self.assertEqual(device['storage']['ROOT'],'mmcblk1p20')
|
||||
a.legacy.device_sd.assert_not_called();a.legacy.device_size.assert_not_called()
|
||||
self.assertNotIn('tf_bytes',device)
|
||||
if method=='boot':a.read_gpt.assert_not_called()
|
||||
|
||||
def test_reinstall_plan_on_device_without_card(self):
|
||||
for kind in ('e5','mu300'):
|
||||
with self.subTest(kind=kind), tempfile.TemporaryDirectory() as directory:
|
||||
a=self.adapter(kind)
|
||||
service=Service('.',Store(directory),io.StringIO());service.package=a.package
|
||||
service.adapters=lambda *_args:a
|
||||
result=service.dispatch({'protocol':1,'command':'plan','params':{'serial':SERIAL,'choices':{'method':'reinstall','size_gib':4,'grow':True}}})
|
||||
self.assertEqual(result['choices']['method'],'reinstall')
|
||||
self.assertEqual(result['plan']['method'],'reinstall')
|
||||
self.assertEqual(result['plan']['target'],'mmcblk1p20')
|
||||
self.assertEqual(result['plan']['openwrt_bytes'],4<<30)
|
||||
self.assertFalse(result['plan']['wipe'])
|
||||
self.assertFalse(result['plan']['two_stage'])
|
||||
a.legacy.device_sd.assert_not_called()
|
||||
|
||||
def test_real_legacy_tf_error_only_applies_to_tf(self):
|
||||
source=TOP/'openwrt/bundle/flash.py'
|
||||
if not source.is_file():self.skipTest('E5 legacy source is tested in the E5 repository')
|
||||
spec=importlib.util.spec_from_file_location('routing_legacy_fixture',source)
|
||||
legacy=importlib.util.module_from_spec(spec);spec.loader.exec_module(legacy)
|
||||
for cards in ('','mmcblk0 mmcblk2'):
|
||||
with self.subTest(cards=cards):
|
||||
a=self.adapter();a.legacy=legacy;legacy.GUI=a
|
||||
with patch.object(legacy,'package_profile',return_value={'profile':'e5','android_models':['E5']}), patch.object(legacy,'su',side_effect=lambda script:'mmcblk1' if 'PARTNAME=userdata' in script else cards):
|
||||
self.assertTrue(a.probe(SERIAL,'reinstall')['existing'])
|
||||
with self.assertRaisesRegex(ValueError,'expected one SD card'):
|
||||
a.probe(SERIAL,'tf')
|
||||
|
||||
def test_tf_retains_first_partition_priority(self):
|
||||
a=self.adapter(card=True)
|
||||
a.legacy.device_sd=Mock(return_value='/dev/block/mmcblk0')
|
||||
a.legacy.device_size=Mock(return_value=8<<30)
|
||||
result=a.probe(SERIAL,'tf')
|
||||
self.assertEqual(result['tf'],'/dev/block/mmcblk0p1')
|
||||
self.assertEqual(result['tf_bytes'],8<<30)
|
||||
a.legacy.device_size.assert_called_once_with('/dev/block/mmcblk0p1')
|
||||
|
||||
def test_execute_routes_and_flags_are_exclusive(self):
|
||||
for kind in ('e5','mu300'):
|
||||
for method in ('tf','part','reinstall','image','boot','update'):
|
||||
with self.subTest(kind=kind,method=method), tempfile.TemporaryDirectory() as directory:
|
||||
root=Path(directory);(root/'desktop').mkdir();(root/'desktop/manifest.json').write_text('{}')
|
||||
record=Store(root/'app').create({'path':directory,'adapter':kind},{'serial':SERIAL},{'method':method},{'method':method,'openwrt_bytes':4<<30})
|
||||
a=self.adapter(kind);a.root=root;a.ctx=Context(Store(root/'app'),record,lambda *_:None)
|
||||
a.probe=Mock();a.backup=Mock();a.stage=Mock();a.update_e5=Mock()
|
||||
a.legacy=SimpleNamespace(**{n:Mock() for n in ('install_sd','install','part_two_stage','boot_openwrt','install_part','update')})
|
||||
flags=args_for(record,root)
|
||||
self.assertEqual(sum(bool(getattr(flags,n)) for n in ('tf','part','reinstall_part','data','boot_openwrt')),0 if method=='update' else 1)
|
||||
a.execute()
|
||||
if method=='update':
|
||||
(a.update_e5 if kind=='e5' else a.legacy.update).assert_called_once()
|
||||
elif kind=='mu300':a.legacy.install.assert_called_once()
|
||||
else:
|
||||
target={'tf':'install_sd','part':'install_part','reinstall':'part_two_stage','image':'install','boot':'boot_openwrt'}[method]
|
||||
getattr(a.legacy,target).assert_called_once()
|
||||
if method=='reinstall':self.assertEqual(a.legacy.part_two_stage.call_args.args[0],'reinstall')
|
||||
for name in ('install_sd','install','part_two_stage','boot_openwrt','install_part'):
|
||||
if name!=target:getattr(a.legacy,name).assert_not_called()
|
||||
|
||||
def test_mismatched_saved_mode_stops_before_probe_or_write(self):
|
||||
a=self.adapter();a.ctx=SimpleNamespace(record={'choices':{'method':'tf'},'plan':{'method':'reinstall'}})
|
||||
with self.assertRaises(RecoveryRequired):a.execute()
|
||||
a.bind.assert_not_called()
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -0,0 +1,113 @@
|
||||
"""Manual boot confirmation selects an SSH endpoint, never bypasses verification."""
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.service import Service,plan_install
|
||||
from backend.state import Context,Store
|
||||
from test_state import PACKAGE,DEVICE
|
||||
|
||||
|
||||
class OpenwrtConfirmation(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory()
|
||||
self.store=Store(self.temp.name)
|
||||
self.output=io.StringIO()
|
||||
self.service=Service('.',self.store,self.output)
|
||||
device={**DEVICE,'existing':True,'storage':{**DEVICE['storage'],'ROOT':'mmcblk0p20','ROOT_SIZE':(4<<30)//512}}
|
||||
self.record=self.store.create(PACKAGE,device,{'method':'reinstall','host':'192.0.2.1'},
|
||||
plan_install(PACKAGE,device,{'method':'reinstall'}))
|
||||
self.ctx=Context(self.store,self.record,self.service.emit)
|
||||
self.service.active=self.ctx
|
||||
self.service.worker=SimpleNamespace(is_alive=lambda:True)
|
||||
self.service.openwrt_wait_stage(self.ctx)
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def confirm(self,**extra):
|
||||
return self.service.dispatch({'protocol':1,'command':'verify_openwrt',
|
||||
'params':{'transaction':self.record['id'],'host':'192.0.2.2','password':'private-root-secret',**extra}})
|
||||
|
||||
def test_confirmation_is_queued_and_does_not_complete_or_persist_password(self):
|
||||
self.assertTrue(self.confirm()['accepted'])
|
||||
self.assertEqual(self.record['status'],'waiting_user')
|
||||
self.assertFalse(self.record.get('openwrt_confirmed'))
|
||||
self.assertNotIn('private-root-secret',(self.ctx.directory/'transaction.json').read_text())
|
||||
self.assertEqual(self.record['choices']['host'],'192.0.2.1')
|
||||
|
||||
def test_rejects_wrong_transaction_unsafe_stage_and_invalid_endpoint(self):
|
||||
for extra in ({'transaction':'b'*32},{'host':''},{'host':'127.0.0.1; reboot'},
|
||||
{'host':'https://router/'},{'password':123}):
|
||||
with self.subTest(extra=extra),self.assertRaises(ValueError):self.confirm(**extra)
|
||||
for stage,unsafe in [('transfer_install',False),('verify_capacity',False),('openwrt_boot',True)]:
|
||||
self.record.update(stage=stage,unsafe=unsafe)
|
||||
with self.assertRaises(ValueError):self.confirm()
|
||||
|
||||
def verify_after_retry(self,authentication=False,bad_capacity=False):
|
||||
import paramiko
|
||||
targets=[];reads=[];client=Mock()
|
||||
def connect(host,**options):
|
||||
targets.append((host,options['password']))
|
||||
if authentication and options['password']!='private-root-secret':
|
||||
raise paramiko.AuthenticationException('denied')
|
||||
client.connect.side_effect=connect
|
||||
raw=bytearray(1024);raw[56:58]=b'\x53\xef'
|
||||
struct.pack_into('<I',raw,24,2)
|
||||
expected=self.record['plan']['openwrt_bytes']
|
||||
struct.pack_into('<I',raw,4,(expected//2 if bad_capacity else expected)//4096)
|
||||
def read(command,timeout=15):
|
||||
reads.append((targets[-1][0],command))
|
||||
if command=='cat /sys/class/block/mmcblk0/device/cid':
|
||||
value=DEVICE['cid'] if targets[-1][0]=='192.0.2.2' else '0'*32
|
||||
elif command.startswith('readlink -f'):value='/dev/mmcblk0p20'
|
||||
elif command.startswith('dd if='):value=bytes(raw)
|
||||
elif command.startswith('test -s /etc/openwrt_release'):value=''
|
||||
else:raise AssertionError(command)
|
||||
return None,SimpleNamespace(read=lambda:value if isinstance(value,bytes) else value.encode(),
|
||||
channel=SimpleNamespace(recv_exit_status=lambda:0)),None
|
||||
client.exec_command.side_effect=read
|
||||
def user_action(_seconds):
|
||||
if not self.service.verification_wake.is_set():self.confirm()
|
||||
return False
|
||||
adapter=SimpleNamespace(password='')
|
||||
with patch('paramiko.SSHClient',return_value=client),patch.object(self.service.stop,'wait',side_effect=user_action):
|
||||
if bad_capacity:
|
||||
with self.assertRaisesRegex(ValueError,'capacity'):self.service.wait_openwrt(self.ctx,adapter)
|
||||
else:self.service.wait_openwrt(self.ctx,adapter)
|
||||
self.assertEqual([host for host,_ in targets],['192.0.2.1','192.0.2.2'])
|
||||
self.assertTrue(all(host=='192.0.2.2' for host,cmd in reads if cmd.startswith('dd if=')))
|
||||
self.assertEqual(self.record['choices']['host'],'192.0.2.2')
|
||||
self.assertTrue(self.record['openwrt_confirmed'])
|
||||
self.assertNotIn('private-root-secret',self.output.getvalue())
|
||||
self.assertNotIn('private-root-secret',(self.ctx.directory/'transaction.json').read_text())
|
||||
return [json.loads(line) for line in self.output.getvalue().splitlines()]
|
||||
|
||||
def test_multiple_openwrt_devices_allow_retargeting_without_accepting_wrong_identity(self):
|
||||
events=self.verify_after_retry()
|
||||
self.assertTrue(any('another device' in str(e['data'].get('details',{})) for e in events))
|
||||
self.assertEqual(self.record['status'],'completed')
|
||||
self.assertEqual(self.record['result']['url'],'http://192.0.2.2')
|
||||
# Confirmation and endpoint survive restart; credentials do not.
|
||||
ctx=Context(self.store,self.store.load(self.record['id']),lambda *_:None)
|
||||
self.service.openwrt_wait_stage(ctx)
|
||||
self.assertFalse(ctx.record['details']['reboot_manually'])
|
||||
self.assertEqual(ctx.record['details']['host'],'192.0.2.2')
|
||||
|
||||
def test_authentication_failure_can_be_corrected_while_waiting(self):
|
||||
events=self.verify_after_retry(authentication=True)
|
||||
self.assertTrue(any('authentication failed' in str(e['data'].get('details',{})) for e in events))
|
||||
self.assertEqual(self.record['status'],'completed')
|
||||
|
||||
def test_manual_confirmation_cannot_bypass_final_capacity_check(self):
|
||||
self.verify_after_retry(bad_capacity=True)
|
||||
self.assertNotEqual(self.record['status'],'completed')
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -113,7 +113,7 @@ class Recovery(unittest.TestCase):
|
||||
def test_two_stage_boot_chain_checkpoints_are_distinct(self):
|
||||
source=self.ctx.directory/'package'
|
||||
source.mkdir(parents=True)
|
||||
(source/'OpenWrt-Installer.py').write_text('GUI=None\n')
|
||||
(source/'OpenWrt-Installer.py').write_text('GUI=None\ndef adb(*args, **kwargs):pass\n')
|
||||
adapter=Adapter({**PACKAGE,'path':str(source)},self.ctx)
|
||||
legacy=self.ctx.directory/'legacy.json'
|
||||
self.record['legacy']=str(legacy)
|
||||
@@ -127,7 +127,7 @@ class Recovery(unittest.TestCase):
|
||||
|
||||
def test_backend_cannot_escalate_confirmed_gap_plan_to_android_reset(self):
|
||||
source=self.ctx.directory/'package';source.mkdir(parents=True)
|
||||
(source/'OpenWrt-Installer.py').write_text('GUI=None\n')
|
||||
(source/'OpenWrt-Installer.py').write_text('GUI=None\ndef adb(*args, **kwargs):pass\n')
|
||||
adapter=Adapter({**PACKAGE,'path':str(source)},self.ctx)
|
||||
self.record['plan'].update(target='GPT unallocated space',wipe=False,gap_start=90000000)
|
||||
with self.assertRaisesRegex(ValueError,'confirmed plan'):
|
||||
|
||||
@@ -120,6 +120,32 @@ class StateTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, 'Select'):
|
||||
service.dispatch({'protocol':1,'command':'probe','params':{}})
|
||||
|
||||
def test_device_refresh_without_verified_package(self):
|
||||
service = Service('.', self.store, io.StringIO())
|
||||
with patch('backend.service.Adb') as factory:
|
||||
factory.return_value.devices.side_effect = [[], [], [{'serial':'chosen','state':'unauthorized'}]]
|
||||
for expected in [[], [], [{'serial':'chosen','state':'unauthorized'}]]:
|
||||
self.assertEqual(service.dispatch({'protocol':1,'command':'devices','params':{}}), expected)
|
||||
self.assertIsNone(service.package)
|
||||
factory.return_value.shell.assert_not_called()
|
||||
with self.assertRaisesRegex(ValueError, 'Verify a package first'):
|
||||
service.dispatch({'protocol':1,'command':'probe','params':{'serial':'chosen'}})
|
||||
|
||||
def test_adb_empty_list_is_not_failure(self):
|
||||
with patch('backend.transport.shutil.which',return_value='adb'):
|
||||
transport = Adb('.')
|
||||
with patch.object(transport, 'call', return_value='List of devices attached\n\n') as call:
|
||||
self.assertEqual(transport.devices(), [])
|
||||
call.assert_called_once_with('devices','-l')
|
||||
|
||||
def test_adb_list_preserves_all_device_states(self):
|
||||
with patch('backend.transport.shutil.which',return_value='adb'):
|
||||
transport = Adb('.')
|
||||
listing = 'List of devices attached\nchosen device product:test model:E5 transport_id:1\nother unauthorized transport_id:2\nwaiting offline transport_id:3\n'
|
||||
with patch.object(transport, 'call', return_value=listing):
|
||||
values = transport.devices()
|
||||
self.assertEqual([(d['serial'], d['state']) for d in values], [('chosen','device'),('other','unauthorized'),('waiting','offline')])
|
||||
|
||||
def test_expected_reboot_waits_without_failure_or_deadline(self):
|
||||
service = Service('.', self.store, io.StringIO())
|
||||
states = iter(['android_boot', 'debug_authorization', 'android_setup', 'magisk', 'root_permission', 'ready'])
|
||||
@@ -128,9 +154,9 @@ class StateTests(unittest.TestCase):
|
||||
return {**DEVICE, 'readiness':next(states)}
|
||||
with patch.object(service.stop, 'wait', return_value=False):
|
||||
service.wait_android(self.ctx, Adapter())
|
||||
stages = [event[1]['stage'] for event in self.events]
|
||||
stages = [event[1]['stage'] for event in self.events if event[0]=='transaction']
|
||||
self.assertEqual(stages, ['android_boot', 'debug_authorization', 'android_setup', 'magisk', 'root_permission', 'root_ready'])
|
||||
self.assertNotIn('failed',[event[1]['status'] for event in self.events])
|
||||
self.assertNotIn('failed',[event[1]['status'] for event in self.events if event[0]=='transaction'])
|
||||
|
||||
def test_wrong_device_after_reset_is_rejected(self):
|
||||
service = Service('.', self.store, io.StringIO())
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
"""Byte progress/checksum/retry tests using in-memory Android staging files."""
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.state import Cancelled, Context, Store
|
||||
from backend.transport import push_chunks
|
||||
|
||||
|
||||
class Transfer(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory()
|
||||
self.source=Path(self.temp.name)/'payload.bin'
|
||||
self.source.write_bytes(bytes(range(256))*32768+b'last chunk')
|
||||
store=Store(Path(self.temp.name)/'app')
|
||||
self.record=store.create({}, {}, {}, {})
|
||||
self.events=[]
|
||||
self.ctx=Context(store,self.record,lambda kind,data:self.events.append((kind,data)))
|
||||
self.files={};self.pushes=0;self.corrupt=False;self.disconnect_at=None
|
||||
self.remote="/data/local/tmp/fixture payload's.bin"
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def call(self,command,local,remote):
|
||||
self.assertEqual(command,'push')
|
||||
self.pushes+=1
|
||||
self.files[remote]=Path(local).read_bytes()
|
||||
if self.corrupt:self.files[remote]=b'corrupted'
|
||||
if self.pushes==self.disconnect_at:raise ConnectionError('USB disconnected')
|
||||
|
||||
def shell(self,command):
|
||||
parts=shlex.split(command)
|
||||
if parts[:2]==['rm','-f']:
|
||||
self.files.pop(parts[2],None);return ''
|
||||
if parts[0]=='sha256sum':
|
||||
return hashlib.sha256(self.files[parts[1]]).hexdigest()+' file'
|
||||
if parts[0]=='cat' and parts[2]=='>>':
|
||||
self.files[parts[3]]=self.files.get(parts[3],b'')+self.files.pop(parts[1]);return ''
|
||||
self.fail('Unexpected simulated staging command: '+command)
|
||||
|
||||
def transfer(self):return push_chunks(self.call,self.shell,self.source,self.remote,self.ctx)
|
||||
|
||||
def test_progress_counts_only_verified_appended_bytes(self):
|
||||
self.transfer()
|
||||
self.assertEqual(self.files[self.remote],self.source.read_bytes())
|
||||
events=[data for kind,data in self.events if kind=='transfer']
|
||||
self.assertEqual([data['bytes'] for data in events],[8<<20,self.source.stat().st_size])
|
||||
self.assertTrue(all(data['total']==self.source.stat().st_size and data['bytes_per_second']>0 for data in events))
|
||||
|
||||
def test_corrupt_chunk_stops_before_append_or_progress(self):
|
||||
self.corrupt=True
|
||||
with self.assertRaisesRegex(ValueError,'checksum'):self.transfer()
|
||||
self.assertNotIn(self.remote,self.files)
|
||||
self.assertFalse(self.events)
|
||||
|
||||
def test_disconnect_retry_replaces_partial_upload(self):
|
||||
self.disconnect_at=2
|
||||
with self.assertRaises(ConnectionError):self.transfer()
|
||||
self.assertEqual(len(self.files[self.remote]),8<<20)
|
||||
self.disconnect_at=None
|
||||
self.transfer()
|
||||
self.assertEqual(self.files[self.remote],self.source.read_bytes())
|
||||
|
||||
def test_pause_stops_between_verified_chunks(self):
|
||||
def emit(kind,data):
|
||||
self.events.append((kind,data));self.ctx.cancel=True
|
||||
self.ctx.emit=emit
|
||||
with self.assertRaises(Cancelled):self.transfer()
|
||||
self.assertEqual(self.pushes,1)
|
||||
self.assertEqual(len(self.files[self.remote]),8<<20)
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -0,0 +1,166 @@
|
||||
"""An update is complete only after a new boot, not a pre-reboot SSH response."""
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import Mock,patch
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
from backend.adapter import Adapter,installation_committed
|
||||
from backend.service import Service,plan_install
|
||||
from backend.state import Context,Store
|
||||
from test_state import PACKAGE,DEVICE
|
||||
|
||||
OLD='11111111-1111-4111-8111-111111111111'
|
||||
NEW='22222222-2222-4222-8222-222222222222'
|
||||
|
||||
|
||||
class UpdateLifecycle(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp=tempfile.TemporaryDirectory()
|
||||
self.store=Store(self.temp.name)
|
||||
self.output=io.StringIO()
|
||||
self.service=Service('.',self.store,self.output)
|
||||
device={**DEVICE,'capacity':4<<30}
|
||||
self.record=self.store.create(PACKAGE,device,{'method':'update','host':'192.0.2.1'},
|
||||
plan_install(PACKAGE,device,{'method':'update','host':'192.0.2.1'}))
|
||||
self.ctx=Context(self.store,self.record,self.service.emit)
|
||||
|
||||
def tearDown(self):self.temp.cleanup()
|
||||
|
||||
def test_capture_actual_boot_identity_before_update_uploads(self):
|
||||
adapter=Adapter.__new__(Adapter);adapter.ctx=self.ctx
|
||||
adapter.expected_ssh_key=hashlib.sha256(b'key').hexdigest()
|
||||
client=Mock()
|
||||
client.get_transport.return_value.get_remote_server_key.return_value.asbytes.return_value=b'key'
|
||||
client.exec_command.return_value=(None,SimpleNamespace(read=lambda:OLD.encode(),channel=SimpleNamespace(recv_exit_status=lambda:0)),None)
|
||||
adapter.validate_ssh(client)
|
||||
self.assertEqual(self.store.load(self.record['id'])['update_boot_id'],OLD)
|
||||
self.assertEqual(self.record['stage'],'transfer_install')
|
||||
self.assertFalse(self.record['effects'])
|
||||
client.exec_command.return_value=(None,SimpleNamespace(read=lambda:b'',channel=SimpleNamespace(recv_exit_status=lambda:0)),None)
|
||||
with self.assertRaisesRegex(ValueError,'boot identity'):adapter.validate_ssh(client)
|
||||
|
||||
def test_committed_update_announces_reboot_and_is_not_replayed(self):
|
||||
adapter=Adapter.__new__(Adapter);adapter.ctx=self.ctx
|
||||
operation=Mock(return_value='verified')
|
||||
self.assertEqual(adapter.action('update-commit',operation),'verified')
|
||||
self.assertEqual(self.record['stage'],'openwrt_boot')
|
||||
self.assertEqual(self.record['status'],'waiting_device')
|
||||
self.assertFalse(self.record['details']['reboot_manually'])
|
||||
self.assertTrue(installation_committed(self.record))
|
||||
self.assertEqual(adapter.action('update-commit',operation),'verified')
|
||||
operation.assert_called_once()
|
||||
|
||||
def run_final_check(self,boot_ids,confirmed=False,missing=False,connection_errors=(),read_disconnect=False):
|
||||
self.record.update(stage='prepare',effects={'update-commit':{'state':'done'}})
|
||||
if not missing:self.record['update_boot_id']=OLD
|
||||
if confirmed:self.record['openwrt_confirmed']=True
|
||||
self.store.save(self.record)
|
||||
# A new app process reloads the committed transaction, preserving the
|
||||
# pre-update boot proof even if the final wait checkpoint was not saved.
|
||||
record=Store(self.temp.name).load(self.record['id'])
|
||||
context=Context(self.store,record,self.service.emit)
|
||||
values=iter(boot_ids);observed=[];root_reads=[];read_losses=[]
|
||||
raw=bytearray(1024);raw[56:58]=b'\x53\xef'
|
||||
struct.pack_into('<I',raw,24,2);struct.pack_into('<I',raw,4,(4<<30)//4096)
|
||||
def read(command,timeout=15):
|
||||
if command=='cat /sys/class/block/mmcblk0/device/cid':value=DEVICE['cid']
|
||||
elif command=='cat /proc/sys/kernel/random/boot_id':
|
||||
if read_disconnect and not read_losses:
|
||||
read_losses.append(True)
|
||||
if read_disconnect == 'exit-status':
|
||||
return None,SimpleNamespace(read=lambda:b'',channel=SimpleNamespace(recv_exit_status=lambda:-1)),None
|
||||
raise EOFError('SSH closed during reboot')
|
||||
value=next(values);observed.append(value)
|
||||
elif command.startswith('readlink -f') or command=='cat /run/mu300/disk-dev':
|
||||
root_reads.append(observed[-1]);value='/dev/mmcblk0p20'
|
||||
elif command.startswith('dd if='):value=bytes(raw)
|
||||
elif command.startswith('test -s /etc/openwrt_release'):value=''
|
||||
else:raise AssertionError(command)
|
||||
return None,SimpleNamespace(read=lambda:value if isinstance(value,bytes) else value.encode(),channel=SimpleNamespace(recv_exit_status=lambda:0)),None
|
||||
client=Mock();client.exec_command.side_effect=read
|
||||
if connection_errors:client.connect.side_effect=[*connection_errors,None]
|
||||
adapter=SimpleNamespace(password='',probe=Mock(side_effect=AssertionError('Unexpected Android probe')),
|
||||
execute=Mock(side_effect=AssertionError('Update replayed')))
|
||||
with patch('paramiko.SSHClient',return_value=client),patch.object(self.service.stop,'wait',return_value=False):
|
||||
self.service.run(context,adapter)
|
||||
adapter.execute.assert_not_called();adapter.probe.assert_not_called()
|
||||
return record,observed,root_reads
|
||||
|
||||
def test_old_runtime_responding_before_reboot_cannot_complete_update(self):
|
||||
record,observed,reads=self.run_final_check([OLD,OLD,NEW])
|
||||
self.assertEqual(observed,[OLD,OLD,NEW]);self.assertEqual(reads,[NEW])
|
||||
self.assertEqual(record['status'],'completed')
|
||||
events=[json.loads(line) for line in self.output.getvalue().splitlines()]
|
||||
states=[e['data']['stage'] for e in events if e['type']=='transaction']
|
||||
self.assertGreaterEqual(states.count('openwrt_boot'),3)
|
||||
self.assertEqual(states[-2:],['verify_capacity','complete'])
|
||||
|
||||
def test_manual_boot_confirmation_still_requires_actual_new_boot(self):
|
||||
record,observed,reads=self.run_final_check([OLD,NEW],confirmed=True)
|
||||
self.assertEqual(observed,[OLD,NEW]);self.assertEqual(reads,[NEW])
|
||||
self.assertEqual(record['status'],'completed')
|
||||
|
||||
def test_update_disconnects_are_normal_waits_until_reconnected(self):
|
||||
import paramiko
|
||||
for kind in ('e5','mu300'):
|
||||
with self.subTest(adapter=kind):
|
||||
self.record['package']={**PACKAGE,'adapter':kind}
|
||||
self.output.seek(0);self.output.truncate(0)
|
||||
errors=[ConnectionRefusedError('restarting'),TimeoutError('restarting'),
|
||||
OSError('USB network absent'),EOFError('restarting'),paramiko.SSHException('banner interrupted')]
|
||||
record,observed,reads=self.run_final_check([NEW],connection_errors=errors)
|
||||
self.assertEqual(record['status'],'completed')
|
||||
self.assertEqual(observed,[NEW]);self.assertEqual(reads,[NEW])
|
||||
events=[json.loads(line) for line in self.output.getvalue().splitlines()]
|
||||
reconnects=[e['data'] for e in events if e['type']=='transaction' and e['data'].get('details',{}).get('connection_state')=='reconnecting']
|
||||
self.assertEqual(len(reconnects),len(errors))
|
||||
self.assertTrue(all(r['status']=='waiting_device' and not r['details'].get('verification_error') and not r.get('error') for r in reconnects))
|
||||
self.assertEqual(sum(e['type']=='log' and e['data'].get('scope')=='reconnect' for e in events),len(errors))
|
||||
|
||||
def test_disconnect_during_remote_read_is_normal_wait(self):
|
||||
record,_,reads=self.run_final_check([NEW],read_disconnect=True)
|
||||
self.assertEqual(record['status'],'completed');self.assertEqual(reads,[NEW])
|
||||
events=[json.loads(line) for line in self.output.getvalue().splitlines()]
|
||||
reconnects=[e['data'] for e in events if e['type']=='transaction' and e['data'].get('details',{}).get('connection_state')=='reconnecting']
|
||||
self.assertEqual(len(reconnects),1)
|
||||
self.assertEqual(reconnects[0]['status'],'waiting_device')
|
||||
self.assertIsNone(reconnects[0]['details']['verification_error'])
|
||||
|
||||
def test_ssh_close_without_exit_status_is_also_a_reconnection_wait(self):
|
||||
record,_,reads=self.run_final_check([NEW],read_disconnect='exit-status')
|
||||
self.assertEqual(record['status'],'completed');self.assertEqual(reads,[NEW])
|
||||
events=[json.loads(line) for line in self.output.getvalue().splitlines()]
|
||||
self.assertTrue(any(e['type']=='transaction' and e['data'].get('details',{}).get('connection_state')=='reconnecting'
|
||||
and not e['data']['details']['verification_error'] for e in events))
|
||||
|
||||
def test_missing_or_invalid_boot_proof_stops_before_capacity_reads(self):
|
||||
for missing in (False,True):
|
||||
with self.subTest(missing=missing):
|
||||
self.record.pop('update_boot_id',None)
|
||||
record,_,reads=self.run_final_check(['invalid'],missing=missing)
|
||||
self.assertEqual(record['status'],'failed')
|
||||
self.assertFalse(reads)
|
||||
self.assertIn('boot',record['error']['message'])
|
||||
|
||||
def test_phase_clock_persists_freezes_and_restarts_on_retry(self):
|
||||
with patch('backend.state.time.time',return_value=100):self.ctx.stage('backup')
|
||||
with patch('backend.state.time.time',return_value=105):self.ctx.stage('backup','waiting_device')
|
||||
self.assertEqual(self.record['stage_started_at'],100)
|
||||
with patch('backend.state.time.time',return_value=108):self.ctx.stage('backup','failed')
|
||||
saved=self.store.load(self.record['id'])
|
||||
self.assertEqual(saved['stage_finished_at']-saved['stage_started_at'],8)
|
||||
with patch('backend.state.time.time',return_value=200):self.ctx.stage('backup')
|
||||
self.assertEqual(self.record['stage_started_at'],200)
|
||||
self.assertNotIn('stage_finished_at',self.record)
|
||||
with patch('backend.state.time.time',return_value=207):self.ctx.stage('complete','completed')
|
||||
self.assertEqual(self.record['stage_finished_at']-self.record['stage_started_at'],7)
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -10,7 +10,7 @@ BRIDGE=r"""
|
||||
const device = {serial:'fixture-1234',model:'E5',system:'Android',slot:'_a',root:true,readiness:'ready',encrypted:true,profile:'e5'};
|
||||
const pkg = {path:'D:/OpenWrt-Package',name:'e5-openwrt-release',adapter:'e5',profile:'e5',kernel:'v2'};
|
||||
const tx = {id:'a'.repeat(32),status:'ready',stage:'plan',device,package:pkg,choices:{method:'part'},plan:{wipe:true,two_stage:true,offline:true,openwrt_bytes:10737418240,android_bytes:21474836480,target:'userdata shrink',grow:true},completed:[],unsafe:false,updated:Date.now()/1000};
|
||||
window.__fixture={tx,callbacks,records:[tx],fail:null,requests:[]};
|
||||
window.__fixture={tx,callbacks,records:[tx],fail:null,requests:[],calls:[],probed:{}};
|
||||
window.__TAURI_EVENT_PLUGIN_INTERNALS__={unregisterListener(){}};
|
||||
window.__TAURI_INTERNALS__={
|
||||
transformCallback(fn,once){const id=seq++;callbacks.set(id,fn);return id;},
|
||||
@@ -22,15 +22,19 @@ BRIDGE=r"""
|
||||
if(cmd==='plugin:event|unlisten')return;
|
||||
if(cmd==='backend_request'){
|
||||
window.__fixture.requests.push(args.command);
|
||||
window.__fixture.calls.push({command:args.command,params:args.params});
|
||||
if(window.__fixture.fail===args.command)throw new Error('Fixture: operation rejected');
|
||||
switch(args.command){
|
||||
case 'hello':return {package_path:pkg.path,transactions:window.__fixture.saved || []};
|
||||
case 'package':return pkg;
|
||||
case 'devices':return [{...device,label:'E5',state:'device'},{serial:'fixture-5678',label:'Other device',state:'unauthorized'}];
|
||||
case 'probe':return device;
|
||||
case 'plan':return tx;
|
||||
case 'devices':return window.__fixture.devices ?? [{...device,label:'E5',state:'device'},{serial:'fixture-5678',label:'Other device',state:'unauthorized'}];
|
||||
case 'probe':return {...device,...window.__fixture.probed,serial:args.params.serial};
|
||||
case 'plan':Object.assign(tx,{choices:{...args.params.choices},device:{...device,...window.__fixture.probed,serial:args.params.serial},plan:{...tx.plan,method:args.params.choices.method,wipe:args.params.choices.method==='part',two_stage:args.params.choices.method==='part',offline:args.params.choices.method==='part',target:args.params.choices.method==='reinstall'?'mmcblk1p20':'userdata shrink'}});return {...tx};
|
||||
case 'list':return window.__fixture.records;
|
||||
case 'start':tx.stage='android_setup';tx.status='waiting_user';return {...tx};
|
||||
case 'start':if(window.__fixture.startRace){const older={...tx,stage:'android_setup',status:'waiting_user',revision:1};window.__emitFixture({stage:'complete',status:'completed',revision:2,result:{filesystem_bytes:10737418240,url:'http://192.168.9.1'}});return older;}tx.stage='android_setup';tx.status='waiting_user';return {...tx};
|
||||
case 'cancel':return {accepted:window.__fixture.cancelAccepted ?? true,deferred:false};
|
||||
case 'verify_openwrt':return {accepted:true};
|
||||
case 'diagnostics':return {text:'DEBUG fixture diagnostics: commands, traceback and verified bytes (redacted)'};
|
||||
default:return null;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +127,8 @@ def main():
|
||||
assert page.locator('h1').bounding_box()==before
|
||||
assert page.locator('.records-list').evaluate('(el)=>el.scrollTop>0')
|
||||
page.evaluate('window.__logFixture()')
|
||||
page.get_by_role('button',name='详细日志',exact=False).click();settle(page);layout(page)
|
||||
if page.get_by_role('button',name='详细日志',exact=False).get_attribute('aria-expanded')=='false':page.get_by_role('button',name='详细日志',exact=False).click()
|
||||
settle(page);layout(page)
|
||||
assert page.locator('.records-list').evaluate('(el)=>el.clientHeight>=100')
|
||||
assert page.locator('.log-panel pre').evaluate('(el)=>el.scrollHeight>el.clientHeight')
|
||||
assert page.locator('.log-toggle span').inner_text()=='500'
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
"""Update reboot guidance and clocks that stop on terminal states."""
|
||||
import time
|
||||
from playwright.sync_api import sync_playwright
|
||||
from ui_smoke import BRIDGE,ROOT,layout,settle
|
||||
|
||||
|
||||
def main():
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch()
|
||||
context=browser.new_context(viewport={'width':800,'height':650})
|
||||
context.add_init_script(BRIDGE+"localStorage.setItem('onboarding-v1','seen');window.__fixture.tx.choices={method:'update'};Object.assign(window.__fixture.tx.plan,{method:'update',wipe:false,two_stage:false,offline:false});")
|
||||
page=context.new_page();errors=[]
|
||||
page.on('pageerror',lambda error:errors.append(str(error)))
|
||||
page.goto('http://127.0.0.1:1420')
|
||||
page.get_by_role('button',name='继续未完成的安装',exact=False).click();settle(page)
|
||||
page.get_by_role('button',name='确认安装计划',exact=True).click();settle(page)
|
||||
assert '自动重启以应用更新' in page.locator('.page-scroll').inner_text()
|
||||
page.get_by_role('checkbox').check()
|
||||
page.get_by_role('button',name='确认并开始').click();settle(page)
|
||||
now=time.time()
|
||||
def event(**change):page.evaluate('change=>window.__emitFixture(change)',change)
|
||||
event(stage='openwrt_boot',status='waiting_device',revision=10,stage_started_at=now-3,
|
||||
details={'host':'192.168.9.1','reboot_manually':False})
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='更新已提交,设备将自动重启'
|
||||
assert '自动重启以应用更新' in page.locator('.boot-guidance').inner_text()
|
||||
assert page.locator('[data-sonner-toast]').filter(has_text='自动重启以应用更新').count()>=1
|
||||
before=page.locator('.elapsed').inner_text()
|
||||
page.wait_for_timeout(1300)
|
||||
assert page.locator('.elapsed').inner_text()!=before
|
||||
page.screenshot(path=str(ROOT/'screenshots/update-reboot-zh.png'))
|
||||
event(stage='openwrt_boot',status='waiting_device',revision=11,
|
||||
details={'host':'192.168.9.1','reboot_manually':False,'connection_state':'reconnecting','verification_error':None})
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='设备正在重启,等待重新连接'
|
||||
assert page.locator('.verification-error').count()==0
|
||||
assert page.locator('[data-sonner-toast][data-type=warning],[data-sonner-toast][data-type=error]').count()==0
|
||||
for revision in range(12,18):event(revision=revision)
|
||||
settle(page)
|
||||
assert page.locator('[data-sonner-toast][data-type=info]').filter(has_text='设备正在重启,等待重新连接').count()==1
|
||||
page.screenshot(path=str(ROOT/'screenshots/update-reconnecting-zh.png'))
|
||||
page.get_by_label('语言').select_option('en');settle(page)
|
||||
assert page.locator('h1').inner_text()=='Device restarting; waiting to reconnect'
|
||||
page.get_by_label('Language').select_option('zh');settle(page)
|
||||
for index,status in enumerate(('completed','failed','cancelled')):
|
||||
event(stage='complete' if status=='completed' else 'verify_capacity',status=status,revision=20+index,
|
||||
stage_started_at=now-9,stage_finished_at=now-1,updated=now-1,
|
||||
result={'filesystem_bytes':10737418240,'url':'http://192.168.9.1'})
|
||||
settle(page)
|
||||
assert page.locator('.elapsed').inner_text()=='阶段用时 8s'
|
||||
page.wait_for_timeout(1300)
|
||||
assert page.locator('.elapsed').inner_text()=='阶段用时 8s'
|
||||
event(stage='complete',status='completed',revision=23)
|
||||
page.get_by_label('语言').select_option('en');page.get_by_label('Theme').select_option('dark')
|
||||
settle(page);layout(page)
|
||||
assert page.locator('h1').inner_text()=='OpenWrt updated and verified'
|
||||
assert 'device restarted' in page.locator('.success-panel').inner_text()
|
||||
assert page.locator('.elapsed').inner_text()=='Stage elapsed 8s'
|
||||
page.screenshot(path=str(ROOT/'screenshots/update-complete-clock-en.png'))
|
||||
assert not errors,errors
|
||||
browser.close()
|
||||
print('Update smoke passed: plan/reboot guidance, reconnects stay neutral without error/warning toasts, repeated waits deduplicated, active clock advances, terminal clocks freeze, bilingual update result at 800x650')
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -6,7 +6,7 @@ use std::{collections::HashMap, io::{BufRead, BufReader, Write}, path::PathBuf,
|
||||
use tauri::{Emitter, Manager, State};
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
const COMMANDS: &[&str] = &["hello","snapshot","list","package","devices","probe","probe_update","plan","start","resume","retry","cancel","can_close","export","import"];
|
||||
const COMMANDS: &[&str] = &["hello","snapshot","list","package","devices","probe","probe_update","plan","start","resume","retry","cancel","can_close","export","import","diagnostics","verify_openwrt"];
|
||||
struct Bridge {
|
||||
input: Mutex<Option<ChildStdin>>,
|
||||
pending: Mutex<HashMap<u64, oneshot::Sender<Result<Value, String>>>>,
|
||||
@@ -25,7 +25,10 @@ async fn backend_request(state: State<'_, Arc<Bridge>>, command: String, params:
|
||||
let line = json!({"protocol":1,"id":id,"command":command,"params":params}).to_string()+"\n";
|
||||
let written = {
|
||||
let mut input = state.input.lock().unwrap();
|
||||
input.as_mut().ok_or("Backend is unavailable")?.write_all(line.as_bytes()).map_err(|e|e.to_string())
|
||||
match input.as_mut() {
|
||||
Some(stream) => stream.write_all(line.as_bytes()).map_err(|e|e.to_string()),
|
||||
None => Err("Backend is unavailable".to_string()),
|
||||
}
|
||||
};
|
||||
if let Err(error) = written {state.pending.lock().unwrap().remove(&id); return Err(error);}
|
||||
// Verification and large archives can take minutes. No artificial device wait deadline.
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
export const strings = {
|
||||
zh: {
|
||||
copyDiagnostics:'复制诊断信息给开发者', phase:'阶段', stageProgress:'当前阶段进度', noPercentage:'此操作没有可靠百分比,正在显示真实阶段与耗时。',
|
||||
installMethod:'安装方式',
|
||||
noDevicesShort:'未发现设备', inspectNeedsPackage:'可以先刷新并选择设备;检查设备和安装前仍需校验安装包。',
|
||||
copied:'日志已复制', exportedLog:'日志已导出', exportedBackup:'事务与备份已导出', imported:'恢复记录已导入', openedData:'事务目录已打开', inspected:'设备检查完成', refreshed:'设备列表已刷新', noDevices:'未发现设备,请连接 USB 并开启调试。', multipleDevices:'检测到多台设备,请明确选择本次操作的设备。', pauseRequested:'已请求暂停,将在安全边界生效。', dismiss:'关闭提示', notifications:'操作通知', deviceStates:{device:'已连接',unauthorized:'等待调试授权',offline:'离线'},
|
||||
title:'OpenWrt 安装器', subtitle:'安装、更新与恢复', home:'开始', package:'安装包', choosePackage:'选择安装包目录', verify:'校验安装包', verified:'校验通过',
|
||||
device:'设备', refresh:'刷新设备', select:'请选择设备', connect:'通过 USB 连接设备,开启调试并允许电脑访问。', inspect:'检查设备',
|
||||
@@ -11,14 +14,21 @@ export const strings = {
|
||||
plan:'查看安装计划', review:'确认安装计划', target:'写入目标', android:'Android 保留空间', allocation:'OpenWrt 分配空间', impact:'数据影响',
|
||||
wipe:'Android 应用、账号、照片和内部存储将全部清空。请先备份个人数据。', preserve:'保留 Android 用户数据。', tfErase:'会格式化所选 TF 目标,卡上该分区的数据会被替换。不会重新划分 TF 卡。',
|
||||
reinstallErase:'已有 OpenWrt 系统与设置会被替换,Android 用户数据保留。', imageImpact:'创建镜像,保留原有镜像备份。需额外安装临时空间。',
|
||||
updateImpact:'保留设置、分区容量和本机固件;上传通过 SSH,设备端互斥锁保护提交。', bootImpact:'临时试启动;不挂载、不写入 OpenWrt 根分区。失败时由原启动策略回退。',
|
||||
updateImpact:'保留设置、分区容量和本机固件;上传通过 SSH,设备端互斥锁保护提交。提交后设备会自动重启以应用更新,网络会暂时断开。', bootImpact:'临时试启动;不挂载、不写入 OpenWrt 根分区。失败时由原启动策略回退。',
|
||||
updateReboot:'更新已提交,设备将自动重启', updateReconnecting:'设备正在重启,等待重新连接', updateRebootDesc:'设备将自动重启以应用更新,期间网络会暂时断开。请保持供电并等待,安装器将在确认设备重启、重新连接并校验实际容量后显示完成。',
|
||||
updateNext:'设备已重启,更新已通过校验。请打开管理地址检查服务;原设置、容量和本机固件保留,事务记录仍保存在电脑上。',
|
||||
firstBoot:'首次启动会进行离线分区准备,可能需要数分钟,完成后设备会自动重启一次。',
|
||||
accept:'我已核对设备、写入目标和数据影响,并已备份需要保留的文件。', start:'确认并开始', back:'返回', progress:'安装进度',
|
||||
steps:['检查与计划','准备与备份','设备重启与授权','安装与校验','完成'],
|
||||
running:'正在执行', waiting_user:'等待用户操作', waiting_device:'等待设备重连', failed:'操作失败', completed:'已完成', cancelled:'已暂停', readyStatus:'等待确认',
|
||||
stages:{plan:'安装计划已就绪',prepare:'准备安装',backup:'备份 GPT、misc 与启动链',android_boot:'等待 Android 开机',android_setup:'请完成 Android 初始设置',usb_debugging:'请启用 USB 调试',debug_authorization:'请在设备上允许调试',magisk:'请安装或恢复 Magisk',root_permission:'请允许 root 请求',root_ready:'root 已就绪,继续安装',recheck:'复核分区与事务状态',transfer_install:'传输及安装系统',verify_capacity:'扩容与最终容量校验',openwrt_boot:'等待启动 OpenWrt',complete:'安装完成'},
|
||||
stages:{firmware_extract:'提取本机固件',firmware_convert:'转换本机音频与蓝牙固件',plan:'安装计划已就绪',prepare:'准备安装',backup:'备份 GPT、misc 与启动链',android_boot:'等待 Android 开机',android_setup:'请完成 Android 初始设置',usb_debugging:'请启用 USB 调试',debug_authorization:'请在设备上允许调试',magisk:'请安装或恢复 Magisk',root_permission:'请允许 root 请求',root_ready:'root 已就绪,继续安装',recheck:'复核分区与事务状态',transfer_install:'传输及安装系统',verify_capacity:'扩容与最终容量校验',openwrt_boot:'等待启动 OpenWrt',complete:'安装完成'},
|
||||
waitingAndroid:'保持设备供电。进入 Android 后完成初始设置、开启开发者选项及 USB 调试,并允许此电脑调试。若 root 仍可用,会直接继续;否则恢复 Magisk 并允许 root 请求。这里没有等待时限。',
|
||||
waitingOpenwrt:'需要时请手动重启设备。连接设备的 USB 网络或热点后继续验证;安装器不会修改电脑网卡、路由或自动连接热点。请保持此窗口,或暂停后从记录继续。',
|
||||
rebootNow:'请现在手动重启设备', rebootManual:'设备端安装操作已结束。请使用设备的正常重启功能进入 OpenWrt;已开始重启或已进入 OpenWrt 时,无需重复重启。',
|
||||
rebootAutomatic:'已发送自动重启请求,请等待设备开机。若设备仍停留在原系统且未开始重启,请使用设备的正常重启功能。',
|
||||
waitingOpenwrt:'进入 OpenWrt 后,请将电脑连接到设备的 USB 网络或热点,安装器会自动通过 SSH 校验。同一设备的身份与实际容量校验通过后才会完成。请保持此窗口,或暂停后从记录继续。',
|
||||
newestFirst:'最新记录在上',
|
||||
confirmOpenwrt:'我已进入 OpenWrt,开始校验', verificationRequested:'已请求校验,将核对设备身份与实际容量',
|
||||
bootConfirmed:'已确认进入 OpenWrt。请核对这台设备的管理地址与 SSH root 密码,并将电脑连接到它的网络。',
|
||||
pause:'在安全边界暂停', unsafe:'正在写入,请保持供电。暂停将在当前操作完成后生效。', closeBlocked:'任务仍在执行。请先在安全边界暂停,再关闭窗口。',
|
||||
logs:'详细日志', copy:'复制', exportLog:'导出日志', exportBackup:'导出事务与备份', openData:'打开事务目录', import:'导入恢复目录',
|
||||
noRecords:'没有可恢复的事务。若电脑记录丢失,请导入完整备份目录;设备标记不足以证明安装计划时,安装器会停止。', continue:'继续安装', retry:'复核并重试',
|
||||
@@ -27,6 +37,9 @@ export const strings = {
|
||||
noBackend:'无法连接本地后端。请从完整解压后的安装包运行 OpenWrt-Installer.exe。', error:'操作未完成', elapsed:'阶段用时', bytes:'已传输', speed:'速度', packageHint:'请完整解压安装包;载荷校验通过后才能操作设备。',
|
||||
},
|
||||
en: {
|
||||
copyDiagnostics:'Copy diagnostics for the developer', phase:'Phase', stageProgress:'Current phase progress', noPercentage:'This operation has no reliable percentage. The phase and elapsed time are shown.',
|
||||
installMethod:'Installation method',
|
||||
noDevicesShort:'No devices found', inspectNeedsPackage:'You can refresh and select a device now. Verify the package before inspecting or installing.',
|
||||
copied:'Log copied', exportedLog:'Log exported', exportedBackup:'Transaction and backups exported', imported:'Recovery record imported', openedData:'Transaction folder opened', inspected:'Device inspection complete', refreshed:'Device list refreshed', noDevices:'No devices found. Connect USB and enable debugging.', multipleDevices:'Multiple devices found. Select the device for this operation.', pauseRequested:'Pause requested. It will take effect at a safe boundary.', dismiss:'Dismiss notification', notifications:'Operation notifications', deviceStates:{device:'Connected',unauthorized:'Awaiting debugging authorization',offline:'Offline'},
|
||||
title:'OpenWrt Installer',subtitle:'Install, update and recover',home:'Start',package:'Package',choosePackage:'Choose package folder',verify:'Verify package',verified:'Verified',
|
||||
device:'Device',refresh:'Refresh devices',select:'Select a device',connect:'Connect by USB, enable debugging and authorize this computer.',inspect:'Inspect device',
|
||||
@@ -38,13 +51,20 @@ export const strings = {
|
||||
plan:'Review installation plan',review:'Confirm installation plan',target:'Write target',android:'Android retained space',allocation:'OpenWrt allocation',impact:'Data impact',
|
||||
wipe:'All Android apps, accounts, photos and internal storage will be erased. Back up personal files first.',preserve:'Preserve Android user data.',tfErase:'Format the selected TF target and replace its data. The card is not repartitioned.',
|
||||
reinstallErase:'Replace the installed OpenWrt system and settings. Preserve Android user data.',imageImpact:'Create an image and retain the previous image as a backup. Temporary staging space is also required.',
|
||||
updateImpact:'Preserve settings, partition capacity and local firmware. Upload over SSH; a device upgrade lock protects commit.',bootImpact:'Trial boot only. Do not mount or write the OpenWrt root partition. Existing boot policy handles fallback.',
|
||||
updateImpact:'Preserve settings, partition capacity and local firmware. Upload over SSH; a device upgrade lock protects commit. The device automatically restarts to apply the update, briefly disconnecting its network.',bootImpact:'Trial boot only. Do not mount or write the OpenWrt root partition. Existing boot policy handles fallback.',
|
||||
updateReboot:'Update submitted; device restarting', updateReconnecting:'Device restarting; waiting to reconnect', updateRebootDesc:'The device will automatically restart to apply the update and its network will briefly disconnect. Keep power connected. Completion follows a confirmed restart, reconnection and actual-capacity verification.',
|
||||
updateNext:'The device restarted and the update passed verification. Open its management address to check services. Settings, capacity and local firmware are retained; the transaction remains on this computer.',
|
||||
firstBoot:'The first boot performs offline partition preparation. This may take several minutes; the device will reboot automatically once it finishes.',
|
||||
accept:'I checked the device, write target and data impact, and backed up the files I need.',start:'Confirm and start',back:'Back',progress:'Installation progress',steps:['Checks and plan','Prepare and back up','Restart and authorize','Install and verify','Complete'],
|
||||
running:'Running',waiting_user:'Waiting for you',waiting_device:'Waiting for device',failed:'Failed',completed:'Completed',cancelled:'Paused',readyStatus:'Awaiting confirmation',
|
||||
stages:{plan:'Installation plan ready',prepare:'Preparing installation',backup:'Backing up GPT, misc and boot chain',android_boot:'Waiting for Android to boot',android_setup:'Complete Android initial setup',usb_debugging:'Enable USB debugging',debug_authorization:'Allow debugging on the device',magisk:'Install or restore Magisk',root_permission:'Allow the root request',root_ready:'Root is ready; continuing installation',recheck:'Rechecking partitions and transaction',transfer_install:'Transferring and installing the system',verify_capacity:'Growing and verifying actual capacity',openwrt_boot:'Waiting for OpenWrt to start',complete:'Installation complete'},
|
||||
stages:{firmware_extract:'Extracting this device’s firmware',firmware_convert:'Converting device audio and Bluetooth firmware',plan:'Installation plan ready',prepare:'Preparing installation',backup:'Backing up GPT, misc and boot chain',android_boot:'Waiting for Android to boot',android_setup:'Complete Android initial setup',usb_debugging:'Enable USB debugging',debug_authorization:'Allow debugging on the device',magisk:'Install or restore Magisk',root_permission:'Allow the root request',root_ready:'Root is ready; continuing installation',recheck:'Rechecking partitions and transaction',transfer_install:'Transferring and installing the system',verify_capacity:'Growing and verifying actual capacity',openwrt_boot:'Waiting for OpenWrt to start',complete:'Installation complete'},
|
||||
waitingAndroid:'Keep power connected. Complete Android setup, enable developer options and USB debugging, then authorize this computer. Existing working root is accepted immediately; otherwise restore Magisk and grant root. There is no waiting deadline.',
|
||||
waitingOpenwrt:'Reboot the device manually if needed. Connect to its USB network or hotspot for verification. The installer does not change network adapters or routes, or connect to hotspots. Keep this window open, or pause and resume from the record.',
|
||||
rebootNow:'Restart the device now', rebootManual:'Device installation operations have finished. Use the device’s normal restart control to enter OpenWrt. If it is already restarting or running OpenWrt, do not restart it again.',
|
||||
rebootAutomatic:'An automatic restart was requested. Wait for the device to boot. If it stays in the previous system without restarting, use its normal restart control.',
|
||||
waitingOpenwrt:'Once OpenWrt starts, connect this computer to the device’s USB network or hotspot. The installer will verify its identity and actual capacity over SSH before completing. Keep this window open, or pause and resume from the record.',
|
||||
newestFirst:'Newest entries first',
|
||||
confirmOpenwrt:'OpenWrt is running — verify now', verificationRequested:'Verification requested; checking device identity and actual capacity',
|
||||
bootConfirmed:'OpenWrt boot confirmed. Check this device’s management address and SSH root password, and connect this computer to its network.',
|
||||
pause:'Pause at a safe boundary',unsafe:'A write is in progress. Keep power connected. Pause takes effect after the current operation finishes.',closeBlocked:'A task is still active. Pause at a safe boundary before closing the window.',
|
||||
logs:'Detailed log',copy:'Copy',exportLog:'Export log',exportBackup:'Export transaction and backups',openData:'Open transaction folder',import:'Import recovery folder',
|
||||
noRecords:'No saved transactions. If computer records were lost, import a full backup folder. Insufficient device evidence stops installation.',continue:'Continue installation',retry:'Recheck and retry',
|
||||
|
||||
@@ -30,12 +30,14 @@ function App() {
|
||||
const [pkg, setPkg] = useState<Package>();
|
||||
const [path, setPath] = useState('');
|
||||
const [devices, setDevices] = useState<Device[]>([]);
|
||||
const [devicesLoaded, setDevicesLoaded] = useState(false);
|
||||
const [serial, setSerial] = useState('');
|
||||
const [device, setDevice] = useState<Device>();
|
||||
const [records, setRecords] = useState<Transaction[]>([]);
|
||||
const [tx, setTx] = useState<Transaction>();
|
||||
const [transfer, setTransfer] = useState<Transfer>();
|
||||
const [method, setMethod] = useState('part');
|
||||
const [planOrigin, setPlanOrigin] = useState<View>('install');
|
||||
const [size, setSize] = useState('4');
|
||||
const [grow, setGrow] = useState(true);
|
||||
const [host, setHost] = useState('192.168.9.1');
|
||||
@@ -44,10 +46,12 @@ function App() {
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [logOpen, setLogOpen] = useState(false);
|
||||
const [elapsed, setElapsed] = useState(0);
|
||||
const [clock, setClock] = useState(Date.now());
|
||||
const [since, setSince] = useState(Date.now());
|
||||
const pending = useRef(0);
|
||||
const lastTransaction = useRef('');
|
||||
const verificationTransaction = useRef('');
|
||||
const revisions = useRef(new Map<string, number>());
|
||||
const pageRef = useRef<HTMLDivElement>(null);
|
||||
const reduceMotion = useReducedMotion();
|
||||
const append = useCallback((text: string) => setLogs(old => [...old.slice(-499), `${new Date().toLocaleTimeString()} ${text}`]), []);
|
||||
@@ -56,21 +60,34 @@ function App() {
|
||||
append(message);
|
||||
}, [append, t.error]);
|
||||
const acceptTransaction = useCallback((next: Transaction, announce = true) => {
|
||||
const key = `${next.id}:${next.stage}:${next.status}:${next.error?.message || ''}`;
|
||||
// Native events can arrive before the response to start/resume. Never let
|
||||
// that older response replace a newer persisted checkpoint on the screen.
|
||||
if (next.revision !== undefined) {
|
||||
if (next.revision < (revisions.current.get(next.id) ?? -1)) return;
|
||||
revisions.current.set(next.id, next.revision);
|
||||
}
|
||||
const key = `${next.id}:${next.stage}:${next.status}:${next.details?.tool || ''}:${next.details?.connection_state || ''}:${next.details?.verification_error || ''}:${next.error?.message || ''}`;
|
||||
if (key !== lastTransaction.current) {
|
||||
lastTransaction.current = key;
|
||||
setSince(Date.now()); setTransfer(undefined);
|
||||
const label = t.stages[next.stage as keyof typeof t.stages] || next.stage;
|
||||
if (!['completed','failed','cancelled'].includes(next.status)) setSince(Date.now());
|
||||
setTransfer(undefined);
|
||||
const label = next.stage === 'openwrt_boot' && next.choices.method === 'update' ? next.details?.connection_state === 'reconnecting' ? t.updateReconnecting : t.updateReboot : t.stages[next.stage as keyof typeof t.stages] || next.stage;
|
||||
append(label);
|
||||
if (announce) {
|
||||
const options = {id: 'installation-status', description: next.error?.message ||
|
||||
(next.stage === 'openwrt_boot' && next.status.startsWith('waiting') ? (next.details?.verification_error || (next.choices.method === 'update' ? t.updateRebootDesc : next.details?.boot_confirmed ? t.bootConfirmed : next.details?.reboot_manually !== false ? t.rebootManual : t.rebootAutomatic)) : '') ||
|
||||
(next.status === 'ready' ? t.readyStatus : (t as unknown as Record<string, string>)[next.status]), duration: next.status === 'failed' ? Infinity : 5000};
|
||||
if (next.status === 'failed') toast.error(label, options);
|
||||
else if (next.status === 'completed') toast.success(next.choices.method === 'boot' ? t.successBoot : next.choices.method === 'update' ? t.successUpdate : t.success, options);
|
||||
else if (next.details?.verification_error) toast.warning(label, options);
|
||||
else if (next.status.startsWith('waiting')) toast.info(label, options);
|
||||
else toast.message(label, options);
|
||||
}
|
||||
}
|
||||
if (next.stage === 'openwrt_boot' && verificationTransaction.current !== next.id) {
|
||||
verificationTransaction.current = next.id;
|
||||
setHost(next.details?.host || next.choices.host || (next.package.adapter === 'e5' ? '192.168.9.1' : next.device.profile === 'u30air' ? '192.168.78.1' : '192.168.77.1'));
|
||||
}
|
||||
setTx(next);
|
||||
}, [append, t]);
|
||||
const task = async <T,>(fn: () => Promise<T>, success?: string): Promise<T | undefined> => {
|
||||
@@ -95,10 +112,14 @@ function App() {
|
||||
}, [theme]);
|
||||
useEffect(() => {localStorage.setItem('language', lang); document.documentElement.lang = lang === 'zh' ? 'zh-CN' : 'en';}, [lang]);
|
||||
useEffect(() => {pageRef.current?.querySelector<HTMLElement>('h1')?.focus({preventScroll: true});}, [view]);
|
||||
const timingActive = tx && ['running','waiting_user','waiting_device'].includes(tx.status);
|
||||
const elapsed = tx ? Math.max(0,Math.floor(((tx.stage_finished_at ? tx.stage_finished_at*1000 : timingActive ? clock : tx.updated*1000) - (tx.stage_started_at ? tx.stage_started_at*1000 : since))/1000)) : 0;
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => setElapsed(Math.floor((Date.now() - since)/1000)), 1000);
|
||||
if (!timingActive) return;
|
||||
setClock(Date.now());
|
||||
const timer = setInterval(() => setClock(Date.now()), 1000);
|
||||
return () => clearInterval(timer);
|
||||
}, [since]);
|
||||
}, [timingActive, since]);
|
||||
useEffect(() => {
|
||||
let dispose: (() => void) | undefined;
|
||||
let cancelled = false;
|
||||
@@ -107,7 +128,11 @@ function App() {
|
||||
const next = event.data as Transaction;
|
||||
acceptTransaction(next);
|
||||
} else if (event.type === 'transfer') setTransfer(event.data as Transfer);
|
||||
else if (event.type === 'log') append((event.data as {message: string}).message);
|
||||
else if (event.type === 'activity') setTransfer(undefined);
|
||||
else if (event.type === 'log') {
|
||||
const entry = event.data as {message:string; level?:string; scope?:string};
|
||||
append(`[${(entry.level || 'debug').toUpperCase()}]${entry.scope ? ' ['+entry.scope+']' : ''} ${entry.message}`);
|
||||
}
|
||||
else if (event.type === 'close_blocked') reportError(t.closeBlocked);
|
||||
else if (event.type === 'backend_exit') reportError(t.noBackend);
|
||||
}).then(stop => {if (cancelled) stop(); else dispose = stop;}).catch(e => {if (!cancelled) reportError(String(e));});
|
||||
@@ -126,35 +151,42 @@ function App() {
|
||||
if (p) {setPkg(p); setPath(p.path); setHost(p.adapter === 'e5' ? '192.168.9.1' : '192.168.77.1'); append(t.verified);}
|
||||
};
|
||||
const refresh = async () => {
|
||||
setDevice(undefined);
|
||||
setDevicesLoaded(false);
|
||||
const values = await task(() => request<Device[]>('devices'));
|
||||
if (values) {
|
||||
setDevices(values);
|
||||
setDevices(values); setDevicesLoaded(true);
|
||||
if (values.length === 1) {setSerial(values[0].serial); if (values[0].serial !== serial) setDevice(undefined);}
|
||||
else if (!values.some(d => d.serial === serial)) {setSerial(''); setDevice(undefined);}
|
||||
if (!values.length) toast.info(t.noDevices);
|
||||
if (!values.length) toast.info(t.noDevices, {id:'device-selection'});
|
||||
else if (values.length > 1) toast.info(t.multipleDevices, {id:'device-selection'});
|
||||
else toast.success(t.refreshed);
|
||||
}
|
||||
else toast.success(t.refreshed, {id:'device-selection'});
|
||||
} else {setDevices([]); setSerial('');}
|
||||
};
|
||||
const inspect = async () => {
|
||||
setDevice(undefined);
|
||||
const value = await task(() => request<Device>('probe', {serial, method: view === 'boot' ? 'boot' : method}), t.inspected);
|
||||
if (value) {setDevice(value); if (value.existing && view === 'install') setMethod('reinstall'); else if (value.tf && view === 'install') setMethod('tf');}
|
||||
if (value) setDevice(value);
|
||||
};
|
||||
const navigate = async (next: View) => {
|
||||
setView(next); setAccepted(false); setTransfer(undefined); setDevice(undefined);
|
||||
if (next === 'resume') {const values = await task(() => request<Transaction[]>('list')); if (values) setRecords(values);}
|
||||
if (['install','advanced','boot'].includes(next)) {if (next === 'boot') setMethod('boot'); else setMethod('part'); if (pkg) await refresh();}
|
||||
if (['install','advanced','boot'].includes(next)) {setMethod(next === 'boot' ? 'boot' : next === 'advanced' ? 'reinstall' : 'part'); await refresh();}
|
||||
if (next === 'update') setMethod('update');
|
||||
};
|
||||
const plan = async () => {
|
||||
const value = await task(() => request<Transaction>('plan', {serial, choices: {method, size_gib: Number(size), grow, host}, password}));
|
||||
if (value) {acceptTransaction(value); setView('plan'); setAccepted(false);}
|
||||
if (value) {setPlanOrigin(view); acceptTransaction(value); setView('plan'); setAccepted(false);}
|
||||
};
|
||||
const start = async (command: string, record = tx) => {
|
||||
if (!record) return;
|
||||
const value = await task(() => request<Transaction>(command, {transaction: record.id, confirmed: command === 'start', password, path: pkg?.path || path}));
|
||||
if (value) {acceptTransaction(value); setView('progress'); setSince(Date.now()); setTransfer(undefined);}
|
||||
if (value) {acceptTransaction(value); setView('progress'); setLogOpen(true); setSince(Date.now()); setTransfer(undefined);}
|
||||
};
|
||||
const continueRecord = async (record: Transaction) => {
|
||||
if (record.status === 'ready') {
|
||||
acceptTransaction(record, false); setPlanOrigin('resume'); setAccepted(false); setView('plan');
|
||||
} else await start('resume', record);
|
||||
};
|
||||
const exportBackup = async () => {
|
||||
if (!tx) return;
|
||||
@@ -163,10 +195,12 @@ function App() {
|
||||
return request('export', {transaction: tx.id, path: target});
|
||||
}, t.exportedBackup);
|
||||
};
|
||||
const diagnosticText = async () => tx ? (await request<{text:string}>('diagnostics', {transaction:tx.id})).text : logs.join('\n');
|
||||
const copyDiagnostics = () => task(async () => navigator.clipboard.writeText(await diagnosticText()), t.copied);
|
||||
const exportLogs = async () => {
|
||||
await task(async () => {const target = await native('save_log');
|
||||
if (!target) return false;
|
||||
return invoke('write_log', {path: target, text: logs.join('\n')});
|
||||
return invoke('write_log', {path: target, text: await diagnosticText()});
|
||||
}, t.exportedLog);
|
||||
};
|
||||
const choosePackage = async () => {
|
||||
@@ -202,6 +236,8 @@ function App() {
|
||||
{id:'advanced', icon:Settings2, title:t.advanced, description:t.advancedDesc},
|
||||
] as const;
|
||||
const impact = tx?.plan.wipe ? t.wipe : tx?.choices.method === 'tf' ? t.tfErase : tx?.choices.method === 'reinstall' ? t.reinstallErase : tx?.choices.method === 'image' ? t.imageImpact : tx?.choices.method === 'update' ? t.updateImpact : tx?.choices.method === 'boot' ? t.bootImpact : t.preserve;
|
||||
const waitingForOpenwrt = tx?.stage === 'openwrt_boot' && tx.status.startsWith('waiting') && !tx.unsafe;
|
||||
const manualRestart = waitingForOpenwrt && tx?.details?.reboot_manually !== false;
|
||||
return <div className="app-shell">
|
||||
<header><div className="brand"><div className="brand-icon"><HardDrive size={20}/></div><div><strong>{t.title}</strong><small>{t.subtitle}</small></div></div>
|
||||
<div className="preferences"><label className="sr-only" htmlFor="language">{t.language}</label><select id="language" value={lang} onChange={e => setLang(e.target.value as Language)}><option value="zh">中文</option><option value="en">English</option></select>
|
||||
@@ -212,7 +248,7 @@ function App() {
|
||||
<ol className="stepper">{t.steps.map((name, i) => <li key={name} className={current === i ? 'current' : current > i ? 'done' : ''}><span>{current > i ? <Check size={14}/> : i+1}</span><div>{name}</div></li>)}</ol>
|
||||
<div className="sidebar-bottom"><div className="sidebar-note"><ShieldCheck size={19}/><p>{t.packageHint}</p></div>
|
||||
<Button variant="ghost" className="data-folder" disabled={busy} onClick={openData}><FolderOpen size={16}/>{t.openData}</Button></div>
|
||||
</aside><main aria-busy={busy}>
|
||||
</aside><main aria-busy={busy} className={waitingForOpenwrt ? 'boot-wait' : undefined}>
|
||||
<div className="busy-track" aria-hidden="true">{busy && <m.div animate={{opacity:reduceMotion ? 1 : [.4,1,.4]}} transition={{duration:1.3,repeat:reduceMotion ? 0 : Infinity}}/>}</div>
|
||||
<AnimatePresence initial={false} mode="wait" onExitComplete={() => requestAnimationFrame(() => pageRef.current?.querySelector<HTMLElement>('h1')?.focus({preventScroll:true}))}>
|
||||
<m.div key={view} ref={pageRef} className="page" initial={{opacity:0, y:reduceMotion ? 0 : 8}} animate={{opacity:1,y:0}} exit={{opacity:0}} transition={{duration:reduceMotion ? 0 : 0.16, ease:'easeOut'}}>
|
||||
@@ -223,41 +259,45 @@ function App() {
|
||||
{['install','update','boot','advanced'].includes(view) && <><h1 tabIndex={-1}>{purposes.find(p => p.id === view)?.title}</h1><p className="intro">{purposes.find(p => p.id === view)?.description}</p>
|
||||
<div className="page-scroll scroll-area"><section><div className="section-title"><h2>{t.package}</h2>{pkg && <span className="badge"><Check size={13}/>{t.verified}</span>}</div>
|
||||
<div className="package-row"><div className="file-path" title={path}>{pkg?.name || path || t.choosePackage}</div><Button variant="outline" disabled={busy} onClick={choosePackage}><FolderOpen size={16}/>{t.choosePackage}</Button><Button disabled={busy || !path} onClick={() => verify()}>{t.verify}</Button></div></section>
|
||||
{view === 'update' ? <section><h2>{t.device}</h2><div className="form-grid"><label>{t.host}<input disabled={busy} value={host} onChange={e => setHost(e.target.value)} autoComplete="off"/></label><label>{t.password}<input disabled={busy} type="password" value={password} onChange={e => setPassword(e.target.value)} autoComplete="off"/></label></div><Button variant="outline" disabled={busy || !pkg} onClick={async () => {setDevice(undefined); const d = await task(() => request<Device>('probe_update', {host, password}), t.inspected); if (d) setDevice(d);}}>{t.checkUpdate}</Button></section> : <section><div className="section-title"><h2>{t.device}</h2><Button variant="ghost" disabled={!pkg || busy} onClick={refresh}><RefreshCw size={15}/>{t.refresh}</Button></div><div className="device-select"><Smartphone size={18}/><select disabled={busy} aria-label={t.select} value={serial} onChange={e => {setSerial(e.target.value); setDevice(undefined);}}><option value="">{t.select}</option>{devices.map(d => <option key={d.serial} value={d.serial}>{d.label} · ••••{d.serial.slice(-4)} · {t.deviceStates[d.state as keyof typeof t.deviceStates] || d.state}</option>)}</select><Button variant="outline" disabled={!serial || !pkg || busy} onClick={inspect}>{t.inspect}</Button></div></section>}
|
||||
{view === 'update' ? <section><h2>{t.device}</h2><div className="form-grid"><label>{t.host}<input disabled={busy} value={host} onChange={e => setHost(e.target.value)} autoComplete="off"/></label><label>{t.password}<input disabled={busy} type="password" value={password} onChange={e => setPassword(e.target.value)} autoComplete="off"/></label></div><Button variant="outline" disabled={busy || !pkg} onClick={async () => {setDevice(undefined); const d = await task(() => request<Device>('probe_update', {host, password}), t.inspected); if (d) setDevice(d);}}>{t.checkUpdate}</Button></section> : <section><div className="section-title"><h2>{t.device}</h2><Button variant="ghost" disabled={busy} onClick={refresh}><RefreshCw size={15}/>{t.refresh}</Button></div><div className="device-select"><Smartphone size={18}/><select disabled={busy} aria-label={t.select} value={serial} onChange={e => {setSerial(e.target.value); setDevice(undefined);}}><option value="">{devicesLoaded && !devices.length ? t.noDevicesShort : t.select}</option>{devices.map(d => <option key={d.serial} value={d.serial}>{d.label} · ••••{d.serial.slice(-4)} · {t.deviceStates[d.state as keyof typeof t.deviceStates] || d.state}</option>)}</select><Button variant="outline" disabled={!serial || !pkg || busy} onClick={inspect}>{t.inspect}</Button></div>{devicesLoaded && !devices.length && <p className="device-hint" role="status">{t.noDevices}</p>}{!pkg && <p className="device-hint">{t.inspectNeedsPackage}</p>}</section>}
|
||||
{view === 'boot' && <section><h2>{t.visit}</h2><div className="form-grid"><label>{t.host}<input disabled={busy} value={host} onChange={e => setHost(e.target.value)} autoComplete="off"/></label><label>{t.password}<input disabled={busy} type="password" value={password} onChange={e => setPassword(e.target.value)} autoComplete="off"/></label></div></section>}
|
||||
{device && <div className="device-card"><div><small>{t.model}</small><strong>{device.model || t.unknown}</strong></div><div><small>{t.os}</small><strong>{device.system || t.unknown}</strong></div><div><small>{t.slot}</small><strong>{device.slot || t.unknown}</strong></div><div><small>{t.root}</small><strong className={device.root ? 'good-text' : ''}>{device.root ? t.ready : t.unavailable}</strong></div></div>}
|
||||
{device?.readiness && device.readiness !== 'ready' && <div className="alert"><CircleAlert size={19}/><div><strong>{stageLabel(device.readiness)}</strong><p>{t.waitingAndroid}</p></div></div>}
|
||||
{view !== 'update' && view !== 'boot' && <section><h2>{t.install}</h2><div className="method-options" role="group" aria-label={t.install}>{(view === 'advanced' ? ['reinstall','image'] : device?.existing ? ['reinstall'] : ['tf','part']).map(m => <button disabled={busy} key={m} aria-pressed={method === m} className={method === m ? 'selected' : ''} onClick={() => setMethod(m)}>{m === 'tf' ? <Usb size={17}/> : <HardDrive size={17}/>}{(t as unknown as Record<string,string>)[m]}{(m === 'tf' && device?.tf || m === 'reinstall' && device?.existing) && <span>{t.recommended}</span>}</button>)}</div>
|
||||
{view !== 'update' && view !== 'boot' && <section><h2>{t.install}</h2><div className="method-options" role="group" aria-label={t.install}>{(view === 'advanced' ? ['reinstall','image'] : ['tf','part','reinstall']).map(m => <button disabled={busy} key={m} aria-pressed={method === m} className={method === m ? 'selected' : ''} onClick={() => setMethod(m)}>{m === 'tf' ? <Usb size={17}/> : <HardDrive size={17}/>}{(t as unknown as Record<string,string>)[m]}{(m === 'tf' && device?.tf || m === 'reinstall' && device?.existing) && <span>{t.recommended}</span>}</button>)}</div>
|
||||
{method === 'image' && <div className="alert danger"><CircleAlert size={18}/><strong>{t.experimental}</strong></div>}
|
||||
{['part','image'].includes(method) && <label className="size-field">{t.size}<input disabled={busy} type="number" min="2" step="0.25" value={size} onChange={e => setSize(e.target.value)}/></label>}
|
||||
{['part','reinstall'].includes(method) && <label className="checkbox-label"><input disabled={busy} type="checkbox" checked={grow} onChange={e => setGrow(e.target.checked)}/><div>{t.grow}<small>{t.growHelp}</small></div></label>}
|
||||
</section>}
|
||||
</div><div className="actions"><Button disabled={busy} variant="ghost" onClick={() => navigate('home')}>{t.back}</Button><Button disabled={busy || !pkg || !device?.root} onClick={plan}>{t.plan}<ArrowRight size={16}/></Button></div>
|
||||
</>}
|
||||
{view === 'plan' && tx && <><div className="eyebrow">{t.review}</div><h1 tabIndex={-1}>{tx.device.model}</h1><p className="intro">{tx.package.name} · ••••{tx.device.serial.slice(-4)}</p><div className="page-scroll scroll-area"><section><dl className="plan-list"><div><dt>{t.target}</dt><dd>{tx.plan.target}</dd></div><div><dt>{t.android}</dt><dd>{gib(tx.plan.android_bytes)}</dd></div><div><dt>{t.allocation}</dt><dd>{tx.choices.method === 'boot' ? '—' : gib(tx.plan.openwrt_bytes)}</dd></div><div><dt>{t.grow}</dt><dd>{tx.plan.grow ? <Check size={17}/> : '—'}</dd></div></dl></section>
|
||||
{view === 'plan' && tx && <><div className="eyebrow">{t.review}</div><h1 tabIndex={-1}>{tx.device.model}</h1><p className="intro">{tx.package.name} · ••••{tx.device.serial.slice(-4)}</p><div className="page-scroll scroll-area"><section><dl className="plan-list"><div><dt>{t.installMethod}</dt><dd>{tx.choices.method === 'boot' ? t.boot : tx.choices.method === 'update' ? t.update : (t as unknown as Record<string,string>)[tx.choices.method]}</dd></div><div><dt>{t.target}</dt><dd>{tx.plan.target}</dd></div><div><dt>{t.android}</dt><dd>{gib(tx.plan.android_bytes)}</dd></div><div><dt>{t.allocation}</dt><dd>{tx.choices.method === 'boot' ? '—' : gib(tx.plan.openwrt_bytes)}</dd></div><div><dt>{t.grow}</dt><dd>{tx.plan.grow ? <Check size={17}/> : '—'}</dd></div></dl></section>
|
||||
<div className={'alert ' + (tx.plan.wipe || tx.plan.experimental ? 'danger' : '')}><CircleAlert size={20}/><div><strong>{t.impact}</strong><p>{impact}</p>{tx.plan.experimental && <p>{t.experimental}</p>}</div></div>
|
||||
{(tx.plan.offline || tx.plan.two_stage) && <div className="alert"><RefreshCw size={20}/><p>{t.firstBoot}</p></div>}
|
||||
</div><label className="checkbox-label confirmation"><input disabled={busy} type="checkbox" checked={accepted} onChange={e => setAccepted(e.target.checked)}/>{t.accept}</label>
|
||||
<div className="actions"><Button disabled={busy} variant="outline" onClick={() => navigate('install')}>{t.back}</Button><Button variant={tx.plan.wipe ? 'destructive' : 'default'} disabled={!accepted || busy} onClick={() => start('start')}>{t.start}<ArrowRight size={16}/></Button></div>
|
||||
<div className="actions"><Button disabled={busy} variant="outline" onClick={() => {setView(planOrigin); setAccepted(false);}}>{t.back}</Button><Button variant={tx.plan.wipe ? 'destructive' : 'default'} disabled={!accepted || busy} onClick={() => start('start')}>{t.start}<ArrowRight size={16}/></Button></div>
|
||||
</>}
|
||||
{view === 'resume' && <><h1 tabIndex={-1}>{t.resume}</h1><p className="intro">{t.resumeDesc}</p><div className="resume-tools"><Button variant="outline" disabled={busy} onClick={async () => {const folder = await task(() => native('pick_recovery')); if (folder) {const value = await task(() => request<Transaction>('import', {path: folder}), t.imported); if (value) setRecords(old => [value, ...old.filter(r => r.id !== value.id)]);}}}><Upload size={16}/>{t.import}</Button><Button variant="outline" disabled={busy} onClick={choosePackage}><FolderOpen size={16}/>{t.choosePackage}</Button></div>
|
||||
<label className="resume-password"><span>{t.password}</span><input disabled={busy} type="password" value={password} onChange={e => setPassword(e.target.value)} autoComplete="off"/></label>
|
||||
<div className="records-list scroll-area">{!records.length && <p className="empty-state">{t.noRecords}</p>}{records.map(r => <section className="record" key={r.id}><div><h2>{r.device.model}</h2><p>{stageLabel(r.stage)} · {statusLabel(r.status)}</p><small>{new Date(r.updated*1000).toLocaleString()} · {r.id.slice(0,8)}</small></div><Button disabled={busy} onClick={() => start('resume', r)}>{t.continue}<ArrowRight size={16}/></Button></section>)}</div>
|
||||
<div className="records-list scroll-area">{!records.length && <p className="empty-state">{t.noRecords}</p>}{records.map(r => <section className="record" key={r.id}><div><h2>{r.device.model}</h2><p>{r.choices.method === 'boot' ? t.boot : r.choices.method === 'update' ? t.update : (t as unknown as Record<string,string>)[r.choices.method]} · ••••{r.device.serial.slice(-4)}</p><p>{stageLabel(r.stage)} · {statusLabel(r.status)}</p><small>{new Date(r.updated*1000).toLocaleString()} · {r.id.slice(0,8)}</small></div><Button disabled={busy} onClick={() => continueRecord(r)}>{r.status === 'ready' ? t.review : t.continue}<ArrowRight size={16}/></Button></section>)}</div>
|
||||
</>}
|
||||
{view === 'progress' && tx && <><div className="eyebrow">{t.progress} · {tx.device.model}</div><h1 tabIndex={-1}>{tx.status === 'completed' ? tx.choices.method === 'boot' ? t.successBoot : tx.choices.method === 'update' ? t.successUpdate : t.success : stageLabel(tx.stage)}</h1><div className="status-line"><span className={'status-dot '+tx.status}/><span>{statusLabel(tx.status)}</span><span className="elapsed">{t.elapsed} {elapsed}s</span></div>
|
||||
<div className="page-scroll scroll-area">{tx.status === 'completed' ? <section className="success-panel"><m.div className="success-icon" initial={{opacity:0,scale:reduceMotion ? 1 : .9}} animate={{opacity:1,scale:1}} transition={{duration:reduceMotion ? 0 : .24}}><CheckCircle2 size={42} className="good-text"/></m.div><dl className="plan-list"><div><dt>{t.actual}</dt><dd>{gib(tx.result?.filesystem_bytes)}</dd></div><div><dt>{t.visit}</dt><dd>{tx.result?.url}</dd></div></dl><h2>{t.next}</h2><p>{t.nextDesc}</p></section> : <>
|
||||
<section className="activity"><m.div key={tx.stage+tx.status} className="activity-heading" initial={{opacity:reduceMotion ? 1 : 0,y:reduceMotion ? 0 : 4}} animate={{opacity:1,y:0}} transition={{duration:reduceMotion ? 0 : .18}}>{tx.status === 'failed' ? <CircleAlert size={28}/> : tx.status === 'running' ? <LoaderCircle size={28} className="spin"/> : tx.status.startsWith('waiting') ? <Smartphone size={28}/> : <Pause size={28}/>}<div><h2>{stageLabel(tx.stage)}</h2><p>{tx.package.name}</p></div></m.div>
|
||||
{transfer && tx.status === 'running' && <div className="transfer"><div><span>{transfer.name}</span><span>{Math.floor(transfer.bytes/transfer.total*100)}%</span></div><progress value={transfer.bytes} max={transfer.total}/><small>{t.bytes}: {gib(transfer.bytes)} / {gib(transfer.total)} · {t.speed}: {(transfer.bytes_per_second/1048576).toFixed(1)} MiB/s</small></div>}
|
||||
{view === 'progress' && tx && <><div className="eyebrow">{t.progress} · {tx.device.model}</div><h1 tabIndex={-1}>{tx.status === 'completed' ? tx.choices.method === 'boot' ? t.successBoot : tx.choices.method === 'update' ? t.successUpdate : t.success : manualRestart ? t.rebootNow : waitingForOpenwrt && tx.choices.method === 'update' ? tx.details?.connection_state === 'reconnecting' ? t.updateReconnecting : t.updateReboot : stageLabel(tx.stage)}</h1><div className="status-line"><span className={'status-dot '+tx.status}/><span>{statusLabel(tx.status)}</span><span className="elapsed">{t.elapsed} {elapsed}s</span></div>
|
||||
{waitingForOpenwrt && <div className="boot-guidance"><Smartphone size={21}/><p>{tx.choices.method === 'update' ? t.updateRebootDesc : tx.details?.boot_confirmed ? t.bootConfirmed : manualRestart ? t.rebootManual : t.rebootAutomatic}</p></div>}
|
||||
<div className="page-scroll scroll-area">{tx.status === 'completed' ? <section className="success-panel"><m.div className="success-icon" initial={{opacity:0,scale:reduceMotion ? 1 : .9}} animate={{opacity:1,scale:1}} transition={{duration:reduceMotion ? 0 : .24}}><CheckCircle2 size={42} className="good-text"/></m.div><dl className="plan-list"><div><dt>{t.actual}</dt><dd>{gib(tx.result?.filesystem_bytes)}</dd></div><div><dt>{t.visit}</dt><dd>{tx.result?.url}</dd></div></dl><h2>{t.next}</h2><p>{tx.choices.method === 'update' ? t.updateNext : t.nextDesc}</p></section> : <>
|
||||
{waitingForOpenwrt ? <div className="network-guidance"><p>{t.waitingOpenwrt}</p><Button variant="ghost" className="context-help" onClick={openHelp}><CircleHelp size={16}/>{help.currentHelp}</Button></div> : <section className="activity"><m.div key={tx.stage+tx.status} className="activity-heading" initial={{opacity:reduceMotion ? 1 : 0,y:reduceMotion ? 0 : 4}} animate={{opacity:1,y:0}} transition={{duration:reduceMotion ? 0 : .18}}>{tx.status === 'failed' ? <CircleAlert size={28}/> : tx.status === 'running' ? <LoaderCircle size={28} className="spin"/> : tx.status.startsWith('waiting') ? <Smartphone size={28}/> : <Pause size={28}/>}<div><h2>{stageLabel(tx.stage)}</h2><p>{tx.package.name}{tx.details?.tool ? " · "+tx.details.tool : ""}</p></div></m.div>
|
||||
<div className="stage-progress"><small>{t.phase} {Math.min(5,stateGroup(tx.stage)+1)} / 5 · {statusLabel(tx.status)}</small>{(!transfer || tx.status !== 'running') && <><div className={'indeterminate-progress '+(tx.status === 'running' ? 'is-running' : '')} role="progressbar" aria-label={t.stageProgress} aria-valuetext={`${stageLabel(tx.stage)} · ${statusLabel(tx.status)}`}><div/></div><small>{tx.status === 'running' ? t.noPercentage : statusLabel(tx.status)}</small></>}</div>
|
||||
{transfer && tx.status === 'running' && <div className="transfer"><div><span>{transfer.name}</span><span>{Math.floor(transfer.bytes/transfer.total*100)}%</span></div><progress value={transfer.bytes} max={transfer.total}/><small>{t.bytes}: {transfer.bytes.toLocaleString()} / {transfer.total.toLocaleString()} B · {t.speed}: {(transfer.bytes_per_second/1048576).toFixed(1)} MiB/s</small></div>}
|
||||
{tx.status.startsWith('waiting') && <><p className="waiting-guidance">{tx.stage === 'openwrt_boot' ? t.waitingOpenwrt : t.waitingAndroid}</p><Button variant="ghost" className="context-help" onClick={openHelp}><CircleHelp size={16}/>{help.currentHelp}</Button></>}
|
||||
{tx.unsafe && <div className="alert danger"><ShieldCheck size={19}/><p>{t.unsafe}</p></div>}
|
||||
{tx.error && <div className="alert danger"><CircleAlert size={20}/><p>{tx.error.message}</p></div>}
|
||||
</section></>} </div>{tx.status !== 'completed' && <div className="actions">{active ? <Button variant="outline" disabled={busy} onClick={() => task(() => request('cancel'), t.pauseRequested)}><Pause size={16}/>{t.pause}</Button> : <Button disabled={busy || tx.error?.retryable === false} onClick={() => start('retry')}>{t.retry}<RotateCcw size={16}/></Button>}</div>
|
||||
{tx.error && <div className="alert danger"><CircleAlert size={20}/><div><p className="error-message">{tx.error.message}</p><Button className="copy-diagnostics" variant="outline" disabled={busy} onClick={copyDiagnostics}><Copy size={15}/>{t.copyDiagnostics}</Button></div></div>}
|
||||
</section>}</>} </div>
|
||||
{waitingForOpenwrt && <div className="verification-controls"><div className="form-grid"><label>{t.host}<input disabled={busy} value={host} onChange={e => setHost(e.target.value)} autoComplete="off"/></label><label>{t.password}<input disabled={busy} type="password" value={password} onChange={e => setPassword(e.target.value)} autoComplete="off"/></label></div>{tx.details?.verification_error && <p className="verification-error" role="status">{tx.details.verification_error}</p>}</div>}
|
||||
{tx.status !== 'completed' && <div className="actions">{waitingForOpenwrt && <Button disabled={busy || !host.trim()} onClick={() => task(async () => (await request<{accepted:boolean}>('verify_openwrt', {transaction:tx.id, host:host.trim(), password})).accepted, t.verificationRequested)}><CheckCircle2 size={16}/>{t.confirmOpenwrt}</Button>}{active ? <Button variant="outline" disabled={busy} onClick={() => task(async () => (await request<{accepted:boolean}>('cancel')).accepted, t.pauseRequested)}><Pause size={16}/>{t.pause}</Button> : <Button disabled={busy || tx.error?.retryable === false} onClick={() => start('retry')}>{t.retry}<RotateCcw size={16}/></Button>}</div>
|
||||
}
|
||||
<div className="backup-actions"><Button disabled={busy} variant="outline" onClick={exportBackup}><Download size={16}/>{t.exportBackup}</Button><Button disabled={busy} variant="ghost" onClick={openData}><FolderOpen size={16}/>{t.openData}</Button></div>
|
||||
</>}
|
||||
</m.div></AnimatePresence>
|
||||
<div className="log-panel"><button className="log-toggle" aria-expanded={logOpen} aria-controls="installation-log" onClick={() => setLogOpen(!logOpen)}><ChevronDown size={14}/>{t.logs}<span>{logs.length}</span></button>
|
||||
<AnimatePresence initial={false}>{logOpen && <m.div id="installation-log" className="log-content" initial={{height:0,opacity:0}} animate={{height:'auto',opacity:1}} exit={{height:0,opacity:0}} transition={{duration:reduceMotion ? 0 : .18}}><div className="log-inner"><div className="log-actions"><Button variant="ghost" disabled={busy || !logs.length} onClick={() => task(() => navigator.clipboard.writeText(logs.join('\n')), t.copied)}><Copy size={14}/>{t.copy}</Button><Button variant="ghost" disabled={busy || !logs.length} onClick={exportLogs}><Download size={14}/>{t.exportLog}</Button></div><pre tabIndex={0} aria-label={t.logs}>{logs.join('\n') || '—'}</pre></div></m.div>}</AnimatePresence>
|
||||
<div className="log-panel"><button className="log-toggle" aria-expanded={logOpen} aria-controls="installation-log" onClick={() => setLogOpen(!logOpen)}><ChevronDown size={14}/>{t.logs} · DEBUG<span>{logs.length}</span></button>
|
||||
<AnimatePresence initial={false}>{logOpen && <m.div id="installation-log" className="log-content" initial={{height:0,opacity:0}} animate={{height:'auto',opacity:1}} exit={{height:0,opacity:0}} transition={{duration:reduceMotion ? 0 : .18}}><div className="log-inner"><div className="log-actions"><small>{t.newestFirst}</small><Button variant="ghost" disabled={busy || !logs.length && !tx} onClick={copyDiagnostics}><Copy size={14}/>{t.copy}</Button><Button variant="ghost" disabled={busy || !logs.length && !tx} onClick={exportLogs}><Download size={14}/>{t.exportLog}</Button></div><pre tabIndex={0} aria-label={t.logs}>{[...logs].reverse().join('\n') || '—'}</pre></div></m.div>}</AnimatePresence>
|
||||
</div>
|
||||
</main></div><footer><span><ShieldCheck size={13}/>OpenWrt Installer · v1.0</span><span>USB / SSH · {pkg?.profile || '—'}</span></footer>
|
||||
<Suspense fallback={<div className="help-loading" role="status"><LoaderCircle size={17} className="spin"/>{t.running}</div>}>{helpOpen && <HelpCenter language={lang} open={helpOpen} onOpenChange={setHelpOpen} initialTopic={helpTopic} onGuide={showGuide}/>}
|
||||
|
||||
@@ -4,9 +4,10 @@ export interface Device {serial: string; model?: string; label?: string; state?:
|
||||
export interface Package {path: string; name: string; adapter: string; profile: string; kernel: string}
|
||||
export interface Transaction {
|
||||
id: string; status: string; stage: string; device: Device; package: Package;
|
||||
choices: {method: string}; plan: {wipe: boolean; two_stage: boolean; offline?: boolean; openwrt_bytes: number; android_bytes?: number; target: string; grow?: boolean; experimental?: boolean; gap_start?: number};
|
||||
completed: string[]; unsafe: boolean; updated: number;
|
||||
details?: {host?: string}; error?: {message: string; retryable: boolean; code: string};
|
||||
choices: {method: string; host?: string}; plan: {wipe: boolean; two_stage: boolean; offline?: boolean; openwrt_bytes: number; android_bytes?: number; target: string; grow?: boolean; experimental?: boolean; gap_start?: number};
|
||||
completed: string[]; unsafe: boolean; updated: number; revision?: number;
|
||||
stage_started_at?: number; stage_finished_at?: number;
|
||||
details?: {host?: string; tool?: string; reboot_manually?: boolean; boot_confirmed?: boolean; verification_error?: string; connection_state?: string}; error?: {message: string; retryable: boolean; code: string};
|
||||
result?: {filesystem_bytes: number; url: string; backup_directory: string; temporary: boolean};
|
||||
}
|
||||
export interface Transfer {name: string; bytes: number; total: number; bytes_per_second: number}
|
||||
@@ -17,7 +18,7 @@ export const native = <T = string | null>(command: string) => invoke<T>(command)
|
||||
export const gib = (bytes = 0) => (bytes / 1073741824).toFixed(2) + ' GiB';
|
||||
export function stateGroup(stage: string): number {
|
||||
if (['plan', 'package', 'device', 'environment'].includes(stage)) return 0;
|
||||
if (['backup', 'prepare'].includes(stage)) return 1;
|
||||
if (['backup', 'prepare','firmware_extract','firmware_convert'].includes(stage)) return 1;
|
||||
if (['android_boot', 'android_setup', 'usb_debugging', 'debug_authorization', 'magisk', 'root_permission', 'root_ready', 'recheck'].includes(stage)) return 2;
|
||||
if (['transfer_install', 'verify_capacity', 'openwrt_boot'].includes(stage)) return 3;
|
||||
return 4;
|
||||
|
||||
@@ -98,6 +98,16 @@ main{position:relative;display:flex;flex-direction:column;padding:28px 36px 18px
|
||||
.activity-heading>svg{color:hsl(var(--primary));flex-shrink:0;}
|
||||
.activity-heading p{font-size:12px;color:hsl(var(--muted-foreground));margin-top:6px;}
|
||||
.waiting-guidance{font-size:13px;line-height:1.9;margin-top:20px;}
|
||||
.boot-guidance{display:flex;gap:10px;align-items:flex-start;flex-shrink:0;padding:12px 14px;margin:0 0 12px;border:1px solid hsl(var(--primary)/.3);border-radius:8px;background:hsl(var(--primary)/.06);font-size:13px;line-height:1.7;}
|
||||
.boot-guidance>svg{flex-shrink:0;color:hsl(var(--primary));margin-top:1px;}
|
||||
.boot-wait .log-inner{height:min(145px,18dvh);}
|
||||
.boot-wait .status-line{margin:10px 0 14px;}
|
||||
.verification-controls{flex-shrink:0;}
|
||||
.verification-controls .form-grid{grid-template-columns:1fr 1fr;gap:12px;margin:8px 0 0;}
|
||||
.verification-controls input{min-width:0;width:100%;}
|
||||
.verification-error{font-size:12px;color:hsl(var(--destructive));line-height:1.5;margin-top:6px;}
|
||||
.network-guidance{font-size:12px;line-height:1.7;}
|
||||
@media(max-height:720px){.boot-wait .log-inner{height:88px;}.boot-wait .boot-guidance{padding:8px 10px;font-size:12px;line-height:1.6;margin-bottom:6px;}.boot-wait .actions{padding-top:10px;}.boot-wait .backup-actions{margin-top:8px;}.boot-wait .log-panel{margin-top:10px;padding-top:8px;}}
|
||||
.transfer{margin:25px 0 10px;}
|
||||
.transfer>div{display:flex;justify-content:space-between;font-size:12px;}
|
||||
progress{display:block;width:100%;height:7px;margin:13px 0;accent-color:hsl(var(--primary));border-radius:4px;}
|
||||
@@ -115,6 +125,7 @@ progress{display:block;width:100%;height:7px;margin:13px 0;accent-color:hsl(var(
|
||||
.log-toggle>span{margin-left:auto;font-size:11px;}
|
||||
.log-panel pre{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;background:hsl(var(--muted));border-radius:6px;padding:14px;font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;}
|
||||
.log-actions{display:flex;justify-content:flex-end;margin:10px 0;}
|
||||
.log-actions>small{margin-right:auto;align-self:center;font-size:11px;color:hsl(var(--muted-foreground));}
|
||||
.log-actions button{font-size:11px;height:30px;}
|
||||
footer{flex-shrink:0;border-top:1px solid hsl(var(--border));padding:12px 30px;display:flex;justify-content:space-between;color:hsl(var(--muted-foreground));font-size:10px;}
|
||||
footer span{display:flex;align-items:center;gap:6px;}
|
||||
@@ -135,6 +146,9 @@ h1{font-size:24px;}
|
||||
|
||||
|
||||
html,body,#root {width:100%;height:100%;overflow:hidden;}
|
||||
body {-webkit-user-select:none;user-select:none;}
|
||||
input:not([type=checkbox]),textarea,[contenteditable=true],.file-path,.device-card strong,.plan-list dd,.log-panel pre,.help-markdown,.help-markdown *,.app-toast .toast-description,.error-message {-webkit-user-select:text;user-select:text;}
|
||||
.device-hint {font-size:12px;color:hsl(var(--muted-foreground));margin-top:12px;line-height:1.7;}
|
||||
* {box-sizing:border-box;}
|
||||
.page {display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden;}
|
||||
.page>h1,.page>.eyebrow,.page>.status-line,.page>.resume-tools,.page>.form-grid {flex-shrink:0;}
|
||||
@@ -169,6 +183,13 @@ input:not([type=checkbox]):hover,select:hover {border-color:hsl(var(--primary)/.
|
||||
.log-inner {height:min(190px,24dvh);display:flex;flex-direction:column;}
|
||||
.log-panel pre {margin:0;tab-size:2;}
|
||||
.log-actions {flex-shrink:0;margin:6px 0;}
|
||||
.stage-progress {margin-top:20px;}
|
||||
.stage-progress>small {display:block;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.7;}
|
||||
.indeterminate-progress {height:7px;background:hsl(var(--muted));border-radius:6px;overflow:hidden;margin:10px 0 7px;}
|
||||
.indeterminate-progress>div {height:100%;width:32%;border-radius:6px;background:hsl(var(--primary)/.4);}
|
||||
.indeterminate-progress.is-running>div {background:hsl(var(--primary));animation:stage-activity 1.6s ease-in-out infinite;}
|
||||
.copy-diagnostics {margin-top:12px;}
|
||||
@keyframes stage-activity {from{transform:translateX(-105%);}to{transform:translateX(320%);}}
|
||||
.backup-actions {flex-shrink:0;margin:14px 0 0;}
|
||||
.resume-tools {margin:0 0 12px;}
|
||||
.resume-password {display:flex;flex-shrink:0;align-items:center;gap:12px;margin:0 0 16px;font-size:12px;}
|
||||
@@ -202,7 +223,7 @@ input:not([type=checkbox]):hover,select:hover {border-color:hsl(var(--primary)/.
|
||||
.help-topics button {width:100%;text-align:left;font-size:13px;line-height:1.6;padding:11px 12px;border-radius:7px;margin-bottom:4px;transition:background-color .15s,color .15s;}
|
||||
.help-topics button:hover {background:hsl(var(--muted));}
|
||||
.help-topics button[aria-current=page] {color:hsl(var(--primary));background:hsl(var(--primary)/.09);font-weight:600;}
|
||||
.help-article {padding:24px 26px;min-height:0;user-select:text;}
|
||||
.help-article {padding:24px 26px;min-height:0;}
|
||||
.help-article>h2 {font-size:19px;margin-bottom:18px;}
|
||||
.help-article:focus-visible {outline:2px solid hsl(var(--primary));outline-offset:-4px;}
|
||||
.help-markdown {font-size:13px;line-height:1.85;overflow-wrap:anywhere;}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3518464,
|
||||
"backend_and_tools_bytes": 43109647,
|
||||
"firmware_payload_bytes": 241030658,
|
||||
"archive_bytes": 210069950,
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"archive": "e5-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "b26c7cccc2269f746f9d2233b6eabcc42903f4471c69f54a11888d5dcf84410d",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "9638d8ac2514aed2caf03b86161f1e8846808d9615d09afc938a49560b3818dd"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3518464,
|
||||
"backend_and_tools_bytes": 43109647,
|
||||
"firmware_payload_bytes": 240109945,
|
||||
"archive_bytes": 209648831,
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"archive": "m8-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "6ceb5480f8502e9d686fd39bd58c9d04c87d59fa534cffb10af0bf234139e0ce",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "9638d8ac2514aed2caf03b86161f1e8846808d9615d09afc938a49560b3818dd"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3518464,
|
||||
"backend_and_tools_bytes": 43109647,
|
||||
"firmware_payload_bytes": 240961735,
|
||||
"archive_bytes": 210092619,
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"archive": "t551m-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "4e82631c23cb00f77b4613f77b0cd8661234d8e804f600ce84304f8b4ac3ef5f",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "9638d8ac2514aed2caf03b86161f1e8846808d9615d09afc938a49560b3818dd"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3518464,
|
||||
"backend_and_tools_bytes": 46045032,
|
||||
"firmware_payload_bytes": 145582695,
|
||||
"archive_bytes": 120098354,
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-6.18.54-gui-1.0.0-windows.zip",
|
||||
"sha256": "06da3d038f3150b68b2a33bd4d68cd1e1e56f01550bcac4cd877e2fed1da7498",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "9638d8ac2514aed2caf03b86161f1e8846808d9615d09afc938a49560b3818dd"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3518464,
|
||||
"backend_and_tools_bytes": 46045031,
|
||||
"firmware_payload_bytes": 146076011,
|
||||
"archive_bytes": 121172883,
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-7.2.8-gui-1.0.0-windows.zip",
|
||||
"sha256": "d9a942b06c0d05ccabd7fd606d9767d99aa31bba5e5515e039d264b5c4cd6c29",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "9638d8ac2514aed2caf03b86161f1e8846808d9615d09afc938a49560b3818dd"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n e5-openwrt-25.12.5-tf-20261015-030543 (6.18.54-e5-mobile4-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.4 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-boot-confirm\\e5-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n m8-openwrt-25.12.5-tf-20261015-030719 (6.18.54-m8-probe12-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.4 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-boot-confirm\\m8-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n t551m-openwrt-25.12.5-tf-20261015-030630 (6.18.54-t551m-otg10-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.4 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-boot-confirm\\t551m-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-boot-confirm\\mu300-openwrt-6.18.54-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-boot-confirm\\mu300-openwrt-7.2.8-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"package_compatible": true,
|
||||
"status": "failed",
|
||||
"stage": "prepare",
|
||||
"hardware_access": false,
|
||||
"record_modified": false,
|
||||
"artifact_sources_match": true
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"revision": "20261015-boot-confirm",
|
||||
"changes": [
|
||||
"Newest-first UI log entries with multiline traceback order preserved; persistent diagnostics remain chronological",
|
||||
"Pinned manual restart instructions and distinct requested automatic restart guidance",
|
||||
"Explicit boot confirmation with editable management host and in-memory SSH password",
|
||||
"Wrong-device, connection and authentication errors permit endpoint correction on the existing worker",
|
||||
"Persisted endpoint and boot confirmation; original CID and final capacity verification remain mandatory"
|
||||
],
|
||||
"backend_tests": {
|
||||
"e5": {"run": 70, "passed": 70, "skipped": 0},
|
||||
"mu300": {"run": 70, "passed": 68, "skipped": 2},
|
||||
"new_cases": [
|
||||
"Manual versus automatic restart across methods and application restart",
|
||||
"Confirmation queues a check without completing or persisting credentials",
|
||||
"Reject stale transaction, unsafe phase and invalid endpoint requests",
|
||||
"Two OpenWrt endpoints: reject wrong CID, select original device, then verify capacity",
|
||||
"Correct SSH authentication failure while waiting",
|
||||
"Manual confirmation cannot bypass filesystem capacity mismatch"
|
||||
]
|
||||
},
|
||||
"browser_suites": {"passed": 6, "report": "ui-regression.json", "minimum_viewport": "800x650", "checked": ["Newest-first multiline logs", "Pinned instructions with logs expanded", "Editable endpoint and boot-confirmation request", "Wrong-device retry", "Chinese/light and English/dark"]},
|
||||
"windows_release_build": {"tauri": "passed", "frozen_backend": "passed", "native_webview2_launch": "passed"},
|
||||
"frozen_packages": {"count": 5, "cli_protocol_utf8_adb_start": "boot-confirm-packages.json", "method_routing": "boot-confirm-frozen-methods.json", "backup_recovery_explicit_confirmation_capacity": "boot-confirm-frozen-flows.json", "zip_crc_and_single_system_payload": "passed", "critical_firmware_hashes": "unchanged"},
|
||||
"original_supplied_record": "boot-confirm-record-compatibility.json",
|
||||
"hardware_access": false,
|
||||
"device_reboot_or_install_performed": false,
|
||||
"size_reports": ["boot-confirm-e5-sizes.json", "boot-confirm-mu300-sizes.json"]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
[
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3516416,
|
||||
"backend_and_tools_bytes": 43104900,
|
||||
"firmware_payload_bytes": 241030208,
|
||||
"archive_bytes": 209777381,
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"archive": "e5-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "29b773dbcf5f96db8db28dabcb1772f97d702d6a20c860cc96db339bdcf7ca01",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "a8291f39c6eb9b7ce4881d167b7a3caf65d1903505227fd56762f27254e7007a"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516416,
|
||||
"backend_and_tools_bytes": 43104900,
|
||||
"firmware_payload_bytes": 240109495,
|
||||
"archive_bytes": 209356259,
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"archive": "m8-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "fbd1620ea1b8ec5d628c65d3fbe5523ab61e5ebaee976d07db232338b033e256",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "a8291f39c6eb9b7ce4881d167b7a3caf65d1903505227fd56762f27254e7007a"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516416,
|
||||
"backend_and_tools_bytes": 43104900,
|
||||
"firmware_payload_bytes": 240961285,
|
||||
"archive_bytes": 209800043,
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"archive": "t551m-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "1b80f76ddd2c0c452b653ac6212eb26d6692e0b53379f39cdc89ea0e45375f3a",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "a8291f39c6eb9b7ce4881d167b7a3caf65d1903505227fd56762f27254e7007a"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,57 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3516416,
|
||||
"backend_and_tools_bytes": 46039799,
|
||||
"firmware_payload_bytes": 145582695,
|
||||
"archive_bytes": 119805820,
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-6.18.54-gui-1.0.0-windows.zip",
|
||||
"sha256": "27c5c26f447d080ece83e8ca4a900c6857ce3104a50a4c72ab6f540034338bc8",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "a8291f39c6eb9b7ce4881d167b7a3caf65d1903505227fd56762f27254e7007a"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516416,
|
||||
"backend_and_tools_bytes": 46039798,
|
||||
"firmware_payload_bytes": 146076011,
|
||||
"archive_bytes": 120880345,
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-7.2.8-gui-1.0.0-windows.zip",
|
||||
"sha256": "c6635c9d1feca82523afb75d7df78efa9b4fbeabdfee81b3190421dc8706ee69",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "a8291f39c6eb9b7ce4881d167b7a3caf65d1903505227fd56762f27254e7007a"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n e5-openwrt-25.12.5-tf-20261015-030543 (6.18.54-e5-mobile4-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-debug\\e5-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n m8-openwrt-25.12.5-tf-20261015-030719 (6.18.54-m8-probe12-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.4 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-debug\\m8-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n t551m-openwrt-25.12.5-tf-20261015-030630 (6.18.54-t551m-otg10-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-debug\\t551m-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-debug\\mu300-openwrt-6.18.54-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-debug\\mu300-openwrt-7.2.8-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"backend_tests": {
|
||||
"e5": {
|
||||
"run": 56,
|
||||
"passed": 56
|
||||
},
|
||||
"mu300": {
|
||||
"run": 56,
|
||||
"passed": 55,
|
||||
"skipped": 1
|
||||
}
|
||||
},
|
||||
"ui_suites": 6,
|
||||
"device_script_suites_passed": 27,
|
||||
"device_script_suites_environment_blocked": 1,
|
||||
"frozen_packages_passed": 5,
|
||||
"supplied_m8_transaction_compatible": true,
|
||||
"hardware_partition_writes": false,
|
||||
"m8_frozen_backup_seconds": 17.94
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
[
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/install-entrypoints.py",
|
||||
"exit": 0,
|
||||
"stdout": "\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2\u5b89\u88c5\u7684 OpenWrt\uff08\u4ec5\u4fee\u6539 misc\uff09\n 6. Update OpenWrt / \u66f4\u65b0\u5df2\u8fd0\u884c\u7684 OpenWrt\n 7. Install to userdata image [EXPERIMENTAL] / userdata \u955c\u50cf\u5b89\u88c5\u3010\u5b9e\u9a8c\u6027\uff1a\u53ef\u80fd\u635f\u574f Android F2FS\uff0c\u4ec5\u672a\u52a0\u5bc6 data\u3011\n 0. Exit / \u9000\u51fa\n\n\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2\u5b89\u88c5\u7684 OpenWrt\uff08\u4ec5\u4fee\u6539 misc\uff09\n 6. Update OpenWrt / \u66f4\u65b0\u5df2\u8fd0\u884c\u7684 OpenWrt\n 7. Install to userdata image [EXPERIMENTAL] / userdata \u955c\u50cf\u5b89\u88c5\u3010\u5b9e\u9a8c\u6027\uff1a\u53ef\u80fd\u635f\u574f Android F2FS\uff0c\u4ec5\u672a\u52a0\u5bc6 data\u3011\n 0. Exit / \u9000\u51fa\n\n\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2\u5b89\u88c5\u7684 OpenWrt\uff08\u4ec5\u4fee\u6539 misc\uff09\n 6. Update OpenWrt / \u66f4\u65b0\u5df2\u8fd0\u884c\u7684 OpenWrt\n 7. Install to userdata image [EXPERIMENTAL] / userdata \u955c\u50cf\u5b89\u88c5\u3010\u5b9e\u9a8c\u6027\uff1a\u53ef\u80fd\u635f\u574f Android F2FS\uff0c\u4ec5\u672a\u52a0\u5bc6 data\u3011\n 0. Exit / \u9000\u51fa\n\n\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2\u5b89\u88c5\u7684 OpenWrt\uff08\u4ec5\u4fee\u6539 misc\uff09\n 6. Update OpenWrt / \u66f4\u65b0\u5df2\u8fd0\u884c\u7684 OpenWrt\n 7. Install to userdata image [EXPERIMENTAL] / userdata \u955c\u50cf\u5b89\u88c5\u3010\u5b9e\u9a8c\u6027\uff1a\u53ef\u80fd\u635f\u574f Android F2FS\uff0c\u4ec5\u672a\u52a0\u5bc6 data\u3011\n 0. Exit / \u9000\u51fa\n\n\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2\u5b89\u88c5\u7684 OpenWrt\uff08\u4ec5\u4fee\u6539 misc\uff09\n 6. Update OpenWrt / \u66f4\u65b0\u5df2\u8fd0\u884c\u7684 OpenWrt\n 7. Install to userdata image [EXPERIMENTAL] / userdata \u955c\u50cf\u5b89\u88c5\u3010\u5b9e\u9a8c\u6027\uff1a\u53ef\u80fd\u635f\u574f Android F2FS\uff0c\u4ec5\u672a\u52a0\u5bc6 data\u3011\n 0. Exit / \u9000\u51fa\n\n\nOpenWrt Installer / \u5b89\u88c5\u52a9\u624b\n 1. Install to TF card / TF \u5361\u9996\u6b21\u5b89\u88c5\uff08\u6e05\u7a7a\u7b2c\u4e00\u5206\u533a\uff0c\u65e0\u5206\u533a\u5219\u6574\u5361\uff09\n 2. Install to internal storage / \u7f29\u5bb9 userdata \u5b89\u88c5\n 3. Reinstall internal system / \u8986\u76d6\u91cd\u88c5\u5df2\u6709\u5185\u7f6e\u7cfb\u7edf\n 4. Resume internal installation / \u7ee7\u7eed\u52a0\u5bc6 data \u7684\u4e24\u9636\u6bb5\u5b89\u88c5\n 5. Boot OpenWrt once / \u4ece Android \u4e34\u65f6\u542f\u52a8\u5df2Line truncated
|
||||
"stderr": ".......\n----------------------------------------------------------------------\nRan 7 tests in 0.272s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/installed-openwrt.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "...\n----------------------------------------------------------------------\nRan 3 tests in 0.021s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/flash-diagnostics.py",
|
||||
"exit": 0,
|
||||
"stdout": "Boot control backup: /tmp/tmpm3jo8kk3/backups/before.D9HHhw\n\n\n[4/9] \u8fde\u63a5\u8bbe\u5907 / looking for Android (USB debugging on)\n\n[5/9] \u8fde\u63a5\u8bbe\u5907 / looking for Android (USB debugging on)\n\n[6/9] \u8fde\u63a5\u8bbe\u5907 / looking for Android (USB debugging on)\n",
|
||||
"stderr": "......................\n----------------------------------------------------------------------\nRan 22 tests in 0.234s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/part-two-stage.py",
|
||||
"exit": 0,
|
||||
"stdout": " \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: file; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: file; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u4e24\u9636\u6bb5\u5b89\u88c5\uff1a\u91cd\u5efa\u5206\u533a \u2192 \u539f\u5382 recovery \u6e05\u7a7a\u6570\u636e \u2192 Android \u91cd\u65b0\u6388\u6743 \u2192 \u5b89\u88c5 OpenWrt\u3002\n \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: file; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: file; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u4e24\u9636\u6bb5\u5b89\u88c5\uff1a\u91cd\u5efa\u5206\u533a \u2192 \u539f\u5382 recovery \u6e05\u7a7a\u6570\u636e \u2192 Android \u91cd\u65b0\u6388\u6743 \u2192 \u5b89\u88c5 OpenWrt\u3002\n \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: block; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u68c0\u6d4b\u5230 data \u52a0\u5bc6 / data encryption: block; \u672c\u6b21\u5b89\u88c5\u5fc5\u987b\u683c\u5f0f\u5316 userdata / formatting userdata is required.\n \u8b66\u544a / WARNING: Android \u5e94\u7528\u3001\u8d26\u53f7\u3001\u7167\u7247\u53ca\u5185\u90e8\u5b58\u50a8\u6587\u4ef6\u5c06\u88ab\u6e05\u7a7a\u3002\n ALL Android apps, accounts, photos and internal storage files will be erased.\n \u4e24\u9636\u6bb5\u5b89\u88c5\uff1a\u91cd\u5efa\u5206\u533a \u2192 \u539f\u5382 recovery \u6e05\u7a7a\u6570\u636e \u2192 Android \u91cd\u65b0\u6388\u6743 \u2192 \u5b89\u88c5 OpenWrt\u3002\n \u73b0\u6709\u7cfb\u7edf\u7684\u8bbe\u7f6e\u8bfb\u4e0d\u51fa\u6765\uff08e5root \u6302\u8f7d\u5931\u8d25\uff0c\u591a\u534a\u6587\u4ef6\u7cfb\u7edf\u5df2\u635f\u574f\uff09\uff1b\u6cbf\u7528\u547d\u4ee4\u884c\u4e0e\u9ed8\u8ba4\u503c / could not read the installed settings; using the command line and defaults\n\n \u8986\u76d6\u91cd\u88c5 / rewriting the existing installation\n e5root: mmcblk0p71 (10240 MiB), userdata \u4e0d\u52a8\n Android \u7528\u6237\u6570\u636e\u3001\u5206\u533a\u8868\u3001userdata \u6587\u4ef6\u7cfb\u7edf\u90fd\u4fdd\u7559\uff1b\u4f1a\u91cd\u5199 e5root \u5e76\u5237\u65b0 boot_b\u3002\n hotspot: E5-OpenWrt \u5bc6\u7801 / key: abcdefgh12\n \u4e8b\u52a1\u8bb0\u5f55 / transaction: /tmp/tmp6t3aia3w/package/reinstalls/20261015-190128-bcd7ad03/transaction.json\n",
|
||||
"stderr": ".\n\u9519\u8bef / error: encrypted userdata requires --format-userdata as explicit erase consent; -y alone is insufficient\n\n\u9519\u8bef / error: encrypted userdata requires --format-userdata as explicit erase consent; -y alone is insufficient\n\n\u9519\u8bef / error: encrypted userdata requires --format-userdata as explicit erase consent; -y alone is insufficient\n........\n----------------------------------------------------------------------\nRan 9 tests in 4.212s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/tf-single-root.py",
|
||||
"exit": 0,
|
||||
"stdout": "Creating regular file /tmp/tmpcs3z_wyu/tf.ext4\n",
|
||||
"stderr": ".....\n----------------------------------------------------------------------\nRan 5 tests in 0.223s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/part-root-boot.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ".....\n----------------------------------------------------------------------\nRan 5 tests in 0.038s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/userdata-size.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "...\n\u9519\u8bef / error: userdata image sizes must be aligned to MiB\n...\n----------------------------------------------------------------------\nRan 6 tests in 0.006s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/hybrid-package.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "./mnt/d/Git/e5-linux/tools/sprd-bt-config.py:26: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmp6iqbzmz9/raw/bt_configure_pskey.xpe.ini' mode='r' encoding='UTF-8'>\n for raw in open(path, errors=\"replace\"):\nResourceWarning: Enable tracemalloc to get the object allocation traceback\n/mnt/d/Git/e5-linux/tools/sprd-bt-config.py:26: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmp6iqbzmz9/raw/bt_configure_rf.xpe.ini' mode='r' encoding='UTF-8'>\n for raw in open(path, errors=\"replace\"):\nResourceWarning: Enable tracemalloc to get the object allocation traceback\n/mnt/d/Git/e5-linux/tools/vbc-profile/vbc-profile.py:92: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp6iqbzmz9/raw/dsp_vbc.xml'>\n head = path.open(\"rb\").read(4096)\nResourceWarning: Enable tracemalloc to get the object allocation traceback\n/mnt/d/Git/e5-linux/tools/vbc-profile/vbc-profile.py:92: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp6iqbzmz9/raw/audio_structure.xml'>\n head = path.open(\"rb\").read(4096)\nResourceWarning: Enable tracemalloc to get the object allocation traceback\n/mnt/d/Git/e5-linux/tools/vbc-profile/vbc-profile.py:92: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp6iqbzmz9/raw/cvs.xml'>\n head = path.open(\"rb\").read(4096)\nResourceWarning: Enable tracemalloc to get the object allocation traceback\n.......\n----------------------------------------------------------------------\nRan 8 tests in 1.175s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/gpt-plan.py",
|
||||
"exit": 1,
|
||||
"stdout": "",
|
||||
"stderr": "Traceback (most recent call last):\n File \"/mnt/d/Git/e5-linux/openwrt/tests/gpt-plan.py\", line 72, in <module>\n check('enough', 16384, [(1, 1, 1024, 'e5root')], True, 'debian-b')\n File \"/mnt/d/Git/e5-linux/openwrt/tests/gpt-plan.py\", line 63, in check\n assert (result.returncode == 0) == success, (name, result.stdout, result.stderr)\nAssertionError: ('enough', '', \"Unable to find image 'e5-openwrt-base:25.12.5' locally\\ndocker: error getting credentials - err: exit status 1, out: ``\\n\\nRun 'docker run --help' for more information\\n\")\nError in sys.excepthook:\nTraceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/apport_python_hook.py\", line 76, in apport_excepthook\n binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0]))\nFileNotFoundError: [Errno 2] No such file or directory\n\nOriginal exception was:\nTraceback (most recent call last):\n File \"/mnt/d/Git/e5-linux/openwrt/tests/gpt-plan.py\", line 72, in <module>\n check('enough', 16384, [(1, 1, 1024, 'e5root')], True, 'debian-b')\n File \"/mnt/d/Git/e5-linux/openwrt/tests/gpt-plan.py\", line 63, in check\n assert (result.returncode == 0) == success, (name, result.stdout, result.stderr)\nAssertionError: ('enough', '', \"Unable to find image 'e5-openwrt-base:25.12.5' locally\\ndocker: error getting credentials - err: exit status 1, out: ``\\n\\nRun 'docker run --help' for more information\\n\")\n",
|
||||
"status": "environment_blocked",
|
||||
"reason": "Required local e5-openwrt-base:25.12.5 Docker image is missing; no image or Docker installed for this task"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/image-keep-config.py",
|
||||
"exit": 0,
|
||||
"stdout": "== keeping the configuration of /tmp/tmp_9v4aiws/old-True\n== keeping the configuration of /tmp/tmp_9v4aiws/old-False\nPASS: bundled phone upgraded; contacts, credentials, settings and other apps preserved; legacy image fallback\n",
|
||||
"stderr": ""
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/update-ssh-host-key.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "s\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK (skipped=1)\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/boot-default.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ".........\n----------------------------------------------------------------------\nRan 9 tests in 0.251s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "e5-linux",
|
||||
"test": "openwrt/tests/android-loop.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "..........\n----------------------------------------------------------------------\nRan 10 tests in 0.085s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_desktop_installer.py",
|
||||
"exit": 0,
|
||||
"stdout": "Preparing shared rootfs / \u51c6\u5907\u5171\u4eab\u7cfb\u7edf\u5305\uff0c\u5254\u9664\u6784\u5efa\u673a\u56fa\u4ef6\u2026\n Rootfs ready / \u7cfb\u7edf\u5305\u51c6\u5907\u5b8c\u6210: 0.0 s\nCompatible repair package verified / \u4fee\u590d\u7248\u5173\u952e\u5b89\u88c5\u8f7d\u8377\u4e00\u81f4\uff0c\u53ef\u7ee7\u7eed\u7eed\u88c5\u3002\nPreparing shared rootfs / \u51c6\u5907\u5171\u4eab\u7cfb\u7edf\u5305\uff0c\u5254\u9664\u6784\u5efa\u673a\u56fa\u4ef6\u2026\n Rootfs ready / \u7cfb\u7edf\u5305\u51c6\u5907\u5b8c\u6210: 0.0 s\nPreparing shared rootfs / \u51c6\u5907\u5171\u4eab\u7cfb\u7edf\u5305\uff0c\u5254\u9664\u6784\u5efa\u673a\u56fa\u4ef6\u2026\n Rootfs ready / \u7cfb\u7edf\u5305\u51c6\u5907\u5b8c\u6210: 0.0 s\nReboot request sent / \u5df2\u53d1\u9001\u91cd\u542f\u8bf7\u6c42\u3002\nPreparing shared rootfs / \u51c6\u5907\u5171\u4eab\u7cfb\u7edf\u5305\uff0c\u5254\u9664\u6784\u5efa\u673a\u56fa\u4ef6\u2026\n Rootfs ready / \u7cfb\u7edf\u5305\u51c6\u5907\u5b8c\u6210: 0.0 s\nPreparing shared rootfs / \u51c6\u5907\u5171\u4eab\u7cfb\u7edf\u5305\uff0c\u5254\u9664\u6784\u5efa\u673a\u56fa\u4ef6\u2026\n Rootfs ready / \u7cfb\u7edf\u5305\u51c6\u5907\u5b8c\u6210: 0.0 s\nDevice / \u8bbe\u5907: V50 Android a Linux b\n",
|
||||
"stderr": "................................s.\n----------------------------------------------------------------------\nRan 34 tests in 0.450s\n\nOK (skipped=1)\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_desktop_fsck.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ""
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_desktop_free_space.py",
|
||||
"exit": 0,
|
||||
"stdout": "Device / \u8bbe\u5907: V50 Android a Linux b\neMMC / \u95ea\u5b58: 64.00 GiB; GPT unused / \u672a\u5206\u914d\u53ef\u7528: 32.00 GiB\n",
|
||||
"stderr": ".....\n----------------------------------------------------------------------\nRan 5 tests in 0.006s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_desktop_free_loop.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "sss\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK (skipped=3)\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_boot_image.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "......\n----------------------------------------------------------------------\nRan 6 tests in 0.368s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_bootchain.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ".................................\n----------------------------------------------------------------------\nRan 33 tests in 4.683s\n\nOK\n",
|
||||
"initial_failure": "BusyBox applet bypassed PATH dd fault injection; fixed fixture to explicitly call injected dd"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_update.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "............\n----------------------------------------------------------------------\nRan 12 tests in 1.486s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_update_lock.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ""
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_tf_format.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ".\n----------------------------------------------------------------------\nRan 1 test in 0.002s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_tf_slots.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "..\n----------------------------------------------------------------------\nRan 2 tests in 0.082s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_tf_reliability.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "..............\n----------------------------------------------------------------------\nRan 14 tests in 13.911s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_installer.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ".......\n----------------------------------------------------------------------\nRan 7 tests in 0.513s\n\nOK\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_board_recovery.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "sss\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK (skipped=3)\n"
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_block_probe.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": ""
|
||||
},
|
||||
{
|
||||
"repository": "mu300-linux-clean-tf-7.2",
|
||||
"test": "tests/test_android_loop.py",
|
||||
"exit": 0,
|
||||
"stdout": "",
|
||||
"stderr": "..........\n----------------------------------------------------------------------\nRan 10 tests in 0.081s\n\nOK\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"frozen_backend": true,
|
||||
"real_captured_m8_inputs": true,
|
||||
"hardware_access": false,
|
||||
"seconds": 0.562,
|
||||
"outputs": {
|
||||
"audio_structure": {
|
||||
"bytes": 48934,
|
||||
"matches_reference": true
|
||||
},
|
||||
"cvs": {
|
||||
"bytes": 55500,
|
||||
"matches_reference": true
|
||||
},
|
||||
"dsp_vbc": {
|
||||
"bytes": 124728,
|
||||
"matches_reference": true
|
||||
},
|
||||
"sprd/marlin3lite_pskey.bin": {
|
||||
"bytes": 176,
|
||||
"matches_reference": true
|
||||
},
|
||||
"sprd/marlin3lite_rf.bin": {
|
||||
"bytes": 252,
|
||||
"matches_reference": true
|
||||
}
|
||||
},
|
||||
"converter_stdout_captured": true,
|
||||
"named_conversion_stage": true
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3516928,
|
||||
"backend_and_tools_bytes": 43107925,
|
||||
"firmware_payload_bytes": 241030321,
|
||||
"archive_bytes": 209844698,
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"archive": "e5-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "abdf4f0ebcae9cc227361456b168b3e39d2837520fb02f43a76ed0f4e609d771",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "d8999b004311a644ae15c0ca8615c4b33c545d3fd01b08b0fc4ea5c4ea7abc97"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516928,
|
||||
"backend_and_tools_bytes": 43107925,
|
||||
"firmware_payload_bytes": 240109608,
|
||||
"archive_bytes": 209423580,
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"archive": "m8-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "d5bfa0c260ede177ff49e8b9ee7b1692bbc9f2186103c16bb1d23be5795062f2",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "d8999b004311a644ae15c0ca8615c4b33c545d3fd01b08b0fc4ea5c4ea7abc97"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516928,
|
||||
"backend_and_tools_bytes": 43107925,
|
||||
"firmware_payload_bytes": 240961398,
|
||||
"archive_bytes": 209867358,
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"archive": "t551m-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "eeecf78e6275b50f4c406552f559f74eb5edb3a6fe9a126296b7679d7a7ff217",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "d8999b004311a644ae15c0ca8615c4b33c545d3fd01b08b0fc4ea5c4ea7abc97"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,57 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3516928,
|
||||
"backend_and_tools_bytes": 46042946,
|
||||
"firmware_payload_bytes": 145582695,
|
||||
"archive_bytes": 119873074,
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-6.18.54-gui-1.0.0-windows.zip",
|
||||
"sha256": "3e985d4d9ea6c39e7cc64e74618b4c817a1d13ef914c50551a88120455ef1c28",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "d8999b004311a644ae15c0ca8615c4b33c545d3fd01b08b0fc4ea5c4ea7abc97"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3516928,
|
||||
"backend_and_tools_bytes": 46042945,
|
||||
"firmware_payload_bytes": 146076011,
|
||||
"archive_bytes": 120947596,
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-7.2.8-gui-1.0.0-windows.zip",
|
||||
"sha256": "6b01a4fab3e6f94d0530e134ffe3544316fae2b98f4bb15b391d8541d8bfc29b",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "d8999b004311a644ae15c0ca8615c4b33c545d3fd01b08b0fc4ea5c4ea7abc97"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n e5-openwrt-25.12.5-tf-20261015-030543 (6.18.54-e5-mobile4-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-helpers\\e5-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n m8-openwrt-25.12.5-tf-20261015-030719 (6.18.54-m8-probe12-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-helpers\\m8-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n t551m-openwrt-25.12.5-tf-20261015-030630 (6.18.54-t551m-otg10-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-helpers\\t551m-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-helpers\\mu300-openwrt-6.18.54-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-helpers\\mu300-openwrt-7.2.8-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"package_compatible": true,
|
||||
"status": "failed",
|
||||
"stage": "prepare",
|
||||
"effects": {},
|
||||
"hardware_access": false,
|
||||
"artifact_sources_match": true
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"revision": "20261015-helpers",
|
||||
"root_cause": {
|
||||
"reproduced": "Optimized frozen helper execution strips the VBC converter module docstring; argparse description initialization raises AttributeError.",
|
||||
"original_hang": "The original converter child remained alive without captured output or an execution timeout; the exact reason it remained alive is not established.",
|
||||
"supplied_final_error": "Exit 4294967295 followed deliberate termination of the host converter child after verifying that the saved transaction had no partition or boot-write effects."
|
||||
},
|
||||
"backend_tests": {
|
||||
"e5": {"run": 64, "passed": 64, "skipped": 0},
|
||||
"mu300": {"run": 64, "passed": 62, "skipped": 2},
|
||||
"new_helper_cases": 8
|
||||
},
|
||||
"browser_suites": {"passed": 6, "report": "ui-regression.json"},
|
||||
"targeted_device_script_tests": {
|
||||
"environment": "WSL Ubuntu 22.04, simulated commands and temporary files",
|
||||
"flash-diagnostics": 22,
|
||||
"part-two-stage": 9,
|
||||
"hybrid-package": 8,
|
||||
"install-entrypoints": 7
|
||||
},
|
||||
"windows_build": {"native_tauri_release": "passed", "pyinstaller_backend": "passed", "native_webview2_launch": "passed"},
|
||||
"real_m8_conversion": {"report": "helper-real-m8.json", "inputs": "Previously captured private firmware files; no device access", "reference": "All five output files match normal Python bytes"},
|
||||
"frozen_package_checks": {
|
||||
"packages": 5,
|
||||
"cli_ndjson_utf8_adb_start": "helpers-packages.json",
|
||||
"method_isolation": "helpers-frozen-methods.json",
|
||||
"simulated_backup_recovery_diagnostics_capacity": "helpers-frozen-flows.json",
|
||||
"zip_crc_and_single_system_payload": "passed for all five archives",
|
||||
"firmware_payload_hashes": "unchanged"
|
||||
},
|
||||
"user_saved_record": {"report": "helpers-record-compatibility.json", "compatible": true, "partition_or_boot_effects": 0},
|
||||
"hardware_installation_performed": false,
|
||||
"size_reports": ["helpers-e5-sizes.json", "helpers-mu300-sizes.json"]
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"model": "VIPME M8",
|
||||
"matched_saved_hardware_identity": true,
|
||||
"device_partition_writes": false,
|
||||
"device_temporary_staging": true,
|
||||
"method": "dd to /data/local/tmp + adb pull",
|
||||
"frozen_backend": true,
|
||||
"original_backup_preserved": true,
|
||||
"seconds": 17.94,
|
||||
"backups": [
|
||||
{
|
||||
"partition": "misc",
|
||||
"bytes": 4096,
|
||||
"seconds": 0.92,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "boot_a",
|
||||
"bytes": 67108864,
|
||||
"seconds": 3.48,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "boot_b",
|
||||
"bytes": 67108864,
|
||||
"seconds": 3.47,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "uboot_a",
|
||||
"bytes": 3145728,
|
||||
"seconds": 0.95,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "uboot_b",
|
||||
"bytes": 3145728,
|
||||
"seconds": 0.97,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "sml_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.88,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "sml_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.84,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "teecfg_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.91,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "teecfg_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.88,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "trustos_a",
|
||||
"bytes": 6291456,
|
||||
"seconds": 1.14,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "trustos_b",
|
||||
"bytes": 6291456,
|
||||
"seconds": 1.11,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "vbmeta_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.95,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "vbmeta_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.89,
|
||||
"sha256_readback_verified": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"model": "VIPME M8",
|
||||
"matched_saved_hardware_identity": true,
|
||||
"device_partition_writes": false,
|
||||
"device_temporary_staging": true,
|
||||
"method": "dd to /data/local/tmp + adb pull",
|
||||
"original_backup_preserved": true,
|
||||
"seconds": 17.7,
|
||||
"backups": [
|
||||
{
|
||||
"partition": "misc",
|
||||
"bytes": 4096,
|
||||
"seconds": 0.83,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "boot_a",
|
||||
"bytes": 67108864,
|
||||
"seconds": 3.39,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "boot_b",
|
||||
"bytes": 67108864,
|
||||
"seconds": 3.59,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "uboot_a",
|
||||
"bytes": 3145728,
|
||||
"seconds": 0.92,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "uboot_b",
|
||||
"bytes": 3145728,
|
||||
"seconds": 0.97,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "sml_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.91,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "sml_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.88,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "teecfg_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.91,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "teecfg_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.89,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "trustos_a",
|
||||
"bytes": 6291456,
|
||||
"seconds": 1.09,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "trustos_b",
|
||||
"bytes": 6291456,
|
||||
"seconds": 1.06,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "vbmeta_a",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.86,
|
||||
"sha256_readback_verified": true
|
||||
},
|
||||
{
|
||||
"partition": "vbmeta_b",
|
||||
"bytes": 1048576,
|
||||
"seconds": 0.86,
|
||||
"sha256_readback_verified": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3520000,
|
||||
"backend_and_tools_bytes": 43111260,
|
||||
"firmware_payload_bytes": 241030984,
|
||||
"archive_bytes": 210306332,
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"archive": "e5-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "8207e1b3223cc2f38340bca5970ff54a45baa049592292579549dc7c8aa5a1a5",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "c287e39628fe20a42d563f9b8b8272f8dd3bf19a0cb7134285e450dbfdc92f7e"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3520000,
|
||||
"backend_and_tools_bytes": 43111260,
|
||||
"firmware_payload_bytes": 240110271,
|
||||
"archive_bytes": 209885205,
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"archive": "m8-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "6e79a2f88489a7c1cd4a6b346974dd656899c57515de3a6c2aa8eafe5568b773",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "c287e39628fe20a42d563f9b8b8272f8dd3bf19a0cb7134285e450dbfdc92f7e"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3520000,
|
||||
"backend_and_tools_bytes": 43111260,
|
||||
"firmware_payload_bytes": 240962061,
|
||||
"archive_bytes": 210328993,
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"archive": "t551m-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "a28770c4a19bbeee3958dafdb0d27cf5ad02415789c2e809db3e0f8eea514043",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "c287e39628fe20a42d563f9b8b8272f8dd3bf19a0cb7134285e450dbfdc92f7e"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"checks": [
|
||||
"device dd -> adb pull, full hash and staging cleanup",
|
||||
"restart during final verification and final commit without replay",
|
||||
"explicit boot confirmation retargets wrong-CID endpoint and verifies capacity without replay",
|
||||
"committed update resumes without replay; EOF/refused connections remain normal waits; old boot rejected; new boot capacity verified; phase clock frozen",
|
||||
"persistent redacted diagnostic sharing"
|
||||
],
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"frozen_backend": true,
|
||||
"simulated_transport": true,
|
||||
"non_tf_probes": [
|
||||
"part",
|
||||
"reinstall",
|
||||
"image",
|
||||
"boot"
|
||||
],
|
||||
"reinstall_target": "mmcblk1p20",
|
||||
"reinstall_bytes": 4294967296,
|
||||
"tf_missing_card_rejected": true,
|
||||
"hardware_access": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3520000,
|
||||
"backend_and_tools_bytes": 46046998,
|
||||
"firmware_payload_bytes": 145582695,
|
||||
"archive_bytes": 120334718,
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-6.18.54-gui-1.0.0-windows.zip",
|
||||
"sha256": "18f7722af55444398b2fe042098f3835d1d89f8cda8a5d9459fdb11c246da47d",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "c287e39628fe20a42d563f9b8b8272f8dd3bf19a0cb7134285e450dbfdc92f7e"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3520000,
|
||||
"backend_and_tools_bytes": 46046997,
|
||||
"firmware_payload_bytes": 146076011,
|
||||
"archive_bytes": 121409251,
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"archive": "mu300-openwrt-7.2.8-gui-1.0.0-windows.zip",
|
||||
"sha256": "fffe5c806787569e2b24fd185e9e3d5b086e15db90ef2e4be85b5b35c0359fa9",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "c287e39628fe20a42d563f9b8b8272f8dd3bf19a0cb7134285e450dbfdc92f7e"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n e5-openwrt-25.12.5-tf-20261015-030543 (6.18.54-e5-mobile4-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-reboot-wait\\e5-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n m8-openwrt-25.12.5-tf-20261015-030719 (6.18.54-m8-probe12-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-reboot-wait\\m8-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n t551m-openwrt-25.12.5-tf-20261015-030630 (6.18.54-t551m-otg10-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-reboot-wait\\t551m-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-6.18.54-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 6.18\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-reboot-wait\\mu300-openwrt-6.18.54-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"commands": {
|
||||
"--check": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Package checksums passed / 安装包校验通过。\r\nElapsed / 总耗时: 0 s\r\n",
|
||||
"stderr": ""
|
||||
},
|
||||
"--check-boot": {
|
||||
"exit": 0,
|
||||
"stdout": "MU300 desktop package verified; kernel 7.2\r\nDesktop boot build verified: sd Android slot a (no device writes)\r\nDesktop boot build verified: install-part Android slot b (no device writes)\r\n\r\n========================================================\r\n[CHECK PASSED / 校验通过] Desktop boot construction passed / 桌面启动镜像构建检查通过。\r\nElapsed / 总耗时: 1 s\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "ValueError: Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\mu300-linux-clean-tf-7.2\\release\\gui-20261015-reboot-wait\\mu300-openwrt-7.2.8-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"revision": "20261015-reboot-wait",
|
||||
"root_cause": "Expected SSH transport loss during reboot was converted to a user-facing connection warning and waiting_user, despite the worker continuing to retry.",
|
||||
"behavior": {
|
||||
"expected_disconnect": "Normal waiting_device on automatic reboot, connection_state=reconnecting, no verification_error or warning/error toast",
|
||||
"transports": ["Connection refused", "Timeout", "Temporarily absent USB network", "SSH EOF", "SSH banner interruption", "Disconnect during remote read", "SSH close without exit status"],
|
||||
"diagnostics": "Sanitized DEBUG entries retain transport exception details",
|
||||
"retry": "No overall deadline; endpoint/password correction and explicit verification remain available",
|
||||
"real_errors": "Wrong hardware identity and SSH authentication retain actionable corrections",
|
||||
"completion": "Bound CID, changed update boot UUID and measured capacity remain required"
|
||||
},
|
||||
"backend_tests": {"e5": {"run": 79, "passed": 79}, "mu300": {"run": 79, "passed": 77, "skipped": 2}},
|
||||
"browser_suites": {"passed": 7, "report": "ui-regression.json", "reconnect_checks": "Neutral bilingual heading, no warning/error toast, repeated retries deduplicated, bounded 800x650 layout, retained endpoint controls and frozen terminal clock"},
|
||||
"windows_release_build": {"tauri": "passed", "frozen_backend": "passed", "native_webview2_launch": "passed"},
|
||||
"frozen_packages": {"count": 5, "cli_protocol_utf8_adb_start": "reboot-wait-packages.json", "method_routing": "reboot-wait-frozen-methods.json", "backup_recovery_and_update_disconnect_sequence": "reboot-wait-frozen-flows.json", "zip_crc_and_single_system_payload": "passed", "critical_firmware_hashes": "unchanged"},
|
||||
"hardware_access": false,
|
||||
"device_update_reboot_or_install_performed": false,
|
||||
"size_reports": ["reboot-wait-e5-sizes.json", "reboot-wait-mu300-sizes.json"]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n e5-openwrt-25.12.5-tf-20261015-030543 (6.18.54-e5-mobile4-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.5 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-refresh\\e5-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n m8-openwrt-25.12.5-tf-20261015-030719 (6.18.54-m8-probe12-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.4 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-refresh\\m8-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
},
|
||||
{
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"commands": {
|
||||
"--verify-package": {
|
||||
"exit": 0,
|
||||
"stdout": "\r\n== 检查刷机包 / checking the package\r\n\r | 校验文件 / verifying the files 0 s \r OK 校验文件 / verifying the files 0 s \r\n t551m-openwrt-25.12.5-tf-20261015-030630 (6.18.54-t551m-otg10-g020b970e351e-dirty)\r\nPackage verified / 安装包校验通过,未连接设备。\r\n\r\n============================================================\r\n[SUCCESS / 成功] 0.3 s\r\n============================================================\r\n",
|
||||
"stderr": ""
|
||||
}
|
||||
},
|
||||
"protocol_ok": true,
|
||||
"utf8_error": "Select a device / 请选择设备",
|
||||
"adb_version": "Android Debug Bridge version 1.0.41\r\nVersion 37.0.1-15733141\r\nInstalled as D:\\Git\\e5-linux\\out\\gui-releases\\20261015-refresh\\t551m-openwrt-gui-1.0.0\\tools\\adb.exe\r\nRunning on Windows 10.0.26100\r\n"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"gui_bytes": 3514368,
|
||||
"backend_and_tools_bytes": 43093921,
|
||||
"firmware_payload_bytes": 241029755,
|
||||
"archive_bytes": 209491549,
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"archive": "e5-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "a25ea2fb3e630714a0440826be3b3aadf0d020d1021825ce86f70f8571ed399b",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "4751d9f97e88f56c42a9a5160bb79527ef7b09fdad0f8b2a689517821ad2a036"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3514368,
|
||||
"backend_and_tools_bytes": 43093921,
|
||||
"firmware_payload_bytes": 240109042,
|
||||
"archive_bytes": 209070422,
|
||||
"package": "m8-openwrt-gui-1.0.0",
|
||||
"archive": "m8-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "2bcc3edb4474ab69a7608a1b53e9f6cc4c9286d949bce04d361b18917d96abda",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "4751d9f97e88f56c42a9a5160bb79527ef7b09fdad0f8b2a689517821ad2a036"
|
||||
},
|
||||
{
|
||||
"gui_bytes": 3514368,
|
||||
"backend_and_tools_bytes": 43093921,
|
||||
"firmware_payload_bytes": 240960832,
|
||||
"archive_bytes": 209514209,
|
||||
"package": "t551m-openwrt-gui-1.0.0",
|
||||
"archive": "t551m-openwrt-gui-1.0.0-windows.zip",
|
||||
"sha256": "a408e6d6ce73cb833c6c4ba02d024aa1aa1cc9eb424e38218e7e5e9d35cc136b",
|
||||
"payloads_unchanged": true,
|
||||
"gui_sha256": "4751d9f97e88f56c42a9a5160bb79527ef7b09fdad0f8b2a689517821ad2a036"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"package": "windows",
|
||||
"commands": [
|
||||
"hello",
|
||||
"devices",
|
||||
"devices",
|
||||
"list"
|
||||
],
|
||||
"verified_package_required": false,
|
||||
"device_counts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"states": [
|
||||
[
|
||||
"device"
|
||||
],
|
||||
[
|
||||
"device"
|
||||
]
|
||||
],
|
||||
"device_writes": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,48 @@
|
||||
[
|
||||
{
|
||||
"package": "e5-openwrt-gui-1.0.0",
|
||||
"commands": [
|
||||
"hello",
|
||||
"devices",
|
||||
"devices",
|
||||
"list"
|
||||
],
|
||||
"verified_package_required": false,
|
||||
"device_counts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"states": [
|
||||
[
|
||||
"device"
|
||||
],
|
||||
[
|
||||
"device"
|
||||
]
|
||||
],
|
||||
"device_writes": false
|
||||
},
|
||||
{
|
||||
"package": "mu300-openwrt-7.2.8-gui-1.0.0",
|
||||
"commands": [
|
||||
"hello",
|
||||
"devices",
|
||||
"devices",
|
||||
"list"
|
||||
],
|
||||
"verified_package_required": false,
|
||||
"device_counts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"states": [
|
||||
[
|
||||
"device"
|
||||
],
|
||||
[
|
||||
"device"
|
||||
]
|
||||
],
|
||||
"device_writes": false
|
||||
}
|
||||
]
|
||||