get_manifest
Extract and retrieve the AndroidManifest.xml file from a decoded APK project to analyze app permissions, components, and configurations.
Instructions
Get the AndroidManifest.xml content from a decoded APK project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_dir | Yes |
Implementation Reference
- apktool_mcp_server.py:410-455 (handler)Handler function for the 'get_manifest' MCP tool. It validates the project directory, locates and reads the AndroidManifest.xml file, and returns its content along with metadata and file information. Includes comprehensive error handling.@mcp.tool() async def get_manifest(project_dir: str) -> Dict: """ Get the AndroidManifest.xml content from a decoded APK project with validation. Args: project_dir: Path to the APKTool project directory Returns: Dictionary with manifest content, metadata, and validation results """ # Input validation path_validation = ValidationUtils.validate_path(project_dir, must_exist=True) if not path_validation["valid"]: return {"success": False, "error": path_validation["error"]} manifest_path = os.path.join(project_dir, "AndroidManifest.xml") if not os.path.exists(manifest_path): return { "success": False, "error": f"AndroidManifest.xml not found in {project_dir}", "expected_path": manifest_path } try: with open(manifest_path, 'r', encoding="utf-8") as f: content = f.read() result = { "success": True, "manifest": content, "path": manifest_path, "size": os.path.getsize(manifest_path), "encoding": "utf-8" } return result except Exception as e: logger.error(f"Error reading manifest: {str(e)}") return { "success": False, "error": f"Failed to read AndroidManifest.xml: {str(e)}", "path": manifest_path }