{"id":3868,"library":"androguard","title":"Androguard","description":"Androguard is a comprehensive Python toolkit for reverse engineering and analyzing Android applications. It supports various Android file formats like DEX, ODEX, APK, Android's binary XML, and resources. The library offers capabilities for disassembly, basic decompilation, static and dynamic analysis, and Frida integration. The project is actively maintained, with version 4.1.3 released on February 24, 2025, representing a significant evolution from the 3.x series.","status":"active","version":"4.1.3","language":"python","source_language":"en","source_url":"https://github.com/androguard/androguard","tags":["android","reverse-engineering","malware-analysis","apk","dex","static-analysis","dynamic-analysis","security"],"install":[{"cmd":"pip install androguard","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Androguard requires Python 3.9 or higher, but not Python 4.x.","package":"python","optional":false}],"imports":[{"symbol":"AnalyzeAPK","correct":"from androguard.misc import AnalyzeAPK"},{"symbol":"APK","correct":"from androguard.core.apk import APK"},{"symbol":"DEX","correct":"from androguard.core.dex import DEX"},{"symbol":"Analysis","correct":"from androguard.core.analysis.analysis import Analysis"}],"quickstart":{"code":"from androguard.misc import AnalyzeAPK\nimport os\n\n# NOTE: Replace 'path/to/your/app.apk' with an actual APK file path.\n# For a runnable example, you'd need a sample APK.\napk_file_path = os.environ.get('ANDROGUARD_SAMPLE_APK', 'path/to/your/app.apk')\n\ntry:\n    # Analyze the APK file\n    a, d, dx = AnalyzeAPK(apk_file_path)\n\n    print(f\"Package Name: {a.get_package()}\")\n    print(f\"Main Activity: {a.get_main_activity()}\")\n    print(\"Permissions:\")\n    for perm in a.get_permissions():\n        print(f\"  - {perm}\")\n\n    print(f\"Number of DEX files: {len(d)}\")\n    print(f\"Total classes analyzed: {len(dx.get_classes())}\")\n\nexcept Exception as e:\n    print(f\"Error analyzing APK: {e}\")\n    print(\"Please ensure 'ANDROGUARD_SAMPLE_APK' environment variable points to a valid APK, or replace 'path/to/your/app.apk' with a real path.\")","lang":"python","description":"This quickstart demonstrates how to load and perform basic static analysis on an APK file using `AnalyzeAPK`. It retrieves the package name, main activity, permissions, and counts of DEX files and classes. Replace 'path/to/your/app.apk' or set the `ANDROGUARD_SAMPLE_APK` environment variable to a valid APK path for execution."},"warnings":[{"fix":"Review the official GitHub documentation and issue tracker for migration guides. Expect refactoring of existing scripts.","message":"Androguard versions 4.0.0 and later introduce substantial differences and removed functionalities compared to the previous stable version 3.3.5 (released in 2019). Code written for 3.x might not be compatible with 4.x.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade your Python environment to 3.9 or newer. Ensure your project's `requirements.txt` specifies compatible Python versions.","message":"Support for Python 2.7 was officially dropped in Androguard 4.0.1. The library now requires Python 3.9 or higher.","severity":"breaking","affected_versions":">=4.0.1"},{"fix":"Projects built on older 3.x versions using AXML parsing should carefully check for renamed/removed functions and adjust their code accordingly. Consult `androguard.core.bytecodes.axml` module changes.","message":"Between versions 3.2 and 3.3.3/3.3.5, the AXML parser and related functions underwent significant refactoring and reorganization. Some functions were renamed or removed, especially those dealing with namespace resolution.","severity":"deprecated","affected_versions":"3.x"},{"fix":"For bulk analysis, consider pickling the `APK` and `Analysis` objects directly, or utilize the `AndroAuto` framework which is designed for large-scale analysis. Be mindful of disk space.","message":"Using `Session` objects for bulk analysis of many APKs can lead to very large storage consumption, as session objects can be more than 30 times larger than the original APK.","severity":"gotcha","affected_versions":"All"},{"fix":"Before reporting an issue, try using official Android tools like `aapt2` or `apkanalyzer` to decode the manifest. Check ZIP file integrity. If the file is indeed malformed and causes issues, report it to the Androguard project.","message":"Androguard's parsing of `AndroidManifest.xml` can sometimes fail when encountering 'edge cases' or deliberately malformed APKs (e.g., in malware).","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-21T21:44:05.142Z","next_check":"2026-07-10T00:00:00.000Z","problems":[{"fix":"Update the import statement to 'from androguard.core import axml'.","cause":"The 'androguard.core.bytecodes' module has been relocated in newer versions of Androguard.","error":"ModuleNotFoundError: No module named 'androguard.core.bytecodes'"},{"fix":"Import the function using 'from androguard.misc import AnalyzeAPK'.","cause":"The 'AnalyzeAPK' function is not imported or defined in the current scope.","error":"NameError: name 'AnalyzeAPK' is not defined"},{"fix":"Ensure sufficient system memory is available or analyze smaller APK files.","cause":"Analyzing large APK files can exceed available memory resources.","error":"MemoryError"},{"fix":"Ensure the `androguard` library and its dependencies (like `apkInspector`) are updated to their latest versions, as these issues are often resolved in newer releases. If the problem persists with a specific APK, the APK itself might be malformed. [14]","cause":"This error typically occurs when Androguard attempts to iterate over an object that is `None`, often due to an underlying parsing error or an unexpected structure within the analyzed APK, such as a DEX file lacking string data or other malformed components.","error":"TypeError: 'NoneType' object is not iterable"},{"fix":"Update the `apkInspector` library to its latest version (e.g., `pip install --upgrade apkInspector`). This issue has been patched in `apkInspector` version 1.3.3 and later. [23]","cause":"This error originates from `apkInspector` (a dependency of Androguard) when it encounters an APK with a malformed ZIP structure, specifically when entries in the central directory are not properly available in the local file entries.","error":"AttributeError: 'NoneType' object has no attribute 'filename'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.1.3","cli_name":"androguard","cli_version":"androguard, version 4.1.3","type":"library","homepage":"https://androguard.github.io","github":"https://github.com/androguard/androguard","docs":null,"changelog":null,"pypi":"https://pypi.org/project/androguard/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","auth-security","ai-ml","database","testing"],"base_url":null,"auth_type":null,"install_checks":{"last_tested":"2026-05-21","tag":null,"tag_description":null,"installed_version":"4.1.3","pypi_latest":"4.1.3","is_stale":false,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":18.6,"import_time_s":1.34,"mem_mb":51.1,"disk_size":"399M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":1.76,"mem_mb":51.3,"disk_size":"376M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":17.9,"import_time_s":2.13,"mem_mb":55,"disk_size":"427M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":2.47,"mem_mb":55,"disk_size":"403M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":17.5,"import_time_s":2.4,"mem_mb":52.7,"disk_size":"409M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":2.49,"mem_mb":52.6,"disk_size":"385M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":17.1,"import_time_s":2.13,"mem_mb":53.6,"disk_size":"408M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":3.02,"mem_mb":53.6,"disk_size":"384M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"androguard","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":19.9,"import_time_s":1.33,"mem_mb":44.6,"disk_size":"374M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"androguard","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":1.66,"mem_mb":44.6,"disk_size":"373M"}]},"_links":{"self":"https://checklist.day/api/registry/androguard","v1":"https://checklist.day/v1/registry/androguard","v1_install":"https://checklist.day/v1/registry/androguard/install","v1_imports":"https://checklist.day/v1/registry/androguard/imports","v1_compatibility":"https://checklist.day/v1/registry/androguard/compatibility","v1_quickstart":"https://checklist.day/v1/registry/androguard/quickstart","docs":"https://checklist.day/docs"}}