get_apktool_yml
Extract and retrieve apktool.yml configuration details from a decoded APK project for streamlined Android reverse engineering and analysis.
Instructions
Get apktool.yml information from a decoded APK project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_dir | Yes |
Implementation Reference
- apktool_mcp_server.py:457-501 (handler)The handler function for the 'get_apktool_yml' MCP tool. It validates the input project directory, checks for the existence of 'apktool.yml', reads its content if present, and returns structured metadata including the file content, path, size, and encoding. Includes comprehensive error handling.async def get_apktool_yml(project_dir: str) -> Dict: """ Get apktool.yml information from a decoded APK project with validation. Args: project_dir: Path to APKTool project directory Returns: Dictionary with apktool.yml 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"]} yml_path = os.path.join(project_dir, "apktool.yml") if not os.path.exists(yml_path): return { "success": False, "error": f"apktool.yml not found in {project_dir}", "expected_path": yml_path } try: with open(yml_path, 'r', encoding="utf-8") as f: content = f.read() result = { "success": True, "content": content, "path": yml_path, "size": os.path.getsize(yml_path), "encoding": "utf-8" } return result except Exception as e: logger.error(f"Error reading apktool.yml: {str(e)}") return { "success": False, "error": f"Failed to read apktool.yml: {str(e)}", "path": yml_path }