0
Fork 0
mirror of https://github.com/Droid-VM/DroidVM.git synced 2026-11-17 06:58:15 +00:00
Commit graph

477 commits

Author SHA1 Message Date
lateautumn233
2c81c1a7af chore(deps): update daemon, WebUI and arm64 prebuilts
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:33 +08:00
lateautumn233
fe7cca4e86 chore(git): ignore local documentation directory
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:32 +08:00
lateautumn233
a36cca8d43 build(webui): allow larger embedded contract validator assets
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:32 +08:00
lateautumn233
e1209fbffe test(webui): align native probes with terminal and hugepage flows
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:31 +08:00
lateautumn233
d845c57efc feat(api): extend WebUI contracts for VM and resource management
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:31 +08:00
lateautumn233
c37d752963 feat(vm): configure WebRTC exports and automatic Gunyah memory
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:30 +08:00
lateautumn233
66f2a64b99 feat(console): retrieve persistent logs through paged IPC
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:30 +08:00
lateautumn233
009688167f fix(daemon): detach standard streams from the Android framework
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:29 +08:00
lateautumn233
fd40c0ede0 fix(network): keep lease getters from mutating VM configuration
Signed-off-by: lateautumn233 <lateautumn233@foxmail.com>
2026-11-14 01:22:29 +08:00
lateautumn233
b6f9193280 feat(android-display): expose direct phone panel output 2026-10-20 23:38:08 +08:00
lateautumn233
fce41b04aa feat(settings): use shared defaults behind existing App controls
Connect settings, VM starts, disk operations and serial configuration to daemon-owned state while retaining existing names and categories. Hide normal shared-storage status rows.
2026-10-19 17:51:25 +08:00
lateautumn233
39a95f9174 feat(app): add WebUI service and pairing management page
Expose WebUI listener settings, LAN access and pairing controls through the App activity and localized resources.
2026-10-19 17:51:24 +08:00
lateautumn233
d9764af367 refactor(hugepage): route App mutations through daemon services
Coordinate hugepage writes and module lifecycle with the daemon. Show migration only for legacy settings and operation lookup only for an unresolved request.
2026-10-19 17:51:11 +08:00
lateautumn233
48f2261a63 feat(app): add clients for shared daemon settings and operations
Add host preferences, disk defaults, hugepage, USB ACM and WebUI clients with receipt tracking, legacy migration and client contracts. Initialize shared clients and add localized messages.
2026-10-19 17:51:11 +08:00
lateautumn233
539e42fff3 refactor(app): reuse native VM defaults, Agent scripts and Vulkan probe
Replace duplicated creation defaults and rescue scripts with shared sources and use the daemon Vulkan probe from JNI. Update the existing regression tests.
2026-10-19 17:51:10 +08:00
lateautumn233
85f2f5a01a build(webui): package frontend and native web transport in APK
Add API contracts, build and validation tools, embedded assets and required license resources. Record daemon and WebUI revisions and shared default data.
2026-10-19 17:50:52 +08:00
lateautumn233
7f0291a1c3 fix(network): update daemon to respect external firewall priority 2026-10-19 15:07:17 +08:00
lateautumn233
cbe66e1b1b chore(webui): register frontend as a submodule 2026-10-19 12:31:12 +08:00
lateautumn233
819d173f3f fix(disk): route settings disk import and pre-start converts through the daemon
Settings import saved disks with the legacy DataStore write, which the
ownership gate refuses once the daemon owns configuration, so an import
stopped at the disk step. DiskStore.importPersisted replaces rows by id and
appends new ones in one conditional disk_config upload, keeping untouched
rows and root extensions exact; a path already registered under another id
is refused. loadStore now dispatches to the three per-store importers.

The pre-start compressed/snapshot disk convert passed only a path, so even a
registered disk was rewritten by qemu-img under su, outside the daemon's
leases and registry. It now resolves the registered disk and runs a native
convert by id; an unregistered path is reported instead (it cannot start in
owner mode anyway). DiskOperationActivity refuses path-only tasks other than
create, and optimizeForResultIntent is removed.

Verified: assembleDebug and assembleRelease pass. Not yet exercised on a
device.
2026-10-18 01:23:33 +08:00
lateautumn233
de09b18dbe fix(display): let release lint accept the exempted broadcast reflection
0862ead broke assembleRelease: lintVitalRelease reports BlockedPrivateApi
on TRANSACTION_broadcastIntentWithFeature. The access runs only after
HiddenApiBypass exempts IActivityManager, so suppress the check on capture().

