Skip to main content
Glama
MarwanDevSpace

mcp-flutter-apk-injector

Apply Android manifest configuration

patch_manifest_and_config
Destructive

Configures a decoded APK's AndroidManifest.xml to add Flutter activities, app subclass, permissions, and flags for cleartext traffic, large heap, and hardware acceleration before packaging.

Instructions

Configure AndroidManifest.xml in a decoded workspace by injecting Flutter activities, application subclass bindings, hardware acceleration, network security flags, and required permissions. Mutates AndroidManifest.xml in-place within workspaceDir; accepts customApplicationClass to rebind android:name, additionalPermissions to insert tags, and boolean flags for usesCleartextTraffic, largeHeap, and hardwareAccelerated. Use after inject_flutter_runtime_and_smali to configure component declarations before packaging; use analyze_injection_surface instead when inspecting the manifest without changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
largeHeapNoSet android:largeHeap='true' in application element to increase RAM heap allocation
workspaceDirYesPath to decompiled APK workspace root directory containing AndroidManifest.xml (modified in-place)
extractNativeLibsNoSet android:extractNativeLibs in application element for legacy native library extraction
hardwareAcceleratedNoSet android:hardwareAccelerated='true' in application element for GPU hardware rendering
usesCleartextTrafficNoSet android:usesCleartextTraffic='true' in application tag to allow unencrypted HTTP traffic
additionalPermissionsNoList of additional Android permissions to inject into AndroidManifest.xml (e.g. ['android.permission.INTERNET', 'android.permission.WAKE_LOCK'])
customApplicationClassNoFully qualified class name of injected Application subclass (e.g. 'com.example.injected.InjectedApplication')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validationYesPost-patch manifest validation result.
workspaceDirYesMutated decoded APK workspace.
addedActivitiesYesActivity class names added during the patch.
applicationClassYesApplication class after the patch.
patchedPermissionsYesPermissions added during the patch.
usesCleartextTrafficYesReported cleartext-traffic configuration request.
addedApplicationMetadataYesApplication metadata keys added during the patch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.1.3
    • addedInput schema / properties / additionalPermissions / description
      Added value: +"List of additional Android permissions to inject into AndroidManifest.xml (e.g. ['android.permission.INTERNET', 'android.permission.WAKE_LOCK'])"
    • addedInput schema / properties / customApplicationClass / description
      Added value: +"Fully qualified class name of injected Application subclass (e.g. 'com.example.injected.InjectedApplication')"
    • addedInput schema / properties / extractNativeLibs
      Added value: +{
      +  "description": "Set android:extractNativeLibs in application element for legacy native library extraction",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / hardwareAccelerated
      Added value: +{
      +  "description": "Set android:hardwareAccelerated='true' in application element for GPU hardware rendering",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / largeHeap
      Added value: +{
      +  "description": "Set android:largeHeap='true' in application element to increase RAM heap allocation",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / usesCleartextTraffic / description
      Added value: +"Set android:usesCleartextTraffic='true' in application tag to allow unencrypted HTTP traffic"
    • addedInput schema / properties / workspaceDir / description
      Added value: +"Path to decompiled APK workspace root directory containing AndroidManifest.xml (modified in-place)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "addedActivities": {
      +      "description": "Activity class names added during the patch.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "addedApplicationMetadata": {
      +      "description": "Application metadata keys added during the patch.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "applicationClass": {
      +      "description": "Application class after the patch.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "patchedPermissions": {
      +      "description": "Permissions added during the patch.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "usesCleartextTraffic": {
      +      "description": "Reported cleartext-traffic configuration request.",
      +      "type": "boolean"
      +    },
      +    "validation": {
      +      "additionalProperties": false,
      +      "description": "Post-patch manifest validation result.",
      +      "properties": {
      +        "messages": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "status": {
      +          "enum": [
      +            "ok",
      +            "warning",
      +            "error"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "status",
      +        "messages"
      +      ],
      +      "type": "object"
      +    },
      +    "workspaceDir": {
      +      "description": "Mutated decoded APK workspace.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "workspaceDir",
      +    "patchedPermissions",
      +    "addedApplicationMetadata",
      +    "addedActivities",
      +    "applicationClass",
      +    "usesCleartextTraffic",
      +    "validation"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.2

TDQS

A4.7/5.0
Behavior4/5

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

The description explicitly states it mutates AndroidManifest.xml in-place, which aligns with the destructiveHint annotation. It does not detail all side effects, but the in-place mutation warning and explicit destructive hint are sufficient for expected use.

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?

The description is dense but well-structured: first sentence gives the primary purpose, second details parameters and usage. Every phrase contributes essential information, and the most important action (mutates in-place) is front-loaded.

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?

Given the tool's complexity with seven parameters and an output schema, the description covers the operation, mutation behavior, sequencing, and alternatives. No critical context for correct invocation is missing.

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

Parameters4/5

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

Schema already covers all parameters with descriptions, so baseline is 3. The description adds meaningful context by explaining how parameters map to manifest modifications (e.g., customApplicationClass rebinds android:name, additionalPermissions inserts uses-permission tags, workspaceDir is modified in-place).

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?

Description clearly states it configures AndroidManifest.xml in a decoded workspace, with specific actions like injecting Flutter activities, rebinding application class, and adding permissions. It distinguishes from siblings by positioning after inject_flutter_runtime_and_smali and before packaging, and explicitly contrasts with analyze_injection_surface.

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?

Provides explicit sequencing: use after inject_flutter_runtime_and_smali and before packaging. Also gives a clear alternative (analyze_injection_surface) when no changes are needed, which makes tool selection unambiguous.

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