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

10 commits

Author SHA1 Message Date
BigfootACA
782eaf3704
Add custom sponsorship URL to FUNDING.yml
Added a custom sponsorship URL for funding.
2026-09-21 12:48:03 +08:00
HuJK
3f4513bbde usb: pass a host USB device through to a VM, by hand or by rule
A host USB device can be handed to a running VM, by hand or by rule.

The daemon owns it. It watches /dev/bus/usb and the kernel's uevent socket --
the second because binding or unbinding a driver moves no node and nothing else
reports it -- and keeps an inventory of every device including the root hubs,
whose arrival nothing else reports either and whose absence is a bus on which
nothing can ever enumerate. Attaching takes the interfaces off their host
drivers and hands the device to crosvm; releasing gives them back, and a VMM
that died holding one has its claim taken off it and the device restored.

Rules decide it without anyone watching. Four ordered zones -- exact, port,
device, and the catch-all -- each a list tried in order, each rule naming a
target: a VM's xHCI controller, the host, or idle. A fifth zone nobody sees is
"no match means the host". Passes run on a plug, on a driver change, when a VM
reaches RUNNING, when the rules are saved, and at daemon start, and a device
somebody moved by hand is locked against them until it is unplugged.

The gate is drivers_autoprobe. With passthrough on, an arriving device binds no
driver of its own and the daemon stands in for the kernel: it probes the device
so the configuration is chosen, then its interfaces, and only for what the rules
say goes to the host. What a device is doing is read from the drivers bound to
it -- hostuse, vmuse, idle -- and stored nowhere.

The UI is three surfaces: a USB passthrough page of four folding zones with a
card per rule and a master switch over them, a management page that moves one
device now without touching the rules, and an xHCI controller peripheral in the
VM editor whose card binds rules straight to that controller.

Squashed from 39 commits on wip/usb.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrfBDYZexyRUKdQyJ3jQ6q
2026-09-09 06:07:22 +08:00
HuJK
efb636443f ci: three source checks, and a build that can unit-test a class that logs
check_arity.py walls off the constructors and methods that had grown past the
point where a caller can be read: a positional list long enough that swapping
two arguments of the same type still compiles. check_vector_icons.py holds the
drawables to one shape so an icon added in a hurry does not arrive at a
different optical size than the row it sits in. check_string_concat gets
stricter, and the two allow-lists carry the deliberate exceptions rather than
leaving the checks off.

isReturnDefaultValues lets a unit test cover a class that logs. Keeping every
testable class free of android.util.Log stopped being tenable once the classes
worth testing were the ones whose whole subject is a socket and a thread
outliving the object that owned them, and which say so out loud when they do.
Nothing asserts on a stub's return value; the stubs only let the class under
test be built.
2026-09-01 20:28:18 +08:00
HuJK
7595658e13 ci: enforce fmt() over complex string concatenation; convert existing ones
Add scripts/ci/check_string_concat.py (wired into the Checks workflow): a
Java-literal-aware scanner that fails when a bare + joins a string literal with a
runtime expression ("x=" + v), which reads better as fmt("x=%s", v). It masks
comments and string/char literals first, so + inside a literal ("wlan+", "%s+",
"\s+") and literal+literal constants are not flagged; a line can opt out with a
trailing // concat-ok comment.

A glance-obvious accumulator append stays as-is: a += statement with at most ONE
+ (s += "x" + y) reads clearly and is exempt; a += chaining two or more +
(s += "a" + b + "c") loses the exemption and is flagged. Only concatenation that
doesn't read at a glance is pushed to fmt(). The + count is scoped per statement
(to the next ; { }).

Convert the pre-existing complex concatenations across the codebase to fmt()
(mostly Log calls); route filesystem-path joins through pathJoin(). Simple
single-+ += appends are left as +=. StringUtils.pathJoin's own body keeps its +
with a // concat-ok note -- it is the canonical joiner and fmt() there would be
a hot-path cost.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
2026-07-07 03:18:47 +08:00
HuJK
8098bca7ca ci: add non-ASCII and translation-completeness PR checks
Two Python checks wired into a new Checks workflow (push + PR):

- check_ascii.py: fails on any non-ASCII byte in a tracked file, so a stray
  smart-quote, em-dash, arrow or CJK char can't slip into code, comments or
  config. Genuine i18n / natural-language files are exempt via
  scripts/ci/ascii_allow.txt (translations, privacy text, docs, ...).
- check_translations.py: fails if any values-<locale>/strings.xml is missing,
  has extra, or has stale entries vs the translatable keys in
  values/strings.xml, so nothing ships half-translated.

Fixes so the current tree passes:
- Replace the check/cross emoji in the virtualization setup step with inline
  tinted vector icons (ImageSpan over ic_check/ic_close); widen showDetail() to
  CharSequence; add status_supported/status_unsupported colors. The mode menu
  already used circle icons; only a stale glyph comment remained.
- Convert typographic dashes/arrows/minus-sign and stray CJK in the hugepage
  and Try comments to ASCII.
- Add the 4 missing zh-rTW strings (vm_exit_crash, vm_exit_guest_panic,
  vm_exit_watchdog, vm_rebooting).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
2026-07-05 22:20:49 +08:00
HuJyunKai
ba6ae1cd0b
Update dev-release.yml 2026-06-22 11:09:12 +08:00
HuJK
5efe84f868 ci(release): publish a debug-signed APK when no release key is set
The dev-release and release workflows built and published an unsigned
release APK whenever APP_SIGN_KEY_JKS was absent. Instead fall back to
assembleDebug (signed with the auto-generated debug keystore) so the
published artifact is always installable. The signed release path is
unchanged when the key is present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FikGHtfpTGfjxfEfuUF1Ra
2026-06-22 00:24:40 +08:00
HuJK
352ca2ffc3 feat(build): replace 7za with XZ for Java; source native prebuilts from DroidVM-Prebuilt-Root
- Drop bundled 7za; decompress the runtime payload in-process with
  org.tukaani:xz + a minimal USTAR reader (AssetUtils).
- Runtime prebuilt is prebuilt-<abi>.tar.xz; the third-party daemons + lbx ship
  inside it (DATA/bin/<name>), so the 7za/thirdparty asset extraction and the
  BINARIES_PREBUILT/THIRDPARTY constants are gone. Stale assets/bin daemons
  removed; *.7z and *-comptime.zip excluded from APK assets.
- lbx also ships in prebuilt-<abi>-comptime.zip, unpacked at Gradle build time
  into lib/<abi>/liblbx.so (UnpackComptimeJniLibsTask).
- Terminal font fetched by a Gradle task (FetchTerminalFontTask) so CI and local
  builds match; build.sh slimmed to preflight + submodules + gradle, with a
  native-dev toolchain check when DroidVM-Prebuilt-Root is present.
- regenPrebuilts runs auto-build.py when DroidVM-Prebuilt-Root is checked out.
- Drop x86_64 from abiFilters (no x86_64 VM runtime exists).
- Workflows: add update-latest-release.yml; add manual workflow_dispatch to
  build.yml and release.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 02:30:38 +08:00
lateautumn233
7ee63454b2 chore(ci): skip re-compression when uploading artifacts
- bump actions/upload-artifact to v7
- set archive: false to avoid re-zipping already-compressed apk
2026-06-11 22:55:42 +08:00
BigfootACA
713c7d2eb2 CI: Add workflows build and release
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
2026-04-11 20:23:21 +08:00