niki914/zafiro

Open-source BYOK AI agent for Android. Full phone control, native Shell & Python 3, with Skills and MCP support, Material 3 Expressive. Works via Shizuku (root optional). Bring any provider: OpenRouter, GLM, and more.

Kotlin

177

791 commits

updated Sep 16, 2026

See the code
accessibility
agent
ai
android
automation
kotlin
llm
lsposed
material-design
mcp
mutimodal
openrouter
python
root
shell
shizuku
skills
ssh
termux
xposed

README

中文 | English

zafiro

stars Ask DeepWiki release downloads kotlin lines Codacy

What is Zafiro?

Zafiro is an open-source intelligent Agent running on Android devices, with BYOK support. It understands your screen, controls your device, and carries out operations across apps — with full support for Skills, MCP, and memory. It can also run Shell and Python 3 natively and wrap tools on its own to perform tasks such as web search and file downloads, or connect to a remote dev machine via SSH.

Zafiro picks and plays music in Spotify via Phone-UseZafiro completes web research with headless web search and article reading via Python scriptsZafiro downloads an APK from the web via Python and installs it with RootZafiro settings screen
Device ControlResearchInstall Apps from the WebSettings

[!IMPORTANT] Zafiro is still in Beta — functionality and experience are being continuously improved. Zafiro runs via Shizuku — no Root required; Root users get the full experience.

You can download a release from Releases, or build from source.

Core Capabilities

Modern UI Design Language

  • Material 3 Expressive & Apple Liquid Glass - a modern, polished interface
  • Personalized Theming - multiple theme colors with dark mode and dynamic color extraction
  • Multilingual Support - English, 中文, 日本語, Español

Device Control

  • Screen Interaction - open apps, pick music, order food — all done for you
  • Fully Visible - an on-screen mouse shows every step the Agent takes

Agent System

  • Out-of-the-Box - built-in support for OpenAI, Anthropic, Google Gemini, DeepSeek, OpenRouter, Kimi, Alibaba Bailian, SiliconFlow, and more
  • Extend as Needed - full support for Skills and MCP, plus memory and a workspace — extend it your way
  • Permission Management - with configurable rules, every command and piece of code is under your control

Python Tools

  • Run Code Directly - run Python 3 natively on the device
  • Meta-Tooling - wrap your own Python tools; the Agent reuses and maintains the tools it creates
  • Built-in Scenarios - web search, web page reading, and APK installation work out of the box

Remote Environments

  • Termux - use Linux commands and tools on your Android device
  • SSH - connect to a dev machine or server to execute remote tasks
  • Claude Code - issue dev tasks from your phone, executed by a remote Coding Agent

Voice Assistant Takeover

Through the LSPosed framework, Zafiro can take over your system voice assistant — wake Breeno or XiaoAi, and the one actually answering is your own Agent. You can decide, based on keywords, which requests go to Zafiro and which pass through to the native assistant. After takeover, the assistant retains full Agent capabilities including device control.

[!NOTE] Taking over the system voice assistant requires Root + LSPosed, and currently supports:

  • OPPO / OnePlus / Realme | Breeno Assistant
  • Xiaomi | XiaoAi (no longer maintained — community contributors welcome)

Voice takeover availability may be affected by phone model, system version, voice assistant version, and vendor system restrictions. When your device does not yet support system assistant takeover, you can still use Zafiro's chat interface with all Agent capabilities.

Demos
Zafiro voice assistant takeover demoZafiro voice assistant takeover demoZafiro voice assistant takeover demo

Tech Stack

CategoryTechnology
LanguageKotlin
UI FrameworkJetpack Compose
Design LanguageMaterial Design 3 Expressive
Liquid GlassAndroid Liquid Glass
Agent RuntimeOkia
Python RuntimeChaquopy
System TakeoverLSPosed + Xposed API
Terminal / SSHlibterm
SVG Renderingcoil-resvg (resvg)
G2 Rounded CornersCapsule

Getting Started

Build from Source

./gradlew assembleDebug

Requirements

  • Android Studio (or Android SDK + JDK 17)
  • An Android 11 or above device
Release Signing

To build a Release version yourself, use your own signing key:

keytool -genkeypair -v -keystore my-release.jks \
  -keyalg RSA -keysize 2048 -validity 10000 -alias my_key

