Skip to content

USB Debug Guard v0.1.3

Choose a tag to compare

@Nongfsq Nongfsq released this 03 Aug 08:38

USB Debug Guard v0.1.3

Signing-key migration: v0.1.3 cannot be installed directly over v0.1.2. Disable the guard and confirm display restoration, uninstall v0.1.2, then install v0.1.3 and grant Root again. Releases from v0.1.3 onward use the new certificate documented in docs/RELEASE.md.

Safety release

This release repairs the Root failure loop from v0.1.2 and adds a user-initiated update check.

  • Checks the official GitHub Releases API only when the user taps Check updates.

  • Opens the fixed official release page when a newer version is available; it never silently downloads or installs APKs.

  • Advances the repaired build to versionCode 4 so it cannot be confused with incident build v0.1.2.

  • Tracks the direct su PID and the privileged command-shell PID, terminates the known process tree on timeout, and reports destroy-failed whenever a known process cannot be confirmed exited.

  • Preserves the original display snapshot as a crash-consistent transaction until restoration succeeds.

  • Uses fail-fast Root command chains and a named, validated settings-capture protocol.

  • Limits explicit Root recovery to one persisted attempt per circuit incident after a short cooldown.

  • Keeps the service and warning state alive when display restoration fails.

  • Treats only Android USB data-state broadcasts as USB connectivity; charging alone no longer activates protection.

  • Refreshes the UI from lifecycle and preference events instead of a background two-second loop.

  • Requires emulator-only explicit serial selection in tools/install.ps1.

  • Excludes Root safety preferences from backup and device transfer, and pins the Gradle distribution checksum.

Validation

  • Local JVM/static regression script: 42 tests.
  • Android 16/API 36 emulator instrumentation: 4 tests.
  • Six-minute AVD trigger burst: 71 rounds / 284 actions with no Root call growth after the first denial.
  • Two deep-idle interval checks with the Root diagnostic count remaining at one.
  • Android lint, debug/release build, zip alignment, APK Signature Scheme v2/v3, certificate, and SHA-256 verification pass.

No test APK was installed on the incident OnePlus 11.


USB 调试守护 v0.1.3

**签名密钥迁移:**v0.1.3 不能直接覆盖安装 v0.1.2。请先关闭守护并确认显示设置已恢复,卸载 v0.1.2,再安装 v0.1.3 并重新授予 Root。v0.1.3 起使用 docs/RELEASE.md 记录的新证书。

安全修复版本

本版本修复 v0.1.2 的 Root 失控循环,并新增用户主动检查更新功能。

  • 仅在用户点击“检查更新”时查询官方 GitHub Releases API。

  • 发现新版本后只打开固定的官方发布页,不会静默下载或安装 APK。

  • 版本提升为 versionCode 4,避免与事故版本 v0.1.2 混淆。

  • 跟踪直接 su PID 和特权命令 shell PID;超时后清理已知进程树,任何无法确认退出的进程都会记录为 destroy-failed。

  • 将原始显示设置快照作为崩溃一致事务保存到恢复成功为止。

  • Root 命令改为失败即停止,并使用带字段名且严格校验的设置采集协议。

  • 每次熔断事故只允许一次持久化的显式 Root 恢复尝试,并设置短暂冷却期。

  • 显示设置恢复失败时保持服务和告警状态。

  • 仅将 Android USB 数据状态广播视为 USB 连接;单纯充电不再激活保护。

  • UI 改用生命周期和偏好变化事件刷新,不再后台每两秒轮询。

  • tools/install.ps1 强制指定模拟器序列号并拒绝真实设备。

  • Root 安全偏好不参与备份或设备迁移,并固定 Gradle 分发包校验和。

验证

  • 本地 JVM/静态回归脚本:42 项测试。
  • Android 16/API 36 模拟器 instrumentation:4 项测试。
  • AVD 6 分钟集中触发:71 轮、284 个动作,第一次拒绝后 Root 调用数不增长。
  • 两次 deep-idle 间隔检查,Root 诊断数始终为 1。
  • Android lint、debug/release 构建、zip alignment、APK Signature Scheme v2/v3、证书和 SHA-256 验证通过。

未在事故 OnePlus 11 上安装测试 APK。