Repository navigation
新增按实例启用 KernelSU 与一键批量导入模块(ReZygisk、LSPosed 等) - #221
Merged
Merged
Conversation
2 tasks done
Contributor
Author
|
审查了
在本机临时测试目录,用测试替身确认了第二次启动失败后旧 ramdisk 未恢复,以及从未启用的实例仍会调用清理。相关 Go 测试和 35 项前端测试通过。模拟器包测试使用固定实例编号避开沙箱对端口枚举的限制,本轮未实机启动或删除客体数据。 |
Member
|
审了 对你那两条 P1 的补充
新增一条要先改的
建议这一轮一起改的
小的
核过、没看出问题的
没验证的都是读码加离线测试,没有上机。「换内核后开不了机」是按机制推断的。启用后每个系统调用都要过模块代码,帧率和 CPU 的影响没量。ModAVD/ModAVD#124 里最看重的那一项(执行桥的文件在游戏进程里还在不在)这次也没核。 |
Member
|
补一条上次留着没定的: 这个 PR 这边要跟着做的:
ModAVD/ModAVD#303 那边配套的:
|
This was referenced Nov 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 29, 2026
qiyinxi
added a commit
to qiyinxi/ModAVDManager
that referenced
this pull request
Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么 / What changed
参考现有 Google Play 商店(
components import-playstore+playstore <i> install+ 管理器 UI)的组织方式,新增按实例启用 KernelSU 与一键批量导入模块(ReZygisk、LSPosed / Vector 等)的完整链路(配套的kernelsu.koCI 可复现构建见 ModAVD/ModAVD#303):internal/kernelsu/):kernel-ranchubzImage 头提取内核版本,并校验kernelsu.ko为 x86_64 ELF、name=kernelsu且vermagic匹配当前系统镜像内核(在开机前直接拒绝官方通用6.1.166KMI 错配模块)。lz4_legacy+newc cpioramdisk 修补器,完整保留第二段 vendor ramdisk(fstab.ranchu与/lib/modules),为单个实例原子写入avd\mas_<i>.avd\modavd-ramdisk.img,不改动全局系统镜像。.zip的module.prop,支持按依赖顺序(metamodule → Zygisk → LSPosed / 其他)自动排序。internal/root、internal/components、internal/emu):sdk\kernelsu存放 5 个组件文件(kernelsu.ko、ksuinit、ksud、KernelSU.apk、meta-overlayfs.zip),其中后 4 项锁定上游版本大小与 SHA-256,kernelsu.ko按当前系统镜像内核vermagic校验。launchPlanFor在avd\mas_<i>.avd\modavd-ramdisk.img存在时自动附带-ramdisk。KernelSU(install/uninstall [--purge]/status)、KernelSUModules、KernelSUInstallModules、KernelSURemoveModule:启用时自动打补丁、冷启动 1 装入ksud(执行ksud install)+ KernelSU Manager +meta-overlayfs、冷启动 2 激活模块系统并记录instances.<i>.kernelsu;批量刷入模块支持一次传入多个.zip并单次冷启动生效。internal/cli、internal/ui、internal/i18n):components import-ksu <文件或文件夹>...、components status展示 KernelSU 组件状态,新增ksu <i> install|uninstall [--purge]|status|modules|module install <zip>... [--no-reboot]|module remove <id> [--no-reboot]。changelog.d/kernelsu-module-import.feat.md。changelog.d/kernelsu-module-import.feat.md的英文行以及internal/i18n/locales/en/*.json新增的英文词条由英文意译生成,请审阅时一并核对。怎么验证的 / How it was verified
gofmt -l .:无差异go vet ./...(Windows、GOOS=darwin GOARCH=arm64、GOOS=linux GOARCH=amd64):全部通过go test ./internal/kernelsu/... ./internal/components/... ./internal/emu/... ./internal/cli/... ./internal/ui/... ./internal/i18n/...(含新增的 KernelSU 单测及TestCatalog):全部通过node --test scripts/test_display_tap.mjs scripts/test_disk_info.mjs scripts/test_compact_format.mjs scripts/test_card_cfg.mjs(14/14 通过)与node --experimental-vm-modules --test scripts/test_create_cancel.mjs(21/21 通过)python -B -I -X utf8 scripts/privacy.py . --allowlist scripts/privacy-allowlist.json(0 failures)、python -B -I -X utf8 scripts/test_repo_checks.py(3/3 通过)、python -B -I -X utf8 scripts/repo_checks.py commits(0 failures)pwsh -NoProfile -File build.ps1:成功编译out\tools\modavd.exe与out\ModAVD.exeClozyA/ModAVDManager#1):checks (windows-2025):通过(6m10s,全量go test ./...、build.ps1、Node 测试、隐私与词条检查全部通过)portable (macos-15):通过(1m47s)portable (ubuntu-24.04):通过(46s)create-cancel:通过(16s)Workflow security (zizmor):通过(13s)shared-scripts:通过(8s)google_apisx86_64 r14 测试实例,全程使用新建测试实例与私有 adb 端口,未改动主力实例):modavd components import-ksu导入 新增 KernelSU LKM(kernelsu.ko)CI 可复现构建工具与工作流 ModAVD#303 CI 编译产出的a14-api34-6.1_kernelsu-v3.3.1_kernelsu.ko与上游 4 个文件,components status报✓ KernelSU 3.3.1(内核 6.1.23,可选,导入的)。modavd ksu 2 install自动生成modavd-ramdisk.img、完成两次冷启动并激活ksud 3.3.1 (uapi: 5)与meta-overlayfs 1.3.1,原关机实例做完后自动正常关机。modavd ksu 2 module install Vector-v2.2-3080-Release.zip ReZygisk-v1.0.0-release.zip(故意将 Vector 排在前面)自动按ReZygisk→Vector顺序刷入并单次冷启动生效。modavd start 2自动附带-ramdisk正常开机;ksu 2 status/ksu 2 modules正常列出 3 个已启用模块;ReZygisk状态为[Monitor: ✅, ReZygisk 64-bit: ✅];客体库补丁挂载触发 zygote 重启后模块与执行桥均保持存活;bridge 2 verify核对全过;stop 2正常关机。ksu uninstall --purge仅通过单元测试验证,未在实机上执行破坏性清理。核对 / Checklist
changelog.d/<名字>.<feat|fix|change|remove>.md,两行:先中文、再英文X.md、X.en.md)两份都改了(本次未改动已有成对文档;新增英文 i18n 与 changelog 英文行已在上方说明)Refs ModAVD/ModAVD#124