Skip to content

发版:ModAVDManager v0.4.0 (#76)

Choose a tag to compare

@github-actions github-actions released this 05 Nov 15:20
· 63 commits to main since this release
Immutable release. Only release title and notes can be modified.
86616eb

ModAVDManager v0.4.0

  • ModAVD.exe:43fdc07fb58114f4b444472f5b4e76dbf1c6d3d399a7b6aa5a2efc7b24a84746
  • tools/modavd.exe:189bbd078e3aad8315e94d52bdb6125aebc31e8a3870920957fbd3821b638d2f

随 ModAVD 0.38.0 进包。下面是相对 v0.3.1 的改动。

新增

  • 按应用走代理:可以让实例里只有你指定的几个应用(比如某个要走海外线路的游戏)经过代理上网,其余应用照常直连。

    • 命令行:modavd proxy <编号> 看设置;on / off 开关(on --server socks5://IP:端口,也可写 http://…,或 --server auto 取这台电脑的代理设置);--add / --remove / --apps 改应用名单(填包名);test 在这台电脑上探测代理是什么协议、UDP 通不通。代理地址写 127.0.0.1 或 localhost 时,会记成实例里看到的宿主地址 10.0.2.2。
    • 设置存在 mas-avd.json 里这台实例名下,开机后的第一步挂上规则,运行中改了马上生效;设置关着的实例开机时,不碰客体。
    • 实例卡片菜单里多一项「按应用走代理…」(开关、地址、应用名单,有「从系统代理读取」和「检测」按钮),开着这个设置的卡片上有「代理」标记:绿色是已生效,黄色是正在补规则或最近一次连接没成功,红色是名单里的应用现在断网或直连。
    • 目前不支持要账号密码的代理:auto 取到带账号密码的地址时只留 host:port,并提示。代理断了,名单里的应用就断网。
    • 规则挂不上(客体里没有 root、守护进程对不上等)时,名单里的应用会直连;开机不受影响,原因写进 start 返回的警告。

    (ModAVD/ModAVD#81,ModAVDManager#44、ModAVDManager#53)

  • 数据盘回收 modavd disk <编号> info | trim | compact:

    • info:数据盘的逻辑大小、在这台电脑上实际占的大小、已分配和估计能回收的大小。只读,开着机也能看(开着机时只给前两项)。
    • compact:关机后把数据盘重写一遍,丢掉客体已经删掉的内容,把文件缩小。整理前先检查剩余空间,只在 NTFS / ReFS 上做;数据盘有内部快照、实例有内存快照时拒绝;新盘要通过 qemu-img check 和逐字节比对才会换上,任何一步失败都留着原盘。整理期间这台实例开不了机。
    • trim:对开着的实例触发一次客体回收,开机完成后也会自动做一次(每台最多每 24 小时一次)。这一版的模拟器还没有 discard,trim 不会真正回收空间:手动 modavd disk trim 会报「不支持」(退出码 4),开机自动 trim 检测到没有 discard 就直接跳过。要省空间,用 modavd disk compact。
    • 管理器界面每台实例加了「磁盘占用」「回收空间」「整理磁盘」三个按钮;MCP 加了 disk_info、trim_disk、compact_disk 三个工具。

    (ModAVD/ModAVD#2,ModAVD/ModAVD#95,ModAVDManager#47)

  • 开机失败或超时时,会留下客体现场:开机超时、开机后设置失败、新建的期限到了,而模拟器还在时,返回之前把客体的 logcat、dmesg、系统属性、进程列表、内存信息收进 logs\mas_<编号>-<时间>-bootfail\。你主动取消(Ctrl+C、MCP 取消、管理器里取消任务)、这台实例正在关机、模拟器已经不在时不收。每台实例留最新 3 份,算进 logs\ 的 1 GiB 上限;收集问题信息(collect-info)时带上最新 3 份,合计到 100 MB 为止。里面的 logcat 等可能带账号信息,只存在本机,发问题包前请自己看一眼。(ModAVD/ModAVD#79,ModAVDManager#50)

变更

  • 新建实例默认 1080p(1920×1080,DPI 280);720p(1280×720,DPI 240)留作第二档。管理器新建和实例设置、modavd create / modavd set 的 --resolution 1080|720、MCP 的 create_instance / update_instance 共用这两档,DPI 跟着档位一起换,不用单独设。

    • 已有的实例保留原来的设置:只按宽高认档位,1920×1080(横屏或竖屏)算 1080p,其余和缺字段的旧配置都算 720p。换档时一次写入宽、高、DPI,保留横竖屏方向;开机前按当前档位规范化,不再固定写回 720p。
    • 运行中改了分辨率,下次冷启动才生效。同时修了一处:运行中改档以后,管理器画面上的点击会按“下次开机的尺寸”换算而点歪,现在按当前截图的尺寸算,竖屏画面的留白不发送点击。
    • 旧版的 modavd 不认 1080p;AUTO-MAS 配套的支持见调用方一节。

    (ModAVD/ModAVD#100,ModAVDManager#61)

  • modavd stop 对新建中的实例变了:以前可以直接把初始化打断,现在默认报忙(退出码 5),--force 也不例外,初始化继续做完。确实要打断,要显式加 --cancel-create(MCP 是 cancel_create;管理器里外部进程在新建的实例,「取消新建」会显式带上)。打断照样走 sync 和安卓的正常关机,这台实例的状态变成 create_failed,之后用 modavd create --resume <编号> 接着做;stop --json 的结果里 interrupted_create 为 true。stop --all 会关掉所有在跑的实例,包括新建中的,并逐台标出 interrupted_create。(ModAVD/ModAVD#103,ModAVDManager#54)

  • 根目录整个搬走以后,装过执行桥的实例也能开机了。以前搬走以后数据盘覆盖层还指着旧的 SDK 位置,开机报 Could not open backing file。现在可写冷启动时会记下实例 system / vendor 原始镜像的路径、大小和 SHA-256;搬走后路径失效时,先核对新位置的两块镜像和记录一致,再把覆盖层改指过去。

    • 老实例要先在原位置用新版冷启动、关机一次(记下摘要),再搬整个根目录。已经搬走又没有摘要,或者候选镜像缺失、大小或摘要对不上时,开机返回 precheck_failed(退出码 4),提示是哪块覆盖层、原路径、候选路径和怎么处理,什么都不改。
    • 这个检查在管理器、命令行和 AUTO-MAS 调的包内命令行里都一样。

    (ModAVD/ModAVD#99,ModAVDManager#55)

  • 更新换包(modavd update):

    • 关机命令返回后,退出看门狗和开机守护可能还活着,以前会立刻拒绝更新;现在最多等 30 秒让它们退场,超时才拒绝,并列出还活着的进程名和 PID。
    • 以前换包前扫描完、换包前的那一刻,如果有人直接启动 emulator,或者另一个共用同一份 SDK 的根目录启动,更新仍会继续换包。现在换包期间先拿住本根目录所有编号的启动锁,再按文件 ID 把 SDK 里的程序文件都占住,换包全程(包括备份、重命名、出错恢复)新的启动都会被拦下,最后再扫一遍,有新占用就拒绝、什么都不动。
    • ModAVD 根目录所在的盘要支持按文件 ID 打开程序文件(NTFS 可以)。放在 exFAT / FAT32 上的根目录,自动换包会被拒绝、什么都不动,请手动下载整包。只读、权限不够、有程序被占用时也一样拒绝。

    (ModAVD/ModAVD#77,ModAVDManager#58)

  • 磁盘整理期间,这台实例的开机(start)、删除(delete)和执行桥安装会马上报忙,提示「正在整理磁盘」,不再傻等。disk info 在拿不到锁或读不到数据时不再报错,改成给出能读到的文件头大小和宿主占用,并在 warnings 里写明哪些没算、为什么;读不到的数值直接省略(比如拿不到宿主占用时,on_disk_bytes 这一项就不出现)。数据盘损坏时,info 的提示会说明它检查了什么,并给出备份、恢复、保留副本排查,或确认放弃数据后删除重建的处理建议。(ModAVD/ModAVD#95,ModAVDManager#63)

  • 整理磁盘(disk compact):覆盖层本身是符号链接(包括悬空的)或有多个硬链接时,在动手之前拒绝(unsupported,退出码 4),提示路径、原因和怎么办,不会在中途写坏链接的另一头。(ModAVD/ModAVD#95,ModAVDManager#59)

  • 管理器被外部结束时,磁盘整理、查看用的 qemu-img 子进程也会跟着结束,不再继续占着数据盘的覆盖层。(ModAVD/ModAVD#95,ModAVDManager#60)

  • 非 Windows 平台上,打开日志目录、显示 / 隐藏窗口这类只有 Windows 才支持的操作,现在明确返回「不支持」,不再先建目录再报内部错误,也不再把查不到进程当成实例离线而报成功。Windows 上的行为不变。(ModAVD/ModAVD#74,ModAVDManager#49)

  • 组件下载(components fetch)和 modavd update 的下载合成同一套:共用连接、响应等待和“响应体停顿”超时(连接等 20 秒、读取停顿 30 秒),续传时严格核对服务器回的范围,带管理器版本号的 User-Agent,网络错误和 CDK 在输出里脱敏。Mirror 酱每次从头下载;更新下了一半的 .part 重新下,已经校验过的完整文件仍可复用。

    • 补全组件的边界:搬目录失败或后缀冲突、旧目录位置、完整的坏缓存、超时参数超范围、只设了 NO_PROXY 时用系统代理、重试时取消、重复的 ZIP、剩余空间、日志。--help 里写明许可被拒是退出码 2,退出码 9 也包括代理不可用。
    • 收集问题信息:修了新版 adb 的 logcat 请求,ZIP 用本地时间,查盘信息失败时取消并等盘类型查询结束,根目录和暂存目录展开 8.3 短名;ZIP 做完之前取消会删掉半个 ZIP,默认清理暂存目录,加 --keep-stage 则保留并返回路径;普通打包失败时已收集的文件仍保留。

    (ModAVD/ModAVD#91、ModAVD/ModAVD#72、ModAVD/ModAVD#73,ModAVDManager#51)

  • 磁盘整理按工作量定时限:转换、比对各按虚拟容量加预算(下限 30 / 20 分钟,大盘可以到数十小时,正常整理基本不会超时,要停就取消);预计能回收的不足 16 MiB 与宿主占用 1% 中的较大者时,跳过重写,不再白白重写整个盘。disk compact 的结果新增带符号的 on_disk_delta_bytes(整理后减整理前,占用增加时为正)和 skipped 等字段,freed_bytes 和前后占用字段保留;界面上整理磁盘可以中途取消。(ModAVD/ModAVD#95,ModAVDManager#65)

  • 宿主上正在写的模拟器 logcat 每到 256 MiB 切一份,每台保留最新 10 份已关闭的,已关闭的合计上限 1 GiB,不再无限长大。采集进程绑定这次开机的模拟器,模拟器退出时自己退出,不会遗留下来占着管理器程序、挡住整包更新。(ModAVD/ModAVD#97,ModAVDManager#57)

  • 磁盘回收的界面和日志改了说法,区分“触发请求已返回”和“客体回收已完成”:管理器里运行中显示「已进行」,返回后显示「触发请求用时」和「已触发」,说明写明不等安卓回收完成;命令行的「已触发磁盘回收」不变。(ModAVD/ModAVD#95,ModAVDManager#64)

说明

  • 磁盘整理(disk compact)会重写整个数据盘,需要和已分配大小差不多的空闲空间(按已分配的 1.05 倍再加 2 GiB 估算),不够时会拒绝并提示要腾出多少。
  • 按应用走代理的已知限制:AUTO-MAS 写 mas-avd.json 时不拿 mas-avd.json.lock,它和 modavd 同时改这个文件时,后写的会把先写的冲掉,代理设置的修改也可能因此丢;不经过 modavd 开机的实例,这次开机没有规则,名单里的应用直连;客体重启后规则最多晚 5 秒补上,这几秒名单里的应用直连。

给调用方(AUTO-MAS)

  • protocol 还是 2:只加了命令、字段、工具和错误码,没有删字段,也没有改已有退出码的含义。(internal/buildinfo 里 Protocol = 2。)
  • 新命令:proxy(<i> [on|off|test] [--server …] [--add …] [--remove …] [--apps …])、disk(<i> info | trim | compact)。stop 加了 --cancel-create。create、set 的 --resolution 取 1080 或 720,新建不写就是 1080。
  • stop 的行为变了(ModAVDManager#54):新建中的实例,stop(含 --force)默认返回 busy(退出码 5),不再打断初始化。AUTO-MAS 如果以前靠 stop 打断新建,要改成显式加 --cancel-create;打断后 create 以退出码 8(已取消)结束,实例状态 create_failed,用 create --resume <编号> 接着做。stop --json 的结果里 interrupted_create 在被打断时为 true;stop --all 会连新建中的一起关,并逐台标出这个字段。
  • 新字段:
    • list、info 里的实例多一个 app_proxy(开关、地址、名单个数;没设过是 null)。modavd proxy --json 的 data 里 applied 取值 now、booting、next_boot、off、failed。
    • disk info --json:index、overlay、running、needs_shutdown、logical_bytes、on_disk_bytes、allocated_bytes、reclaimable_bytes、warnings。on_disk_bytes、allocated_bytes、reclaimable_bytes 在读不到、算不出时会省略(不是 0),原因写在 warnings,不要把缺省当成 0 处理。disk compact --json:before_on_disk_bytes、after_on_disk_bytes、freed_bytes。
    • 开机失败、超时等错误的 --json 里,error.details.boot_diag_dir 是客体现场所在的目录(没有就不出现)。
  • 新错误码 proxy_unavailable(代理不通、不是 SOCKS5 / HTTP,或 auto 时宿主没设代理),退出码沿用 9(和更新、组件下载不可用同一个)。precheck_failed(退出码 4)现在也会因“搬走根目录后接不回执行桥的后备镜像”而出现。
  • 新的 MCP 工具:get_app_proxy(只读)、set_app_proxy、disk_info、trim_disk、compact_disk;stop_instance 多一个 cancel_create 参数;create_instance / update_instance 多 resolution(1080 / 720)。
  • 创建实例默认 1080p:经包内 modavd 新建、不传 --resolution 的实例是 1080p;旧实例不受影响。要 720p,新建时显式传 --resolution 720。旧版 modavd 不认 1080p。
  • ModAVD 根目录所在的盘不支持按文件 ID 打开程序文件(exFAT / FAT32)时,update 返回 not_ready 并什么都不动。

下载与核对

使用 Go 1.26.5、GOTOOLCHAIN=local,运行仓库中的 build.ps1 可以编出相同字节。单独下载包还包含 Go 许可原文和文件清单;请用附件 SHA256SUMS.txt 核对 zip 和解压出的两个 exe,例如在 PowerShell 里运行 Get-FileHash .\ModAVDManager-0.4.0-win-x64.zip -Algorithm SHA256。

单独下载的管理器不会自己更新,新版本要手动替换;ModAVD 包里的那份随 ModAVD 整包一起更新。单独使用时请给 --root 或设置 MODAVD_ROOT,否则会提示找不到 ModAVD 根目录。不要把单独下载的 zip 解压到 ModAVD 根目录覆盖整包中的文件。

English

Shipped in ModAVD 0.38.0. Changes since v0.3.1:

New

  • Per-app proxy: only the apps you list (for example a game that needs an overseas route) go out through a proxy in the instance; everything else connects directly.

    • Command line: modavd proxy <index> shows the setting; on / off switch it (on --server socks5://IP:port, or http://…, or --server auto to take this computer's proxy setting); --add / --remove / --apps edit the app list (package names); test probes on this computer what protocol the proxy speaks and whether UDP works. An address of 127.0.0.1 or localhost is stored as the host address 10.0.2.2 as seen from inside the instance.
    • The setting lives under the instance in mas-avd.json. The rules are installed as the first step after boot, and a change made while the instance runs takes effect at once; an instance with the setting off leaves the guest alone at boot.
    • The card menu gets "Per-app proxy…" (switch, address, app list, with "Read from system proxy" and "Check" buttons). Cards with the setting on show a "Proxy" mark: green means in effect, yellow means rules are being restored or the last connection did not succeed, red means the listed apps are currently offline or connecting directly.
    • Proxies that need a username and password are not supported: when auto finds an address with credentials, only host:port is kept and you are told. If the proxy goes down, the listed apps lose their network.
    • When the rules cannot be installed (no root in the guest, the guest daemon does not match, and so on), the listed apps connect directly; boot is not affected and the reason is added to the warnings start returns.

    (ModAVD/ModAVD#81, ModAVDManager#44, ModAVDManager#53)

  • Data disk reclaim, modavd disk <index> info | trim | compact:

    • info: the data disk's logical size, the size it actually takes on this computer, the allocated size and the estimated reclaimable size. Read-only and usable while running (while running, only the first two are given).
    • compact: after shutdown, rewrites the data disk, drops what the guest has deleted and shrinks the file. It checks free space first and works only on NTFS / ReFS; it refuses when the data disk has internal snapshots or the instance has a memory snapshot; the new disk replaces the old one only after qemu-img check and a byte-for-byte comparison both pass, and any failure keeps the original. The instance cannot boot during the rewrite.
    • trim: triggers a guest reclaim on a running instance, and one is also done automatically after boot finishes (at most once per instance every 24 hours). The emulator in this version has no discard yet, so trim does not actually reclaim space: manual modavd disk trim reports "unsupported" (exit code 4), and the automatic trim after boot skips itself when it finds no discard. To save space, use modavd disk compact.
    • The manager adds three buttons per instance (disk usage, reclaim space, compact disk); MCP adds disk_info, trim_disk and compact_disk.

    (ModAVD/ModAVD#2, ModAVD/ModAVD#95, ModAVDManager#47)

  • When a boot fails or times out, the guest's state is kept: if the boot times out, the post-boot setup fails or create runs out of time while the emulator is still there, the guest's logcat, dmesg, properties, process list and memory info are saved to logs\mas_<index>-<time>-bootfail\ before returning. Nothing is saved when you cancel (Ctrl+C, MCP cancel, cancelling the task in the manager), when the instance is shutting down, or when the emulator is already gone. Each instance keeps the newest 3, counted in the 1 GiB limit of logs\; problem-info collection (collect-info) includes the newest 3, up to 100 MB in total. The logcat and the rest may contain account information and stay on this computer; look them over before sending a problem pack. (ModAVD/ModAVD#79, ModAVDManager#50)

Changes

  • New instances default to 1080p (1920×1080, DPI 280); 720p (1280×720, DPI 240) is the second tier. The manager's create and instance settings, --resolution 1080|720 of modavd create / modavd set, and MCP's create_instance / update_instance share these two tiers; DPI follows the tier and is not set separately.

    • Existing instances keep their settings: the tier is recognized from width and height only, 1920×1080 (landscape or portrait) counts as 1080p, and everything else, including old configs without the fields, counts as 720p. Switching writes width, height and DPI together and keeps the orientation; before each boot the config is normalized to the current tier instead of always being written back to 720p.
    • A resolution changed while running takes effect on the next cold boot. Also fixed: after changing the tier while running, clicks on the manager's screen view were converted with the next boot's size and landed in the wrong place; they now use the size of the current screenshot, and the margins of a portrait screen send no click.
    • An older modavd does not know 1080p; see the caller section for AUTO-MAS.

    (ModAVD/ModAVD#100, ModAVDManager#61)

  • modavd stop changes for an instance that is being created: it used to interrupt initialization; now it returns busy (exit code 5) by default, --force included, and initialization carries on. To interrupt on purpose, add --cancel-create (cancel_create in MCP; the manager's "Cancel create" for an instance created by another process passes it explicitly). The interruption still syncs and uses Android's normal shutdown, the instance becomes create_failed, and you continue with modavd create --resume <index>; interrupted_create is true in the result of stop --json. stop --all shuts down every running instance, those being created included, and marks interrupted_create for each. (ModAVD/ModAVD#103, ModAVDManager#54)

  • Instances with the execution bridge installed can boot after the whole root folder has been moved. Before, the data overlay still pointed at the old SDK location and boot failed with Could not open backing file. Now the first writable cold boot records the path, size and SHA-256 of the instance's original system / vendor images; when the old path is gone after a move, the two images at the new location are checked against the record before the overlay is pointed there.

    • For an existing instance, cold boot it once with the new version in the old place and shut it down (to record the digests), then move the whole root folder. If it has already been moved without a record, or the candidate images are missing or differ in size or digest, boot returns precheck_failed (exit code 4) saying which overlay, the old path, the candidate path and what to do, and changes nothing.
    • The check is the same in the manager, in the command line, and in the bundled command line AUTO-MAS calls.

    (ModAVD/ModAVD#99, ModAVDManager#55)

  • Updating the package (modavd update):

    • After the shutdown command returns, the exit watchdog and the boot guard may still be alive, and the update used to refuse at once; it now waits up to 30 seconds for them to leave and refuses only on timeout, listing the process names and PIDs still alive.
    • Before, if someone started the emulator directly after the pre-swap scan, or another root folder sharing the same SDK started one, the update could still swap the package. Now, during the swap it first takes the start locks of every index of this root and then holds the SDK's program files by file ID, so new launches are blocked for the whole swap (backup, rename and recovery after an error included); a last scan follows, and any new use makes it refuse and change nothing.
    • The drive holding the ModAVD root folder must support opening program files by file ID (NTFS does). A root folder on exFAT / FAT32 makes the automatic swap refuse and change nothing; download the full package by hand. A read-only file, missing permission or a program in use is refused the same way.

    (ModAVD/ModAVD#77, ModAVDManager#58)

  • While a disk is being compacted, start, delete and execution bridge install on that instance now return busy at once with "compacting the disk", instead of waiting. disk info no longer fails when it cannot take the lock or read something: it gives the header size and host usage it can read, and says in warnings what was not computed and why; a value that cannot be read is omitted (for example on_disk_bytes does not appear when the host usage cannot be read). For a damaged data disk, the message from info says what it checked and suggests backing up, restoring, keeping a copy for investigation, or deleting and recreating the disk once you accept losing the data. (ModAVD/ModAVD#95, ModAVDManager#63)

  • Compacting the disk (disk compact): when the overlay itself is a symbolic link (a dangling one included) or has more than one hard link, it refuses before doing anything (unsupported, exit code 4), naming the path, the reason and what to do, instead of writing through to the other end of the link. (ModAVD/ModAVD#95, ModAVDManager#59)

  • When the manager is ended from outside, the qemu-img child processes used by disk compact and info end with it and no longer keep holding the data overlay. (ModAVD/ModAVD#95, ModAVDManager#60)

  • On non-Windows platforms, Windows-only operations such as opening the logs folder and showing or hiding the window now return "unsupported" clearly, instead of creating the folder first and then failing internally, or reporting success by treating an unreadable process list as an offline instance. Behavior on Windows is unchanged. (ModAVD/ModAVD#74, ModAVDManager#49)

  • Component download (components fetch) and modavd update now share one download implementation: the same connection, response wait and body-stall timeouts (20 seconds to connect, 30 seconds without data), strict checking of the range the server answers when resuming, a User-Agent with the manager's version, and redaction of network errors and CDKs in the output. Mirror 酱 always downloads from the start; a half-downloaded update .part is downloaded again, while a complete, verified file can still be reused.

    • Component download edge cases: a failed directory move or a suffix clash, the old directory location, a complete but bad cache, an out-of-range timeout argument, using the system proxy when only NO_PROXY is set, cancelling during a retry, duplicate ZIPs, free space, and logs. --help now says a refused license is exit code 2 and that exit code 9 also covers an unavailable proxy.
    • Problem info: fixed the request to newer adb's logcat; the ZIP uses local time; when reading disk info fails, it cancels and waits for the disk-type query to end; the root and staging folders are expanded to their 8.3 short names; cancelling before the ZIP is finished removes the half-written ZIP, the staging folder is cleaned up by default, --keep-stage keeps it and returns the path; a plain packaging failure still keeps the files already collected.

    (ModAVD/ModAVD#91, ModAVD/ModAVD#72, ModAVD/ModAVD#73, ModAVDManager#51)

  • Disk compact sets its time limits by the amount of work: convert and compare each get a budget based on the virtual size (floors of 30 / 20 minutes; a large disk can take tens of hours, a normal compact will hardly time out, and to stop it you cancel); when the estimated gain is below the larger of 16 MiB and 1% of the host usage, the rewrite is skipped instead of rewriting the whole disk for nothing. The disk compact result gains a signed on_disk_delta_bytes (after minus before; positive when usage grew) and skipped, among other fields, while freed_bytes and the before/after fields stay; compacting can be cancelled in the interface. (ModAVD/ModAVD#95, ModAVDManager#65)

  • The emulator logcat being written on the host is split every 256 MiB; each instance keeps the newest 10 closed ones, with a 1 GiB total for closed logs, so it no longer grows without bound. The collector is bound to this boot's emulator and exits when the emulator does, so it does not linger, hold the manager program and block a package update. (ModAVD/ModAVD#97, ModAVDManager#57)

  • The interface and logs of disk reclaim now tell "the trigger request returned" from "the guest reclaim finished": while running the manager shows "elapsed", and after returning "trigger request took" and "triggered", with a note that it does not wait for Android to finish reclaiming; the command line's "disk reclaim triggered" is unchanged. (ModAVD/ModAVD#95, ModAVDManager#64)

Notes

  • Disk compact (disk compact) rewrites the whole data disk and needs about as much free space as is allocated (estimated as 1.05 times the allocated size plus 2 GiB); when there is not enough, it refuses and says how much to free.
  • Known limits of the per-app proxy: AUTO-MAS does not take mas-avd.json.lock when it writes mas-avd.json, so when it and modavd change the file at the same time, the later write overwrites the earlier one and a proxy setting change can be lost; an instance not booted through modavd has no rules for that boot, so the listed apps connect directly; after a guest restart the rules come back up to 5 seconds late, and during those seconds the listed apps connect directly.

For callers (AUTO-MAS)

  • protocol is still 2: only commands, fields, tools and an error code were added; no field was removed and no existing exit code changed meaning. (Protocol = 2 in internal/buildinfo.)
  • New commands: proxy (<i> [on|off|test] [--server …] [--add …] [--remove …] [--apps …]) and disk (<i> info | trim | compact). stop gains --cancel-create. --resolution of create and set takes 1080 or 720; create without it uses 1080.
  • stop behaves differently (ModAVDManager#54): for an instance being created, stop (--force included) returns busy (exit code 5) by default and no longer interrupts initialization. If AUTO-MAS used stop to interrupt a create, it must now add --cancel-create; after the interruption create ends with exit code 8 (canceled), the instance is create_failed, and create --resume <index> continues it. interrupted_create in the result of stop --json is true when a create was interrupted; stop --all also shuts down instances being created and marks the field for each.
  • New fields:
    • Instances in list and info have an app_proxy (switch, address, number of apps; null when never set). In modavd proxy --json, applied is one of now, booting, next_boot, off, failed.
    • disk info --json: index, overlay, running, needs_shutdown, logical_bytes, on_disk_bytes, allocated_bytes, reclaimable_bytes, warnings. on_disk_bytes, allocated_bytes and reclaimable_bytes are omitted (not 0) when they cannot be read or computed, and warnings says why; do not treat a missing value as 0. disk compact --json: before_on_disk_bytes, after_on_disk_bytes, freed_bytes.
    • In the --json of boot failures, timeouts and similar errors, error.details.boot_diag_dir is the folder holding the guest's state (absent when there is none).
  • New error code proxy_unavailable (the proxy does not answer, is not SOCKS5 / HTTP, or the host has none set for auto), with the existing exit code 9 (shared with update and component download unavailable). precheck_failed (exit code 4) can now also come from "cannot reconnect the execution bridge's backing images after the root folder was moved".
  • New MCP tools: get_app_proxy (read-only), set_app_proxy, disk_info, trim_disk, compact_disk; stop_instance gains a cancel_create argument; create_instance / update_instance gain resolution (1080 / 720).
  • New instances default to 1080p: an instance created through the bundled modavd without --resolution is 1080p; existing instances are unaffected. For 720p, pass --resolution 720 when creating. An older modavd does not know 1080p.
  • When the drive holding the ModAVD root folder cannot open program files by file ID (exFAT / FAT32), update returns not_ready and changes nothing.

Download and verification

Building with Go 1.26.5 and GOTOOLCHAIN=local through the repository's build.ps1 gives the same bytes. The standalone package also holds the Go license text and a file list; check the zip and the two exes with the attached SHA256SUMS.txt, for example Get-FileHash .\ModAVDManager-0.4.0-win-x64.zip -Algorithm SHA256 in PowerShell.

The standalone manager does not update itself; replace it by hand. The copy in the ModAVD package is updated with the whole package. When you use it standalone, pass --root or set MODAVD_ROOT, or it reports that it cannot find the ModAVD root. Do not extract the standalone zip over the files of a ModAVD root.