{"id":37061524,"url":"https://github.com/ph4r05/apk_parse","last_synced_at":"2026-01-14T06:59:19.195Z","repository":{"id":57410945,"uuid":"78467466","full_name":"ph4r05/apk_parse","owner":"ph4r05","description":"use python parse APK, get package name, file md5, apk icon, developer certificate....","archived":false,"fork":true,"pushed_at":"2017-01-15T16:24:36.000Z","size":214,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-31T04:09:09.674Z","etag":null,"topics":["android","android-analysis","apk","certificates","cryptography","python-library","signatures"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tdoly/apk_parse","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ph4r05.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-01-09T20:46:09.000Z","updated_at":"2022-05-04T14:19:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ph4r05/apk_parse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ph4r05/apk_parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph4r05%2Fapk_parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph4r05%2Fapk_parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph4r05%2Fapk_parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph4r05%2Fapk_parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ph4r05","download_url":"https://codeload.github.com/ph4r05/apk_parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph4r05%2Fapk_parse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","android-analysis","apk","certificates","cryptography","python-library","signatures"],"created_at":"2026-01-14T06:59:18.643Z","updated_at":"2026-01-14T06:59:19.190Z","avatar_url":"https://github.com/ph4r05.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"APK parse\n=========\n\n-  reference `androguard \u003chttps://github.com/androguard/androguard\u003e`__.\n-  fork of `apk\\_parse \u003chttps://github.com/tdoly/apk_parse\u003e`__\n-  partial support for xAPKs added (nested APKs)\n\n\nPip\n===\n\n::\n\n    pip install apk_parse_ph4\n\nInstallation MacOS X\n====================\n\nIf there are problems with installing ``m2crypto`` on Mac, try this:\n\n.. code-block:: bash\n\n    brew install openssl\n    brew install swig\n    env LDFLAGS=\"-L$(brew --prefix openssl)/lib\" \\\n        CFLAGS=\"-I$(brew --prefix openssl)/include\" \\\n        SWIG_FEATURES=\"-cpperraswarn -includeall -I$(brew --prefix openssl)/include\" \\\n        pip install m2crypto\n\nor\n\n.. code-block:: bash\n\n    LDFLAGS=\"-L/opt/local/lib\" \\\n        CFLAGS=\"-I/opt/local/include\" \\\n        SWIG_FEATURES=\"-cpperraswarn -includeall -I/opt/local/include\" \\\n        pip install --user m2crypto\n\nExample:\n--------\n\n.. code-block:: python\n\n\n        apkf = APK(\"myfile.apk\")\n        apkf = APK(read(\"myfile.apk\"), raw=True)\n\n\nExtended example:\n-----------------\n\nThe following example processes APK in a separate call. `as_file_name` set to True causes the file is\nnot read whole to the memory, but it used as a file - ZIP module does seek if needed. In this way also\nbig apks (e.g., 1.5 GB) can be processed. `temp_dir` option allows APK processor to use temporary dir, e.g.\nfor xapk format, where sub-APK needs to be parsed:\n\n.. code-block:: python\n\n\n        apkf = APK(apk_path, process_now=False, process_file_types=False, as_file_name=True, temp_dir='/tmp')\n        apkf.file_md5 = 'abcd0102037292'  # skips MD5 recomputing (if already computed during download)\n        apkf.process()\n\n\npackage\n~~~~~~~\n\nReturn the name of the package\n\n::\n\n\n        \u003e\u003e\u003e apkf.package\n        com.android.vending\n\n        \u003e\u003e\u003e apkf.get_package()\n        com.android.vending\n\nfile\\_md5\n~~~~~~~~~\n\nReturn the file md5 of the apk\n\n::\n\n\n        \u003e\u003e\u003e apkf.file_md5\n        40bdd920a3a3d2acf432e3c5b485eb11\n\ncert\\_md5\n~~~~~~~~~\n\nReturn the cert md5 of the apk\n\n::\n\n\n        \u003e\u003e\u003e apkf.cert_md5\n        cde9f6208d672b54b1dacc0b7029f5eb\n\nfile\\_size\n~~~~~~~~~~\n\nReturn the apk file size\n\n::\n\n\n        \u003e\u003e\u003e apkf.file_size\n        11194863\n\nandroidversion\n~~~~~~~~~~~~~~\n\nReturn the apk version\n\n::\n\n\n        \u003e\u003e\u003e apkf.androidversion\n        {'Code': u'80341200', 'Name': u'5.4.12'}\n\nget\\_androidversion\\_code()\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturn the android version code\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_androidversion_code()\n        80341200\n\nget\\_androidversion\\_name()\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturn the android version name\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_androidversion_name()\n        5.4.12\n\nget\\_min\\_sdk\\_version()\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturn the android:minSdkVersion attribute\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_min_sdk_version()\n        9\n\nget\\_target\\_sdk\\_version()\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturn the android:targetSdkVersion attribute\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_target_sdk_version()\n        21\n\nget\\_libraries()\n~~~~~~~~~~~~~~~~\n\nReturn the android:name attributes for libraries\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_libraries()\n        []\n\nget\\_files()\n~~~~~~~~~~~~\n\nReturn the files inside the APK\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_files()\n        [u'AndroidManifest.xml', u'assets/keys/dcb-pin-encrypt-v1/1',...]\n\nget\\_files\\_types()\n~~~~~~~~~~~~~~~~~~~\n\nReturn the files inside the APK with their associated types (by using\npython-magic) Please ``pip install python-magic``\n\n::\n\n        \u003e\u003e\u003e apkf.get_files_types()\n        {u'res/layout/play_card_bundle_item_small.xml': \"Android's binary XML\",...}\n\nget\\_main\\_activity()\n~~~~~~~~~~~~~~~~~~~~~\n\nReturn the name of the main activity\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_main_activity()\n        com.android.vending.AssetBrowserActivity\n\nget\\_activities()\n~~~~~~~~~~~~~~~~~\n\nReturn the android:name attribute of all activities\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_activities()\n        ['com.android.vending.AssetBrowserActivity', ...]\n\nget\\_services()\n~~~~~~~~~~~~~~~\n\nReturn the android:name attribute of all services\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_services()\n        ['com.android.vending.GCMIntentService', ...]\n\nget\\_receivers()\n~~~~~~~~~~~~~~~~\n\nReturn the android:name attribute of all receivers\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_receivers()\n        ['com.google.android.gcm.GCMBroadcastReceiver', ...]\n\nget\\_providers()\n~~~~~~~~~~~~~~~~\n\nReturn the android:name attribute of all providers\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_providers()\n        ['com.google.android.finsky.providers.RecentSuggestionsProvider', ...]\n\nget\\_permissions()\n~~~~~~~~~~~~~~~~~~\n\nReturn permissions\n\n::\n\n\n        \u003e\u003e\u003e apkf.get_permissions()\n        ['com.android.vending.permission.C2D_MESSAGE', ...]\n\nshow()\n~~~~~~\n\nReturn FILES, PERMISSIONS, MAIN ACTIVITY...\n\n::\n\n\n        \u003e\u003e\u003e apkf.show()\n        FILES: ...\n\nparse\\_icon()\n~~~~~~~~~~~~~\n\nParse ICON of the apk, storage on icon\\_path\n\n::\n\n\n        \u003e\u003e\u003e apkf.parse_icon(icon_path='/tmp')\n        ...\n\ncert\\_text\n~~~~~~~~~~\n\nReturns developer certificate in a textual form\n\n::\n\n\n        \u003e\u003e\u003e apkf.cert_text\n        Certificate:\n        Data:Version: 3 (0x2)\n        ...\n\ncert\\_pem\n~~~~~~~~~\n\nReturns developer certificate in PEM form\n\n::\n\n\n        \u003e\u003e\u003e apkf.cert_pem\n        -----BEGIN CERTIFICATE-----\n        ...\n\n\npkcs7\\_der\n~~~~~~~~~~\n\nReturns the signature file in DER form (contains signature \u0026 certificate)\n\n::\n\n\n        \u003e\u003e\u003e apkf.pkcs7_der\n        (binary data)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph4r05%2Fapk_parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph4r05%2Fapk_parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph4r05%2Fapk_parse/lists"}