How sqdqzy/aitoolrunner works
AIToolRunner is an Android app for executing AI-generated shell and file tool calls, with a DeepSeek WebView for prompt and result exchange. The main workflow is: enter or receive a tool-call block, parse it, review risky calls, execute approved calls, then publish the results for return to the chat. Separate capabilities include execution testing, settings and Shizuku permission management. The execution and parser source is only partially sampled, so links to unsampled internals are limited to responsibilities supported by the tree and excerpts.
Main entry points: MainActivity.kt Main Navigation · ExecutorFragment.kt Tool Executor · ToolRunner.kt Tool Runner · TestFragment.kt Tool Self-Test
Components 18
App Navigation
- Main Navigation
app/src/main/java/com/aitool/runner/ui/MainActivity.kt - Tool Self-Test
app/src/main/java/com/aitool/runner/ui/TestFragment.kt
Chat Exchange
- Chat WebView
app/src/main/java/com/aitool/runner/ui/WebFragment.kt - Execution Bus
app/src/main/java/com/aitool/runner/tool/ExecutionBus.kt
Tool Execution
- Tool Executor
app/src/main/java/com/aitool/runner/ui/ExecutorFragment.kt - Call Parser
app/src/main/java/com/aitool/runner/parser/ToolCallParser.kt - Call Models
app/src/main/java/com/aitool/runner/parser/Models.kt - Tool Runner
app/src/main/java/com/aitool/runner/tool/ToolRunner.kt - Shell Tool
app/src/main/java/com/aitool/runner/tool/ShellTool.kt - File Tool
app/src/main/java/com/aitool/runner/tool/FileTool.kt - Tool Results
app/src/main/java/com/aitool/runner/tool/ToolResult.kt
Settings and Safety
- Danger Detector
app/src/main/java/com/aitool/runner/security/DangerDetector.kt - Audit Logger
app/src/main/java/com/aitool/runner/tool/AuditLogger.kt - Settings Screen
app/src/main/java/com/aitool/runner/ui/SettingsFragment.kt - Shizuku Access
app/src/main/java/com/aitool/runner/adb/ShizukuHelper.kt - Theme Startup
app/src/main/java/com/aitool/runner/App.kt
Other components
- User
- DeepSeek Chat
Connections 28
- User → Main Navigation: selects screen
- Main Navigation → Tool Executor: shows screen
- Main Navigation → Chat WebView: shows screen
- Main Navigation → Tool Self-Test: shows screen
- Main Navigation → Settings Screen: shows screen
- User → Tool Executor: enters calls
- Tool Executor → Call Parser: parses input
- Call Parser → Call Models: creates calls
- Tool Executor → Danger Detector: checks calls
- Tool Executor → Tool Runner: runs approved calls
- Tool Runner → Shell Tool: dispatches shell
- Tool Runner → File Tool: dispatches files
- Tool Runner → Audit Logger: records activity
- Shell Tool → Tool Results: returns result
- File Tool → Tool Results: returns result
- Tool Runner → Tool Results: collects results
- Tool Executor → Execution Bus: publishes summary
- Execution Bus → Chat WebView: provides results
- Chat WebView → DeepSeek Chat: loads and fills chat
- DeepSeek Chat → User: returns response
- User → Tool Self-Test: starts checks
- Tool Self-Test → Tool Runner: runs sample tools
- Tool Self-Test → Call Parser: checks parsing
- Tool Self-Test → Danger Detector: checks safety
- User → Settings Screen: changes preferences
- Settings Screen → Shizuku Access: checks or requests access
- Main Navigation → Shizuku Access: refreshes permission status
- Theme Startup → User: applies theme preference