./gradlew assembleRelease \
  -PRELEASE_STORE_FILE=/absolute/path/to/my-release.jks \
  -PRELEASE_STORE_PASSWORD=yourStorePassword \
  -PRELEASE_KEY_ALIAS=my_key \
  -PRELEASE_KEY_PASSWORD=yourKeyPassword

Project Structure

agentic-nexus/
├── app/                 # Main app: settings UI, AgentRuntimeService, Xposed hooks
├── agent-runtime/       # Agent runtime: LLM calls, tool/Skill/MCP execution, Python runtime
├── xposed-api/          # Xposed event types, shared constants (shared by main app and host process)
├── xposed-runtime/      # Xposed runtime, hook base classes
├── store/               # Store persistence, IPC bridge (XIpcBridge)
├── ui-kit/              # Shared Compose components, LiquidScreen shell, navigation
└── libs/
    ├── logging/         # Logging library
    ├── okia/            # Okia Agent runtime base library
    └── libterm/         # Terminal library (with multiple backends)
        ├── libterm-core
        ├── libterm-runtime
        ├── libterm-backend-libsu
        ├── libterm-backend-shizuku
        └── libterm-backend-ssh

Roadmap

  • Floating pet (desktop pet)
  • System voice assistant integration (non-Xposed takeover)
  • File import / sharing from outside the app

Contributing

Pull requests are welcome!

  1. Fork this project
  2. Create a feature branch (git checkout -b feat/your-feature)
  3. Commit your changes (git commit -m 'feat: add your feature', following Conventional Commits)
  4. Push to the branch (git push origin feat/your-feature)
  5. Open a Pull Request

Community

  • Telegram — discuss, ask questions, give feedback
  • GitHub Issues — report bugs or request features
  • Afdian — support the developer

When reporting an issue, please include as much detail as possible: phone model and Android version, system voice assistant and its version, Zafiro version, steps to reproduce, and screenshots or screen recordings.

License

MIT — see LICENSE.

Made with ✨️ by niki914

Contributors

niki914

791 commits

niki914/zafiro

Open-source BYOK AI agent for Android. Full phone control, native Shell & Python 3, with Skills and MCP support, Material 3 Expressive. Works via Shizuku (root optional). Bring any provider: OpenRouter, GLM, and more.

Kotlin

177

791 commits

updated Sep 16, 2026

See the code
accessibility
agent
ai
android
automation
kotlin
llm
lsposed
material-design
mcp
mutimodal
openrouter
python
root
shell
shizuku
skills
ssh
termux
xposed

README

中文 | English

zafiro

stars Ask DeepWiki release downloads kotlin lines Codacy

What is Zafiro?

Zafiro is an open-source intelligent Agent running on Android devices, with BYOK support. It understands your screen, controls your device, and carries out operations across apps — with full support for Skills, MCP, and memory. It can also run Shell and Python 3 natively and wrap tools on its own to perform tasks such as web search and file downloads, or connect to a remote dev machine via SSH.

Zafiro picks and plays music in Spotify via Phone-UseZafiro completes web research with headless web search and article reading via Python scriptsZafiro downloads an APK from the web via Python and installs it with RootZafiro settings screen
Device ControlResearchInstall Apps from the WebSettings

[!IMPORTANT] Zafiro is still in Beta — functionality and experience are being continuously improved. Zafiro runs via Shizuku — no Root required; Root users get the full experience.

You can download a release from Releases, or build from source.

Core Capabilities

Modern UI Design Language

  • Material 3 Expressive & Apple Liquid Glass - a modern, polished interface
  • Personalized Theming - multiple theme colors with dark mode and dynamic color extraction
  • Multilingual Support - English, 中文, 日本語, Español

Device Control

  • Screen Interaction - open apps, pick music, order food — all done for you
  • Fully Visible - an on-screen mouse shows every step the Agent takes

Agent System

  • Out-of-the-Box - built-in support for OpenAI, Anthropic, Google Gemini, DeepSeek, OpenRouter, Kimi, Alibaba Bailian, SiliconFlow, and more
  • Extend as Needed - full support for Skills and MCP, plus memory and a workspace — extend it your way
  • Permission Management - with configurable rules, every command and piece of code is under your control

