Repository navigation
导入游戏:MuMu 实例信息解析、传输核对、临时目录清理、运行检查 - #211
Merged
Merged
Conversation
从 info -v all 的输出里逐个找顶层 JSON,取带 index 和 name 的那份, 兼容按编号的字典和单个实例对象;就绪判断在 is_android_started 之外 加 is_process_started 加 player_state 为 start_finished 且没有 launch_err_code 的兜底;某个模拟器读不出来时,只在列表里多一行带 错误说明的记录,不再让整个列表失败;顺手找旧版的 shell\MuMuManager.exe。 Refs ModAVD/ModAVD#270
以前要等所有资源都发布完才比对实际传输的字节数和开始时统计的是否一致, 源端游戏还在写文件时,被截断的文件已经进了最终目录,重试就报 already_exists。 现在发布之前先比对这一项,不一致就不发布,只清掉这一项的临时目录。 Refs ModAVD/ModAVD#271
拿到实例锁以后,在这次要写的资源父目录和 /data/local/tmp 里,删掉名字 精确匹配 .modavd-import.???????? 的旧目录,再核对空间、开始传输;已安装的 游戏在空间检查前就按应用 UID 清资源目录,没装的在装完拿到 UID 之后清。 清理失败只记一条警告,不挡住导入。 Refs ModAVD/ModAVD#272
目标端游戏开着会一边下载一边合并,源端游戏开着文件会在拷贝中变化。 开始前只读地列出两端的进程名(ps -A -o NAME),某个要导入的游戏的 主进程或“包名:服务名”的辅助进程在运行就拒绝并提示先退出,不替用户 结束游戏;列不出进程(没有 ps、adb 出错)按失败处理,不猜。 Refs ModAVD/ModAVD#273
This was referenced Nov 27, 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.
改了什么
从模拟器导入游戏的四处 P2 问题,一个 issue 一个提交:
index和name的;返回单个实例对象时照样能读;没有管理员权限时,is_android_started一直是 false,改用is_process_started加player_state为start_finished且没有launch_err_code兜底,选 MuMu 源不再空等 3 分钟。某个模拟器读不出来时,只在/api/game-sources里多一行index为 -1、带error说明的记录(界面里灰掉,命令行里也显示),其余模拟器照常列出。旧版的shell\MuMuManager.exe也会找。already_exists。/data/local/tmp里,删掉名字精确匹配.modavd-import.????????的旧目录再开始。已安装的游戏在空间检查之前就按应用 UID 清资源目录,没装的在装完拿到 UID 之后清。清理失败只记一条警告,不挡导入。ps -A -o NAME),要导入的游戏的主进程或“包名:服务名”的辅助进程在运行就拒绝并提示先退出,不替用户结束游戏;列不出进程按失败处理。这个功能还没发过版,没有加
changelog.d。单测
shell\旧路径;一个来源失败时其他来源仍列出。sh跑清理命令(没有 POSIXsh时跳过),只删精确匹配的目录;importGame流程里清理先于空间检查和第一次建临时目录。测试里的 adb、控制程序和根目录都是假的或临时目录。
本地检查
go vet ./...、go test ./...通过,gofmt -l .无输出。GOOS=darwin GOARCH=arm64、GOOS=linux GOARCH=amd64下go vet ./...通过。node --experimental-vm-modules --test scripts/test_*.mjs:78 项通过(改了internal/ui/web/js/game-import.js一行,没有对应它的脚本测试)。实机测试
环境:开发版
modavd.exe直接带临时根运行,未提权;目标是临时建的 4 GB 实例,测完已删;源是一台 MuMu 实例,游戏明日方舟(APK 约 1.9 GB)。.modavd-import.*被清掉,重导完成(#272)。这一轮只覆盖安装包的临时目录;资源父目录里的清理只靠单测。Refs ModAVD/ModAVD#270
Refs ModAVD/ModAVD#271
Refs ModAVD/ModAVD#272
Refs ModAVD/ModAVD#273