mcp-flutter-apk-injector
This server provides a complete toolkit for Android APK reverse engineering and Flutter runtime injection, enabling a decompile → analyze → synthesize → inject → patch → repackage pipeline for security testing and authorized customization.
Decompile APK: Disassemble an APK into Smali code, native libraries, resources, and a decoded AndroidManifest.xml.
Analyze Injection Surface: Scan the decompiled workspace to identify optimal injection points (Application class, entry Activity, JNI loading sites, pre-existing Flutter classes).
Synthesize Flutter Payload: Compile a Flutter project and extract required runtime artifacts (libflutter.so, libapp.so, flutter_assets, ICU data) for target ABIs.
Inject Flutter Runtime & Smali: Merge Flutter engine assets, native libraries, and custom Smali glue code, supporting multiple injection modes (activity_overlay, view_tree_injection, headless_engine, direct_application_hook) and optional MethodChannel bridge.
Patch Manifest & Configuration: Modify AndroidManifest.xml to add permissions (INTERNET, WAKE_LOCK), override the Application class, add FlutterActivity, and adjust cleartext traffic settings.
Recompile, Align & Sign: Rebuild the modified APK with apktool, align with zipalign, and cryptographically sign with apksigner (V1/V2/V3 schemes).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-flutter-apk-injectorDecompile the APK and inject the Flutter runtime, then repackage it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-flutter-apk-injector
The World's Most Advanced Memory-Aware Model Context Protocol (MCP) Server for Android APK Reverse Engineering, Dalvik/Smali Bytecode Refactoring, Native JNI Tracing, and Flutter Runtime Overlay Injection.
🇬🇧 English Documentation | 🇸🇦 التوثيق باللغة العربية
🇬🇧 English Documentation
🌟 Executive Overview & Key Advantages
mcp-flutter-apk-injector is a highly developed, enterprise-grade Model Context Protocol (MCP) Server designed for security researchers, reverse engineers, and mobile penetration testers. It seamlessly combines automated static/dynamic Android binary analysis, Dalvik/ART Smali stack frame balance refactoring, native .so library symbol tracing, and Flutter Add-to-App v2 runtime injection.
Powered by Hermes+ (Universal Main Character), this server provides persistent session telemetry, searchable patch history, MCP resources, and zero-argument resilient prompt handlers. Version 0.6.0 adds typed output schemas, behavioral annotations, structured responses, and a mandatory cross-client character contract for evidence-first workflow guidance.
┌─────────────────────────────────────────┐
│ AI Assistant / MCP Client (Claude, │
│ Antigravity IDE, Cursor, Windsurf) │
└────────────────────┬────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ mcp-flutter-apk-injector (v0.6.0) │
│ │
│ ┌────────────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐ │
│ │ Hermes+ Agent Engine │ │ Session Memory Manager │ │ Embedded Skills & Prompts│ │
│ │ (Persona & Rules Graph)│ │ (.mcp_memory/session) │ │ (/scan, /decompile, ...)│ │
│ └───────────┬────────────┘ └────────────┬────────────┘ └────────────┬────────────┘ │
└──────────────┼────────────────────────────┼────────────────────────────┼───────────────┘
│ │ │
▼ ▼ ▼
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ THE 9 ENTERPRISE MCP TOOLS & RESOURCES │
│ │
│ [decompile_apk] ──► [analyze_surface] ──► [synthesize_payload] ──► [inject_flutter] │
│ [patch_manifest] ──► [recompile_align_sign] ──► [get_context] ──► [update_memory] │
└────────────────────────────────────────────────────────────────────────────────────────┘🧠 Hermes+ (Universal Main Character) & MCP Skill Ecosystem
1. Embedded Persona: Hermes+ (Universal Main Character)
Hermes+ (Universal Main Character) is the required primary repository persona for Gemini, Antigravity, Cursor, Claude Code, and compatible MCP clients. It is specialized in ARM/ARM64 binary inspection, JNI method hooks, Dalvik register-stack allocation (v0-vN, p0-pN), and Flutter-aware Android workspace engineering. It observes before mutation, exposes uncertainty, preserves execution integrity, and verifies outputs before reporting completion.
2. Native MCP Skills (.agents/skills/)
🧠
hermes-apk-reverse-engineering: Guides static/dynamic DEX bytecode refactoring, register frame bumping (.registers N), native.solibrary deployment, and zero-crash UI overlay injection.⚡
mcp-toolchain-orchestrator: Manages MCP server quality assurance, zero-argument prompt resiliency, automated testing, and distribution workflows.
📡 Native MCP Resources
resource://agent/persona: Hermes+ identity, system prompt, and core reverse engineering rules.resource://agent/rules: 5-step deep reverse engineering protocol.resource://agent/skills/hermes-apk-reverse-engineering: Reverse engineering skill document.resource://agent/skills/mcp-toolchain-orchestrator: Toolchain orchestrator skill document.resource://memory/session: Live JSON session memory graph state.resource://memory/patch_history: Audit log of applied Smali and Manifest patches.
⚙️ 5-Step Deep Reverse Engineering Pipeline
[Target Android .apk / Workspace]
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ STEP 1: Binary & Asset Deconstruction (decompile_apk) │
│ Extract DEX Smali bytecode, native lib/*.so trees, AXML, assets/ │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ STEP 2: Precision Native & Smali Tracing (analyze_injection_surface) │
│ Trace UI click handlers (View$OnClickListener), 0x7f... R-ids, │
│ JNI native symbols, and Lua script hook points │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ STEP 3: Seamless Payload Injection (inject_flutter_runtime_and_smali) │
│ Synthesize Flutter engine payload; balance register stack frames │
│ (.registers N); inject native-looking UI without crashes │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ STEP 4: Manifest Surgery & Assembly (patch_manifest & recompile_align) │
│ Patch AndroidManifest.xml (permissions, Application override, ABIs); │
│ Rebuild (apktool b), 4-byte Align (zipalign), Sign (apksigner) │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ STEP 5: Architectural Summary & Session Memory Persistence │
│ Document modified Smali paths, .so symbol offsets, injected channels, │
│ register maps, and verified output APK location │
└───────────────────────────────────────────────────────────────────────────┘🛠️ The 9 Enterprise MCP Tools
Tool Name | Detailed Function & Output |
| Disassemble target APK into Smali bytecode, native libraries ( |
| Scan decompiled APK workspace to identify optimal injection hooks, entry Activity, Application class, JNI loading hooks, native ABIs, and recommended patch points. |
| Extract Flutter runtime artifacts ( |
| Inject Flutter assets, native |
| Patch |
| Rebuild workspace with |
| Retrieve Hermes+ persona, loaded skills, live memory summary, and pipeline telemetry. |
| Explicitly update active session memory state with notes, identified targets, or patch logs. |
| Search and inspect historical patch logs, register allocations, and decompilation metadata. |
🎮 The 4 Dynamic Injection Modes
Injection Strategy | Primary Smali Target | Description |
|
| Launches a dedicated Flutter Activity reusing a pre-warmed cached engine for custom UI overlays inside apps or mobile games. |
| Launcher Activity | Experimental: attaches |
|
| Initializes a background engine without UI for headless Dart execution, channel routing, and telemetry. |
|
| Directly instruments existing Application class in Smali without modifying |
⚡ Agent Prompts & Slash Commands
/scan: Diagnostic audit scan of decompiled APK workspace, entry points, Smali structure, and native ABIs./decompile: Disassemble target.apkinto Smali bytecode and resources usingapktool./inject: Execute Flutter runtime payload & Smali glue code injection into target APK./patch: PatchAndroidManifest.xml(application class, hardware acceleration, cleartext traffic, permissions)./recompile: Repackage (apktool b), byte-align (zipalign), and cryptographically sign (apksigner) modified target./pipeline: Evidence-first decompilation ➔ analysis ➔ payload synthesis ➔ injection ➔ manifest patch ➔ build verification workflow./merge: Plan split-package compatibility without claiming arbitrary APK splits can be file-merged into a standalone APK./revert: Inspect patch-history and backup evidence; restoration is only available when verified patch-set artifacts exist./memory: Inspect active session memory state, historical patch logs, and allocated register frames./hermes_guide: Display Hermes+ architecture rules and reverse engineering guidelines.
Required first step: activate Hermes+ (Universal Main Character)
Required before repository work: activate the Hermes+ character adapter for the client you use. Do not begin analysis, edits, command execution, or release work until the applicable adapter is active. This is a repository workflow requirement; it provides persistent agent context and does not replace normal code review, access control, or security controls.
Client | Required repository adapter | User action and verification |
Gemini CLI | Open the repository as a workspace. Gemini CLI discovers workspace | |
Antigravity | In Customizations → Rules, add/select the workspace rule and set its activation to Always On before starting agent work.[2] | |
Cursor | Keep the committed | |
Claude Code | Start Claude Code from the repository root. | |
Other AGENTS-compatible clients | Load the root adapter, which directs the client to the portable source contract at |
🚀 Quick Start & MCP Client Configuration (v0.6.0)
After completing the required character setup, install or run the MCP server:
# Global installation
npm install -g mcp-flutter-apk-injector@latest
# Direct execution
npx -y mcp-flutter-apk-injector@latestMCP stdio configuration
Use the following server configuration in Claude Desktop, Antigravity, or another MCP client that accepts a stdio command configuration:
{
"mcpServers": {
"mcp-flutter-apk-injector": {
"command": "npx",
"args": ["-y", "mcp-flutter-apk-injector@latest"],
"env": {
"MCP_FLUTTER_LOG_LEVEL": "info"
}
}
}
}Client setup references
[1]: https://geminicli.com/docs/cli/gemini-md/ — Gemini CLI documentation: workspace GEMINI.md context and /memory inspection.
[2]: https://antigravity.google/docs/rules-workflows — Google Antigravity documentation: workspace rules in .agents/rules and Always On activation.
[3]: https://cursor.com/docs/rules — Cursor documentation: version-controlled .cursor/rules/*.mdc project rules and alwaysApply behavior.
[4]: https://code.claude.com/docs/en/memory — Claude Code documentation: project CLAUDE.md, imports, and /context verification.
Related MCP server: Flutter MCP
🇸🇦 التوثيق باللغة العربية
🌟 الملخص التنفيذي والمميزات الاستثنائية
خادم mcp-flutter-apk-injector هو خادم Model Context Protocol (MCP) الأكثر تطوراً واحترافية عالمياً والمخصص لـ الهندسة العكسية لتطبيقات أندرويد APK، إعادة هيكلة شفرات Smali/DEX، تتبع رموز JNI الأصلية، وحقن محرك تشغيل Flutter (Add-to-App v2).
مدعوماً بالمحرك الذكي Hermes+ Master Agent Engine، ينتقل هذا الخادم من مجرد خادم أدوات عادي إلى منظومة ذكاء اصطناعي ذاتية التوجيه والتصحيح (Stateful Agentic System) تمتلك ذاكرة جلسات مستمرة، ورسم بياني محلي قابل للبحث لتعديلات الشفرات، وموارد MCP أصلية، وأوامر تفاعلية مرنة ضد أخطاء المعاملات.
🧠 منظومة الوكيل الذكي Hermes+ ومهارات MCP Skills
1. شخصية الوكيل المدمجة: Hermes+
شخصية ذكاء اصطناعي مدمجة تخصصية في تحليل معمارية تطبيقات وألعاب أندرويد (ARM/ARM64)، فحص رموز JNI، موازنة سجلات Dalvik Stack (v0-vN, p0-pN)، وتعديل أصول المحركات مثل Lua/C++.
2. مهارات MCP المدمجة (.agents/skills/)
🧠
hermes-apk-reverse-engineering: المهارة الرئيسية لإعادة هيكلة شفرات DEX/Smali، موازنة السجلات (.registers N)، زرع المكتبات الأصلية.soوحقن واجهات Flutter بدون انهيار التطبيق.⚡
mcp-toolchain-orchestrator: المهارة الرئيسية لإدارة وتنسيق أدوات MCP، المعالجة السريعة للأوامر بدون وسائط، وأتمتة الاختبارات والنشر.
📡 موارد MCP الأصلية (MCP Resources)
resource://agent/persona: هوية Hermes+ وقواعد الهندسة العكسية.resource://agent/rules: بروتوكول الخطوات الخمس للهندسة العكسية.resource://agent/skills/hermes-apk-reverse-engineering: وثيقة مهارة الهندسة العكسية.resource://agent/skills/mcp-toolchain-orchestrator: وثيقة مهارة تنسيق الأدوات.resource://memory/session: حالة الذاكرة الحية للجلسة الحالية بصيغة JSON.resource://memory/patch_history: سجل تعديلات وترقيعات شفرات Smali و Manifest.
⚙️ مسار العمل الخماسي للهندسة العكسية (5-Step Pipeline)
[تطبيق أندرويد APK Target / مساحة العمل]
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ الخطوة 1: تفكيك البناء والأصول (decompile_apk) │
│ استخراج شفرات Smali DEX، أشجار مكتبات lib/*.so، ملفات AXML والأصول │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ الخطوة 2: التتبع الدقيق لرموز JNI و Smali (analyze_injection_surface) │
│ تتبع معالجات النقر (View$OnClickListener)، معرفات 0x7f... R-ids، │
│ رموز JNI الأصلية، ونقاط خطاطيف سكربتات Lua │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ الخطوة 3: زرع وحقن المحرك والحمولة (inject_flutter_runtime_and_smali) │
│ بناء أصول Flutter؛ موازنة سجلات الـ Stack (.registers N)؛ │
│ حقن الواجهات بشكل أصيل ودون حدوث انهيار │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ الخطوة 4: تعديل الـ Manifest وإعادة التجميع (patch_manifest & recompile) │
│ تعديل AndroidManifest.xml (التصاريح، كلاس التطبيق، المعماريات)؛ │
│ إعادة التجميع (apktool b)، المحاذاة (zipalign)، التوقيع (apksigner) │
└─────────────────────────────────────┬─────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ الخطوة 5: التقرير المعماري وحفظ الذاكرة (Session Memory Persistence) │
│ توثيق مسارات Smali المعدلة، إزاحات مكتبات .so، القنوات المحقونة، │
│ وخريطة السجلات وموقع الـ APK النهائي المكتمل │
└───────────────────────────────────────────────────────────────────────────┘🛠️ الأدوات الـ 9 الاحترافية في MCP
اسم الأداة | الوظيفة التفصيلية والمخرجات |
| تفكيك ملف APK الهدف إلى شفرات Smali bytecode ومكتبات نظام وموارد وفك تشفير AndroidManifest.xml، مع تحديث الذاكرة تلقائياً. |
| مسح مساحة العمل وتحديد كلاس التطبيق والـ Activity الرئيسي ومواقع تحميل JNI والـ ABIs والتوصيات. |
| استخراج أصول تشغيل Flutter ( |
| زرع أصول وقواعد Smali ومكتبات النظام مع موازنة سجلات Stack. |
| تعديل |
| إعادة التجميع ( |
| استرجاع هوية Hermes+ والمهارات المتاحة وحالة الذاكرة الحية والسياق الحالي. |
| تحديث ذاكرة الجلسة الحية بملحوظات أو أهداف أو سجلات تعديل جديدة. |
| البحث والافتراش في سجلات الترقيع والذاكرة والمخرجات السابقة. |
🎮 أنماط الحقن الـ 4 المتقدمة
نمط الحقن | الهدف الرئيسي في Smali | الوصف المعماري |
|
| تشغيل Activity مخصص يرث من |
| Launcher Activity | إرفاق |
|
| تشغيل محرك |
|
| تعديل كلاس الـ |
⚡ أوامر Tigger والتفاعل السريع (Slash Commands)
/scan: فحص وتشخيص السطح القابل للحقن داخل مساحة عمل الـ APK وتحديد مكتبات النظام ودرجات الأمان./decompile: تفكيك ملف الـ APK الهدف إلى شفرات Smali وموارد باستخدامapktool./inject: تنفيذ حقن بيئة تشغيل Flutter ومكتبات النظام وتوليد شفرات الـ Smali التكيفية./patch: تعديل ملفAndroidManifest.xml(كلاس التطبيق، التسريع البرمجي، تصاريح الشبكة والـ Cleartext Traffic)./recompile: إعادة تجميع التطبيق (apktool b)، محاذاة البيانات (zipalign) والتوقيع الرقمي (apksigner)./pipeline: المسار الآلي الكامل الشامل: تفكيك ➔ تحليل ➔ بناء ➔ حقن ➔ تعديل ➔ إعادة تجميع وتوقيع./memory: فحص وتفتيش ذاكرة الجلسة الحية وسجل الترقيعات والمجموعات المسجلة./hermes_guide: عرض قواعد معمارية Hermes+ وإرشادات الهندسة العكسية.
💻 متطلبات النظام
Node.js >= 18.0.0
بيئة جافا / JDK (مطلوبة لأدوات
apktoolوapksigner)أدوات بناء Android SDK (
zipalignوapksigner— يتم اكتشافها تلقائياً منANDROID_HOMEأو متغيرات النظام)apktool مثبت على متغيرات النظام PATH
Flutter SDK (مطلوب فقط عند استدعاء أداة
synthesize_flutter_payload)
🧪 التطوير والاختبار
# تثبيت التبعيات المحلية
npm install
# بناء مشروع TypeScript إلى dist/
npm run build
# فحص الأنواع دون إخراج
npm run typecheck
# فحص تنسيق الشفرة والأخطاء البرمجية
npm run lint
# تشغيل حزمة اختبارات Vitest (40 اختباراً)
npm test📜 License / الترخيص
Maintenance
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a one-stop automated solution for Android APK security analysis by integrating tools like JEB, JADX, APKTOOL, FlowDroid, and MobSF into unified MCP standard API interfaces.11
- AlicenseAqualityFmaintenanceA real-time server that provides Flutter/Dart documentation and pub.dev package information to AI assistants, ensuring they generate accurate and up-to-date Flutter code.874MIT
- FlicenseNot gradedqualityDmaintenanceEnables analysis of native Android libraries (SO files) and Flutter applications, including decompilation, function identification, SSL certificate bypass patching, and binary modification through 30+ specialized tools.10
- FlicenseNot gradedqualityDmaintenanceIntegrates multiple Android APK security analysis tools into MCP standard APIs for automated static and dynamic analysis and vulnerability detection.
Related MCP Connectors
MCP server for static security analysis of Android source code
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarwanDevSpace/mcp-flutter-apk-injector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server