Verified: assembleDebug and assembleRelease pass.
2026-10-18 01:23:33 +08:00
lateautumn233
42aed7830e test(agent): run the temporary VM probe on QEMU/TCG too
--backend qemu builds the ChangePasswordActivity shape (QEMU, soft
hypervisor, uart console on ttyAMA0). Passed 3/3 on warsaw (boot 3.5-3.9 s,
9 checks, cleanup complete); crosvm still passes.
2026-10-18 00:55:19 +08:00
lateautumn233
ebea796933 fix(agent): temporary VMs run under native configuration ownership
Advances daemon to accept Agent temporary VMs (vm_create "temporary": true
and their vm_delete) in owner mode; the app already marks them. Adds
run_agent_temporary_vm_probe.py: isolated owner daemon, Agent-shaped crosvm
VM boots to the rescue shell, runs a command and is deleted without being
persisted. Passed on warsaw (boot 7.8 s, 9 checks, cleanup complete).
2026-10-18 00:38:50 +08:00
lateautumn233
28164fe807 chore(daemon): host audio table on firmware without a profile
Advances daemon to f8164f1 (listAudioPorts vector or array form). Verified
by the audio snapshot probe on OnePlus OP6546L1 (API 36) and warsaw.
2026-10-17 23:58:19 +08:00
lateautumn233
0862eaddb6 fix(display): capture the broadcast profile in the UI for other ROMs
The daemon's display binder broadcast used a parcel layout verified only
for warsaw, so on other firmware the native display waited forever.
BroadcastProfile reproduces PlatformProfileTest in the app (Intent layout,
extras slot, Bundle trailer, broadcastIntentWithFeature code, signature
check) and display_attach sends it. HiddenApiBypass exempts only
Landroid/app/IActivityManager.

Verified on OnePlus OP6546L1 (API 36): captured transaction=23
extras_offset=124 trailer=00000000; daemon used the client profile, VM
started and the native display connected at 1920x1080.
2026-10-17 23:49:10 +08:00
lateautumn233
6dcedb81a1 fix(daemon): identify the running daemon by argv[0], not comm
On some ROMs (OnePlus OP6546L1, Android 16) the daemon's main thread is
renamed "Binder:droidvmd" once it joins the Binder thread pool, so the
comm check rejected the live daemon: the app reported the service as
stopped and every start failed on the held runtime lock. readPid now
matches the basename of /proc/<pid>/cmdline argv[0].
2026-10-17 22:43:13 +08:00
lateautumn233
dc2b132cc2 feat(settings): switch for adjusting huge pages on VM start
"Adjust huge pages on start" (default on) in the VM settings. Off, the
daemon leaves the huge-page reserve target alone and does not wait for it;
the start guard then warns when the reserve is short instead of assuming
the daemon will size it. Advances the daemon and extends the runtime probe.

Verified: app compiles; runtime probe --autostart PASS 24 checks, full
lifecycle PASS 39.
2026-10-17 22:02:58 +08:00
lateautumn233
f6da875587 build: strip native executables packaged as assets
AGP strips jniLibs only, so droidvm, daemon and droidvmd shipped in
assets/bin kept their debug info (droidvmd 71 MB debug / 68 MB release).
CopyNativeBinAssets now writes them through the NDK llvm-strip
--strip-unneeded; the unstripped build stays under
intermediates/native_binaries for symbolization. arm64 droidvmd is now
8.8 MB debug / 4.0 MB release. verify_native_assets compares the APK with
the stripped copies.

Verified: Debug and Release build; verify_native_assets PASS;
run_configuration_owner_probe with the stripped droidvmd PASS (8 checks).
2026-10-17 21:20:47 +08:00
lateautumn233
000800c040 fix(daemon): kill a daemon left on a cleared data directory before starting
Clearing app data (or reinstalling) deletes run/ under a running root
droidvmd. The new lock file is a different inode, so the next launch
started a second daemon beside it. Before every start, kill droidvmd
processes whose open lock is "run/droidvmd.lock (deleted)" with SIGKILL
(their teardown would act on names the new daemon may own), then the
pbridge/netbox/bridgedhcp/gvswitch helpers from the app's bin left
orphaned. A daemon on the live directory is never touched.

