Skip to content

fix: 升级 zip 到 9 并适配 ZIP 读取/写入 API - #72

Merged
kairowan merged 1 commit into
mainfrom
fix/zip-9-upgrade
Nov 4, 2026
Merged

kairowan merged 1 commit into
mainfrom
fix/zip-9-upgrade

Conversation

@kairowan

@kairowan kairowan commented Nov 4, 2026

Copy link
Copy Markdown
Owner

改动

将直接使用的 zip 从 2.4 升级到 9.3.0,适配 zip 9 API:

  • ZipFile::name() 现在返回 Result<Cow<str>, ZipError>,所有读取路径改为显式传播错误或持有 String。
  • ZipFile<'_> 改为带 Read 泛型。
  • ZipArchive::data_start() 返回 Option<u64>,对齐校验缺失偏移时失败关闭。
  • file_names() 迭代项变为 Result,测试与模块解析同步调整。
  • zip 9 移除了 raw ZIP64 注释 API;标准归档注释仍按原字节保留,ZIP64 扩展注释不再复制。

覆盖 shield-core、shield-cli、shield-ios、GUI 后端;未修改业务保护策略。

验证

  • cargo fmt --all --check
  • cargo clippy -p shield-core -p shield-ios -p shield-cli --all-targets -- -D warnings
  • cargo clippy -p mocika-shield --all-targets -- -D warnings
  • cargo test -p shield-core、-p shield-ios、-p shield-cli、-p mocika-shield
  • cargo test -p shield-core connection_probe_real_tls -- --ignored
  • cargo test -p shield-core v7_java_whitebox -- --ignored
  • cargo test -p shield-ios official_sdk_import_reuse_and_offline_resolve -- --ignored
  • make build-stub build-byos build-byos-play
  • make test-pvm2、PVM2_SANITIZER=undefined make test-pvm2-runtime、make test-fusion、make audit-stub-dex
  • bash tests/scripts/run-protect-e2e.sh(无设备)
  • HONOR Android 15 真机 strict/PVM2 E2E
  • 7 模块 AAB 重新加固、bundletool 校验和 APKS 生成
  • Python 维护脚本测试

已知边界

  • tauri-plugin-updater 2.12.0 仍传递依赖 zip 4.6.1,其公告未消除;直接业务路径已使用 zip 9。需要等上游插件升级或单独评估替换。
  • cargo deny 本轮因 GitHub 网络问题无法刷新 RustSec 数据库;离线检查只剩上述传递依赖和无人维护公告。
  • ZIP64 扩展注释不再保留;标准 ZIP 注释保留。该字段在 APK/AAB 中极少使用,但属于行为变化。

@kairowan
kairowan merged commit 8716ccb into main Nov 4, 2026
13 checks passed
@kairowan
kairowan deleted the fix/zip-9-upgrade branch November 4, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant