ShellBackend
Abstraction over a privileged shell-command pipeline.
Implementations:
ShizukuShellBackend(:droid-mcp-shizuku) —shell-UID execution viaShizuku.newProcess, no root needed.RootShellBackend(:droid-mcp-root) —root-UID execution via a per-calllibsushell.
Tools in :droid-mcp-shell-core are parameterised over ShellBackend so the LLM-facing surface is identical across backends. Register one backend's tool set — the tool names are the same, so a second set replaces the first.
Inheritors
Properties
Functions
Why the backend can't run commands right now, or null when it can. Lets tools tell "not running / not checked" (ShellException.NotAvailable → shell_unavailable) apart from "access denied" (ShellException.PermissionDenied → shell_permission_denied). The default only knows isAvailable.
Run command with args as a shell process. Returns stdout/stderr/exit. Implementations should NOT throw on non-zero exit codes — surface them via ShellResult.exitCode so tools can decide whether that's an error.
True when the backend is currently reachable — Shizuku binder pingable with permission granted, or su available, depending on the impl. Tools call this for fast-fail before constructing a command.