NoOpShellBackend
ShellBackend that's always unavailable. Useful as a fallback in the "use root if available, Shizuku otherwise" dispatch pattern documented in docs/ROOT.md — when neither tier is reachable on the current device, every tool errors with shell_unavailable: NoOp so the LLM sees a structured failure instead of unexpected behaviour.
Example:
val backend: ShellBackend = when {
RootShellBackend().isAvailable() -> RootShellBackend()
ShizukuShellBackend().isAvailable() -> ShizukuShellBackend()
else -> NoOpShellBackend
}
val tools = ShellTools.all(context, backend)Content copied to clipboard
Properties
Functions
Link copied to clipboard
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.
Link copied to clipboard
Link copied to clipboard
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.