{"id":17009453,"url":"https://github.com/david-lev/apkfile","last_synced_at":"2025-03-22T16:30:58.506Z","repository":{"id":62914666,"uuid":"563413740","full_name":"david-lev/apkfile","owner":"david-lev","description":"⛏️ apkfile • Python library for handling APK, APKM, XAPK, and APKS files","archived":false,"fork":false,"pushed_at":"2023-11-16T14:44:39.000Z","size":97,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T13:32:33.606Z","etag":null,"topics":["aapt","android","apk","apkinfo","apkm","apkmirror","apks","python","sai","xapk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/david-lev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-08T15:04:52.000Z","updated_at":"2024-12-26T09:40:00.000Z","dependencies_parsed_at":"2024-10-28T14:09:37.766Z","dependency_job_id":"9bf1b109-6494-4172-9584-ec69e4325702","html_url":"https://github.com/david-lev/apkfile","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.02941176470588236,"last_synced_commit":"7fb50114b9f0c0ea454fcaf25cbb53ecb8c67d36"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-lev%2Fapkfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-lev%2Fapkfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-lev%2Fapkfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-lev%2Fapkfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/david-lev","download_url":"https://codeload.github.com/david-lev/apkfile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244986417,"owners_count":20543011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aapt","android","apk","apkinfo","apkm","apkmirror","apks","python","sai","xapk"],"created_at":"2024-10-14T05:43:34.249Z","updated_at":"2025-03-22T16:30:58.200Z","avatar_url":"https://github.com/david-lev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ⛏️ [apkfile](https://github.com/david-lev/apkfile) • Python library for handling APK, APKM, XAPK, and APKS files\n[![CodeFactor](https://www.codefactor.io/repository/github/david-lev/apkfile/badge)](https://www.codefactor.io/repository/github/david-lev/apkfile)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/apkfile?style=flat-square)](https://badge.fury.io/py/apkfile)\n[![PyPI Version](https://badge.fury.io/py/apkfile.svg)](https://pypi.org/project/apkfile/)\n\n### Install with pip\n```bash\npip3 install -U apkfile\n```\n### Or, install from source:\n```bash\ngit clone https://github.com/david-lev/apkfile.git\ncd apkfile\npython3 setup.py install\n```\n\nYou also need to install ``aapt`` (see [Install aapt](#install-aapt) below).\n\n### Usage\n\n```python\nfrom apkfile import ApkFile, XapkFile, ApkmFile, ApksFile\n\n# Get apk info\napk_file = ApkFile(path='/home/david/Downloads/wa.apk')\nprint(apk_file.package_name, apk_file.version_name, apk_file.version_code)\nprint(apk_file.as_dict())\n\n# Get apkm info\napkm_file = ApkmFile('/home/david/Downloads/chrome.apkm')\nfor split in apkm_file.splits:\n    print(split.split_name)\napkm_file.install(check=True, upgrade=True)\n\n# Using context manager (delete the extracted files when done)\nwith XapkFile(path='/home/david/Downloads/telegram.xapk') as xf:\n    print(xf.base.abis, x.permissions, x.langs)\n\n# Get apks info\napks_file = ApksFile(path='/home/david/Downloads/facebook.apks')\nprint(apks_file.base.permissions, apks_file.md5, apks_file.sha256)\n\n```\n\n### How this library works?\nThis library uses [``aapt``](https://elinux.org/Android_aapt) to extract information from the `.APK` file, and then parses the output to get the information.\n- For the zip files (`.APKM`, `.XAPK`, and `.APKS`), the basic information (`package_name`, `version_name`, `version_code`, etc.) is derived from the .json file, and the rest of the information is extracted when it requested (lazy evaluation).\n- The library also provide ways to install the files (and check compatibility; `min_sdk_version`,  `abis` and `langs`) using [adb](#install-adb). Just connect your device/s and run the `install` method. (you can use the ``install_apks`` function independently).\n\n\n### Install aapt\napkfile requires [``aapt``](https://elinux.org/Android_aapt) to be in the ``PATH``.\nIn each operating system, the way to install aapt is different, if you installed Android Studio, add one of the build-tools paths to the ``PATH``, if you are on a Debian-based Linux system (Ubuntu etc.) you can install with ``sudo apt install aapt``, and on Windows and Mac? Just google \"How to install aapt on X\".\n- You can manually provide a path to aapt: ``ApkFile(..., aapt_path='/path/to/aapt')``.\n\n### Install adb\nif you want to use the ``install`` method, you need to install [``adb``](https://developer.android.com/studio/command-line/adb).\n\n- You can manually provide a path to adb: ``ApkFile(...).install(adb_path='/path/to/adb')``.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-lev%2Fapkfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-lev%2Fapkfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-lev%2Fapkfile/lists"}