Skip to main content
Glama
MarwanDevSpace

mcp-flutter-apk-injector

Analyze APK integration surface

analyze_injection_surface
Read-onlyIdempotent

Analyzes a decoded APK workspace to identify manifest components, ABI coverage, JNI loading hooks, native libraries, anti-debug/root checks, and candidate injection hooks for security auditing.

Instructions

Perform static bytecode analysis and security auditing on a decoded APK workspace to identify manifest components, ABI coverage, JNI loading hooks, native libraries, anti-debug/root checks, and candidate injection hooks. This operation is read-only, non-mutating, and idempotent; requires workspaceDir pointing to a valid directory produced by decompile_apk with an AndroidManifest.xml and smali structures. Use after decompile_apk to audit the target before modifying files; review returned warnings, securityAnalysis, and candidate hooks before selecting an injection mode with inject_flutter_runtime_and_smali.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceDirYesPath to decompiled APK workspace root directory containing AndroidManifest.xml and Smali structures produced by decompile_apk

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
luaModsYesDetected Lua asset paths.
multiDexYesMulti-DEX architecture and Smali root layout analysis.
warningsYesCompatibility warnings that require review before mutation.
packageNameYesManifest package identity.
assetScriptsYesCandidate script-like asset paths.
workspaceDirYesAnalyzed decoded APK workspace.
entryActivitiesYesManifest activities and their resolved Smali paths.
existingFlutterYesWhether Flutter embedding classes were detected.
jniLoadingHooksYesEvidence strings for detected JNI library loading calls.
nativeLibrariesYesDetected native .so libraries grouped by ABI architecture.
applicationClassYesDeclared application class, when present.
manifestSecurityYesManifest security configuration and attack surface audit.
securityAnalysisYesDeep bytecode security audit (root, anti-debug, emulator, ssl pinning, obfuscator).
existingNativeAbisYesNative ABI directories detected in the target.
existingApplicationYesWhether the manifest declares an application class.
applicationClassPathYesResolved application Smali path, when available.
existingFlutterClassesYesDetected existing Flutter class paths.
recommendedPatchPointsYesSuggested host integration points.
automatedChainSuggestionsYesSuggested next pipeline actions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.4
    • addedOutput schema / properties / manifestSecurity
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Manifest security configuration and attack surface audit.",
      +  "properties": {
      +    "allowBackup": {
      +      "description": "Whether android:allowBackup is enabled.",
      +      "type": "boolean"
      +    },
      +    "dangerousPermissions": {
      +      "description": "Declared dangerous Android permissions.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "debuggable": {
      +      "description": "Whether android:debuggable is enabled.",
      +      "type": "boolean"
      +    },
      +    "exportedComponentsCount": {
      +      "description": "Count of exported activities/components without permission barriers.",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "usesCleartextTraffic": {
      +      "description": "Whether android:usesCleartextTraffic is permitted.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "debuggable",
      +    "allowBackup",
      +    "usesCleartextTraffic",
      +    "exportedComponentsCount",
      +    "dangerousPermissions"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / multiDex
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Multi-DEX architecture and Smali root layout analysis.",
      +  "properties": {
      +    "isMultiDex": {
      +      "description": "Whether the workspace contains multiple Smali root classes.",
      +      "type": "boolean"
      +    },
      +    "smaliRoots": {
      +      "description": "List of detected Smali root directory names.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "isMultiDex",
      +    "smaliRoots"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / nativeLibraries
      Added value: +{
      +  "additionalProperties": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "description": "Detected native .so libraries grouped by ABI architecture.",
      +  "type": "object"
      +}
    • addedOutput schema / properties / securityAnalysis
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Deep bytecode security audit (root, anti-debug, emulator, ssl pinning, obfuscator).",
      +  "properties": {
      +    "antiDebug": {
      +      "description": "Detected anti-debugging checks (e.g. Debug.isDebuggerConnected).",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "emulatorDetection": {
      +      "description": "Detected emulator environment markers.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "obfuscator": {
      +      "description": "Detected obfuscator or native packer fingerprint.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "rootDetection": {
      +      "description": "Detected root and integrity check markers in bytecode.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "sslPinning": {
      +      "description": "Detected SSL pinning or custom TrustManager markers.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "rootDetection",
      +    "antiDebug",
      +    "emulatorDetection",
      +    "sslPinning",
      +    "obfuscator"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "workspaceDir",
      -  "packageName",
      -  "applicationClass",
      -  "applicationClassPath",
      -  "existingApplication",
      -  "entryActivities",
      -  "existingFlutter",
      -  "existingFlutterClasses",
      -  "existingNativeAbis",
      -  "jniLoadingHooks",
      -  "assetScripts",
      -  "luaMods",
      -  "recommendedPatchPoints",
      -  "automatedChainSuggestions",
      -  "warnings"
      -]New value: +[
      +  "workspaceDir",
      +  "packageName",
      +  "applicationClass",
      +  "applicationClassPath",
      +  "existingApplication",
      +  "entryActivities",
      +  "existingFlutter",
      +  "existingFlutterClasses",
      +  "existingNativeAbis",
      +  "nativeLibraries",
      +  "securityAnalysis",
      +  "manifestSecurity",
      +  "multiDex",
      +  "jniLoadingHooks",
      +  "assetScripts",
      +  "luaMods",
      +  "recommendedPatchPoints",
      +  "automatedChainSuggestions",
      +  "warnings"
      +]
  2. Changed2 schema fields changedv0.1.3
    • addedInput schema / properties / workspaceDir / description
      Added value: +"Path to decompiled APK workspace root directory containing AndroidManifest.xml and Smali structures produced by decompile_apk"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "applicationClass": {
      +      "description": "Declared application class, when present.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "applicationClassPath": {
      +      "description": "Resolved application Smali path, when available.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "assetScripts": {
      +      "description": "Candidate script-like asset paths.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "automatedChainSuggestions": {
      +      "description": "Suggested next pipeline actions.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "entryActivities": {
      +      "description": "Manifest activities and their resolved Smali paths.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "exported": {
      +            "type": "boolean"
      +          },
      +          "launcher": {
      +            "type": "boolean"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "path": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "exported",
      +          "launcher",
      +          "path"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "existingApplication": {
      +      "description": "Whether the manifest declares an application class.",
      +      "type": "boolean"
      +    },
      +    "existingFlutter": {
      +      "description": "Whether Flutter embedding classes were detected.",
      +      "type": "boolean"
      +    },
      +    "existingFlutterClasses": {
      +      "description": "Detected existing Flutter class paths.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "existingNativeAbis": {
      +      "description": "Native ABI directories detected in the target.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "jniLoadingHooks": {
      +      "description": "Evidence strings for detected JNI library loading calls.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "luaMods": {
      +      "description": "Detected Lua asset paths.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "packageName": {
      +      "description": "Manifest package identity.",
      +      "type": "string"
      +    },
      +    "recommendedPatchPoints": {
      +      "description": "Suggested host integration points.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "warnings": {
      +      "description": "Compatibility warnings that require review before mutation.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "workspaceDir": {
      +      "description": "Analyzed decoded APK workspace.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "workspaceDir",
      +    "packageName",
      +    "applicationClass",
      +    "applicationClassPath",
      +    "existingApplication",
      +    "entryActivities",
      +    "existingFlutter",
      +    "existingFlutterClasses",
      +    "existingNativeAbis",
      +    "jniLoadingHooks",
      +    "assetScripts",
      +    "luaMods",
      +    "recommendedPatchPoints",
      +    "automatedChainSuggestions",
      +    "warnings"
      +  ],
      +  "type": "object"
      +}
  3. First observedv0.1.2

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, and non-destructive. The description reinforces these traits and adds the prerequisite that workspaceDir must point to a decompile_apk output with AndroidManifest.xml and smali structures, plus hints at the return contents (warnings, securityAnalysis, candidate hooks). No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no filler: the first front-loads the action and outputs, the second gives usage guidance and prerequisites. Every sentence contributes, and the structure is easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a single, fully documented parameter and an output schema present, the description provides the necessary workflow placement and tells the agent what to do with the results (review before injection). Nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description for workspaceDir already fully specifies it as a path to a decompiled APK directory produced by decompile_apk. The description restates this requirement but adds no new semantic meaning. With 100% schema coverage, the baseline of 3 is appropriate; the redundancy does not hurt but adds little.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Perform static bytecode analysis and security auditing on a decoded APK workspace') and enumerates exact outputs (manifest components, ABI coverage, JNI loading hooks, native libraries, anti-debug/root checks, candidate injection hooks). It also distinguishes itself from siblings by positioning itself as the audit step between decompile_apk and inject_flutter_runtime_and_smali.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it: 'Use after decompile_apk to audit the target before modifying files' and routes to the next step: 'review returned warnings, securityAnalysis, and candidate hooks before selecting an injection mode with inject_flutter_runtime_and_smali.' This gives clear context and names the relevant alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.