Python Tools

  • Run Code Directly - run Python 3 natively on the device
  • Meta-Tooling - wrap your own Python tools; the Agent reuses and maintains the tools it creates
  • Built-in Scenarios - web search, web page reading, and APK installation work out of the box

Remote Environments

  • Termux - use Linux commands and tools on your Android device
  • SSH - connect to a dev machine or server to execute remote tasks
  • Claude Code - issue dev tasks from your phone, executed by a remote Coding Agent

Voice Assistant Takeover

Through the LSPosed framework, Zafiro can take over your system voice assistant — wake Breeno or XiaoAi, and the one actually answering is your own Agent. You can decide, based on keywords, which requests go to Zafiro and which pass through to the native assistant. After takeover, the assistant retains full Agent capabilities including device control.

[!NOTE] Taking over the system voice assistant requires Root + LSPosed, and currently supports:

  • OPPO / OnePlus / Realme | Breeno Assistant
  • Xiaomi | XiaoAi (no longer maintained — community contributors welcome)

Voice takeover availability may be affected by phone model, system version, voice assistant version, and vendor system restrictions. When your device does not yet support system assistant takeover, you can still use Zafiro's chat interface with all Agent capabilities.

Demos
Zafiro voice assistant takeover demoZafiro voice assistant takeover demoZafiro voice assistant takeover demo

Tech Stack

CategoryTechnology
LanguageKotlin
UI FrameworkJetpack Compose
Design LanguageMaterial Design 3 Expressive
Liquid GlassAndroid Liquid Glass
Agent RuntimeOkia
Python RuntimeChaquopy
System TakeoverLSPosed + Xposed API
Terminal / SSHlibterm
SVG Renderingcoil-resvg (resvg)
G2 Rounded CornersCapsule

Getting Started

Build from Source

./gradlew assembleDebug

Requirements

  • Android Studio (or Android SDK + JDK 17)
  • An Android 11 or above device
Release Signing

To build a Release version yourself, use your own signing key:

keytool -genkeypair -v -keystore my-release.jks \
  -keyalg RSA -keysize 2048 -validity 10000 -alias my_key

./gradlew assembleRelease \
  -PRELEASE_STORE_FILE=/absolute/path/to/my-release.jks \
  -PRELEASE_STORE_PASSWORD=yourStorePassword \
  -PRELEASE_KEY_ALIAS=my_key \
  -PRELEASE_KEY_PASSWORD=yourKeyPassword

Project Structure

agentic-nexus/
├── app/                 # Main app: settings UI, AgentRuntimeService, Xposed hooks
├── agent-runtime/       # Agent runtime: LLM calls, tool/Skill/MCP execution, Python runtime
├── xposed-api/          # Xposed event types, shared constants (shared by main app and host process)
├── xposed-runtime/      # Xposed runtime, hook base classes
├── store/               # Store persistence, IPC bridge (XIpcBridge)
├── ui-kit/              # Shared Compose components, LiquidScreen shell, navigation
└── libs/
    ├── logging/         # Logging library
    ├── okia/            # Okia Agent runtime base library
    └── libterm/         # Terminal library (with multiple backends)
        ├── libterm-core
        ├── libterm-runtime
        ├── libterm-backend-libsu
        ├── libterm-backend-shizuku
        └── libterm-backend-ssh

Roadmap

  • Floating pet (desktop pet)
  • System voice assistant integration (non-Xposed takeover)
  • File import / sharing from outside the app

Contributing

Pull requests are welcome!

  1. Fork this project
  2. Create a feature branch (git checkout -b feat/your-feature)
  3. Commit your changes (git commit -m 'feat: add your feature', following Conventional Commits)
  4. Push to the branch (git push origin feat/your-feature)
  5. Open a Pull Request

Community

  • Telegram — discuss, ask questions, give feedback
  • GitHub Issues — report bugs or request features
  • Afdian — support the developer

When reporting an issue, please include as much detail as possible: phone model and Android version, system voice assistant and its version, Zafiro version, steps to reproduce, and screenshots or screen recordings.

License

MIT — see LICENSE.

Made with ✨️ by niki914

Contributors

niki914

791 commits

Languages

Kotlin

98.6%

Python

1.3%