Verified on device: the stale daemon and its orphaned netbox were killed;
the live daemon, its helpers and br-wifi kept running.
2026-10-17 21:05:00 +08:00
lateautumn233
f1aefa29d3 fix(daemon): always own configuration and restart every daemon cleanly
Ownership was read from a preference or a non-empty gate file, so a fresh
install started droidvmd in legacy mode, where coordinated network deletion
and other revisioned APIs are absent ("Coordinated network deletion API is
unavailable"). With the Java daemon gone there is no other writer: always
pass --configuration-owner and drop the preview switch.

Restart now stops every droidvmd (a reinstall leaves the previous one
running on a deleted data directory): SIGINT, SIGKILL after 30 s, then
kills pbridge/netbox/bridgedhcp/gvswitch helpers from the app's bin left
without a daemon. Networks running before the restart are started again,
not only auto-up ones.
2026-10-17 20:50:08 +08:00
lateautumn233
6491206210 fix(pkg): export without pushing the VM to a configuration-owning daemon
The export screen re-sent its VM through vm_exists + vm_modify/vm_create
before vm_export. A daemon that owns VM configuration refuses those legacy
writes ("failed to modify VM") and already holds the saved VM, so export
now goes straight to vm_export when the revisioned VM configuration API is
offered; the legacy push stays for older daemons.

Verified: app Debug compiles. Reported by on-device export under native
configuration ownership.
2026-10-17 20:18:19 +08:00
lateautumn233
30f31f01cc fix(disk): apply qemu-img CPU affinity to native disk operations
DiskOperationActivity sends the settings' qemu-img core list as "cpus";
the daemon binds the tool as taskset did on the legacy path. Advances the
daemon to API 26 and updates the disk-config probe expectations.

Verified: app Debug and migration-tests build; --vm-disks TCP probe PASS
(42 checks).
2026-10-17 19:59:51 +08:00
lateautumn233
01e7f1a057 fix(disk): show native disk operation progress
DiskOperationClient exposes the task's basis-point progress and an
await overload with a progress callback; DiskOperationActivity shows the
percentage while a native operation runs. Advances the daemon to the
FUSE install fallback and qemu-img progress reporting.

Verified: app Debug and migration-tests build; --vm-disks TCP probe with
Java DiskOperationTcpTest PASS (38 checks).
2026-10-17 19:21:55 +08:00
lateautumn233
e94ddf051c refactor: remove the Java daemon
droidvmd is now the only service: DaemonHelper always launches it (with
--configuration-owner once ownership is claimed), and the "native service"
settings switch is gone. Removed the cn.classfun.droidvm.daemon
implementation (132 files), its JNI adapter (UnixHelper, NativeProcess,
libunixhelper), the unit tests of removed classes and the migration-tests
NativeProcess bridge. UsbRules, UsbHostDevice, UplinkResolver, UsbAcmPool
and RequestException stay because the UI still uses them. Oracle probes
now take --oracle-apk (default: the archived pre-removal debug APK).

Verified: app Debug/Release, androidTest and migration-tests APKs build;
no daemon classes or libunixhelper in the APK; unit tests 466 run, the 12
failures are pre-existing (Windows ':' directory names in
UsbHostDeviceTest, AgentActionQueueTest); run_configuration_owner_probe
on device PASS 8 checks.
2026-10-17 19:03:10 +08:00
lateautumn233
6f582ee8c0 chore: advance daemon to VM lifecycle logging
The runtime probe now asserts that daemon.log records the running,
rebooting, stopping and exit lines (on-device PASS, 39 checks).
2026-10-17 18:39:01 +08:00
lateautumn233
8372088bdd fix(vm): let the daemon confirm durability before a configured start
VmConfigClient.start refused snapshots read right after a daemon restart (always durability-uncertain), so no VM could start until some configuration was saved. The daemon now syncs such a snapshot before launching; the client keeps its single submission and revision check.
2026-10-17 17:47:49 +08:00
lateautumn233
27546a4e1b chore: advance daemon to released-crosvm disk launch fallback 2026-10-17 17:36:47 +08:00
lateautumn233
c2a8f58341 fix(assets): replace running daemon binaries by staged rename
Extracting bin/droidvmd while the native daemon runs opened the busy executable for writing (ETXTBSY) because the app cannot unlink entries in the root-owned bin directory, so upgrades silently kept the old daemon binary and never recorded its hash. Assets are now written completely to the app cache and swapped into place (rename, else root mv -f), so the running process keeps its old inode.

Verified on device: upgrading the installed app while droidvmd --configuration-owner ran replaced bin/droidvmd, recorded its hash, and the app restarted the daemon with ownership and the native br-wifi network intact.
2026-10-17 17:13:57 +08:00
lateautumn233
3fe831d4d3 feat(settings): opt-in native configuration ownership
Add a settings switch (default off) that, after an explicit irreversible confirmation, makes DaemonHelper start droidvmd with --configuration-owner. Once the persistent ownership gate is non-empty the flag and the native daemon are always used, since a legacy-mode or Java daemon would be refused, and the switch cannot be turned back off. VmConfigOwnership.claimed reads the gate without creating it.

Verified: Debug/Release compile and assembleDebug; the packaged arm64 droidvmd from that APK passes run_configuration_owner_probe (8 checks, cleanup complete). The settings flow and an owned production data directory were not exercised on device; no production APK was installed.
2026-10-17 16:41:21 +08:00
lateautumn233
574dc2cda6 fix(disk): keep downloads, chain repair and VM disk cleanup working under native ownership
Legacy store saves are refused once the daemon owns configuration. Downloaded disks now register through DiskStore.register (native session or gated legacy write) and report failures instead of dropping them. BackingChainLinker edits the registry through one revisioned native session when the daemon owns disks and leaves header rewrites to the daemon, which resolves relative names and pins parents by lease. VM deletion cleans up its disks with leased daemon deletes, leaf first, re-reading references each round; unregistered files keep the previous client-side removal.

Verified: Debug/Release compile; BackingChainLinkerTest passes; the full app unit suite shows the same 30 pre-existing USB/agent failures with and without this change. UI flows not exercised on device.
2026-10-17 16:37:02 +08:00
lateautumn233
d1924b841e test: validate the opt-in configuration owner daemon on device
Add run_configuration_owner_probe for droidvmd --configuration-owner in an isolated data directory (passed with cleanup) and remove the isolated legacy ownership gate file in run_vm_inventory_probe cleanup (42 checks passed).
2026-10-17 16:31:04 +08:00
lateautumn233
d97036f155 feat(disk): convert into another file through the native daemon
DiskOperationActivity maps convert with a different output to the daemon's relocating convert instead of refusing it. Debug/Release compile; daemon side verified on device (pkg 44 groups, real qemu-img, UBSan, --vm-disks TCP).
2026-10-17 16:25:34 +08:00
lateautumn233
9762e6abfb feat(disk): create, snapshot and reset disks through native daemon tasks
When the daemon offers native disk operations, DiskCreateActivity no longer pre-registers a row: DiskOperationActivity sends a path-mode create (registered backing only) and the daemon creates and registers the image. DiskOverlayCreateDialog submits an overlay create whose follow/read-only choice moves stopped VMs' slots in the daemon transaction, and overlay reset uses the daemon's leased reset instead of client-side qemu-img and rename. Planning reads use the native-aware registry snapshot. Legacy mode keeps the existing flows.

Verified: Debug/Release Java and migration test APK compile; device --vm-disks TCP probe (including the Java disk operation test) passed with cleanup. These UI flows were not exercised interactively on device.
2026-10-17 15:52:41 +08:00
lateautumn233
90cddb850f feat(disk): route registered disk operations through native daemon tasks
Add DiskOperationClient for the API 25 disk operation tasks: capability check, single submission pinned to a disk registry revision, SubmitUnknown for lost or internal admission replies (never resubmitted), polling, cooperative cancel and recovery. When the daemon offers native operations, DiskOperationActivity no longer runs su shell commands or client-side registry follow-ups for registered disks: resize, convert/optimize in place, flatten, commit and clone map to daemon requests, unsupported shapes (converting into another file) fail instead of falling back, and registry/capability reads move off the main thread. The joint delete dialog enables image deletion through the daemon's leased delete operation pinned to the confirmed revision.

Verified: Debug/Release Java compile; device --vm-disks TCP probe with the new DiskOperationTcpTest instrumentation (create, stale revision, resize, lost start reply reported unknown without resubmission, delete with files, no leftovers) passed with cleanup. Activity/dialog UI flows were not exercised on device; production daemon does not advertise disk operations yet.
2026-10-17 15:44:35 +08:00
lateautumn233
8325cbc398 chore: advance daemon to native disk merge and delete
Device pkg contract 43 groups, real qemu-img merge/delete, UBSan and --vm-disks TCP probe pass.
2026-10-17 15:34:23 +08:00
lateautumn233
c9586ddfb3 chore: advance daemon to native disk create and clone
Device pkg contract 41 groups, real qemu-img suite, UBSan and --vm-disks TCP probe pass.
2026-10-17 15:23:30 +08:00
lateautumn233
49cd2db47a test: drive coordinated disk operations over TCP
Extend the --vm-disks TCP probe with native resize/flatten tasks against an isolated qemu-img; device run passed with cleanup_complete.
2026-10-17 15:14:28 +08:00
lateautumn233
94cf8831c5 chore: advance daemon to coordinated disk operations
Native resize/convert/flatten tasks with registry reservations, file leases and journaled replacement; device pkg contract 40 groups, real qemu-img suite and UBSan pass.
2026-10-17 15:08:37 +08:00
lateautumn233
bc338b3402 chore: advance daemon to leased package export
Device pkg contract 38 groups passed on plain arm64 and UBSan builds.
2026-10-17 14:21:47 +08:00
lateautumn233
90e24b17cb test(vm): validate crosvm capability probe on Android 2026-10-17 12:22:15 +08:00
lateautumn233
2a5ff4ddff vm: negotiate retained disk-chain support with crosvm 2026-10-17 11:40:24 +08:00