{"id":22907521,"url":"https://github.com/nitanmarcel/apkinjector","last_synced_at":"2025-05-08T22:20:52.776Z","repository":{"id":183779965,"uuid":"670297521","full_name":"nitanmarcel/apkinjector","owner":"nitanmarcel","description":"Utilities to help injecting libraries and frida in apks.","archived":false,"fork":false,"pushed_at":"2023-11-02T20:57:50.000Z","size":248,"stargazers_count":24,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T18:03:31.614Z","etag":null,"topics":["android","apk","frida","injection","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://nitanmarcel.github.io/apkinjector/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitanmarcel.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}},"created_at":"2023-07-24T18:22:31.000Z","updated_at":"2025-02-27T08:17:39.000Z","dependencies_parsed_at":"2023-07-25T20:44:44.853Z","dependency_job_id":"eab193d6-175d-493f-89ed-42958604b742","html_url":"https://github.com/nitanmarcel/apkinjector","commit_stats":null,"previous_names":["nitanmarcel/apkinjector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitanmarcel%2Fapkinjector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitanmarcel%2Fapkinjector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitanmarcel%2Fapkinjector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitanmarcel%2Fapkinjector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitanmarcel","download_url":"https://codeload.github.com/nitanmarcel/apkinjector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253155516,"owners_count":21862708,"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":["android","apk","frida","injection","reverse-engineering"],"created_at":"2024-12-14T03:15:57.272Z","updated_at":"2025-05-08T22:20:52.718Z","avatar_url":"https://github.com/nitanmarcel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APK Injector\n\nPluginable tool to automate injection of libraries in apks, with support for unpack, repack, and bundles.\n\n- [APK Injector](#apk-injector)\n    - [Features](#features)\n    - [Installation](#installation)\n    - [Usage](#usage)\n      - [Frida](#frida)\n      - [Inject](#inject)\n      - [Apk utils](#apk-utils)\n      - [Plugins](#plugins)\n    - [Using as a module](#using-as-a-module)\n    - [Usage as a plugin](#usage-as-a-plugin)\n\n### Features\n- Insert libraries and load them when an activity starts.\n- Frida support with support to load frida scripts either from disc or codeshare.\n- Bundle support. Apks exported from SAI or XApks downloaded from apkpure.\n- Plugins support. Check plugins/plugins.json and plugin_example.py\n\n### Installation\n`pip3 install apkinjector`\n\n### Usage\n```\napkinjector [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  apk      Apk utils\n  frida    Inject a frida gadget in a target apk.\n  inject   Inject a shared library (*.so) in a target apk.\n  plugins  Manage plugins\n```\n\n\n#### Frida\n```\nUsage: python -m apkinjector frida [OPTIONS] APK\n\n  Inject a frida gadget in a target apk.\n\nOptions:\n  --gadget TEXT     Path to custom gadget.\n  --script TEXT     Inject a javascript to be loaded when the gadget starts.\n  --codeshare TEXT  Same as --script but uses Frida Codeshare as the source\n                    javascript.\n  --arch TEXT       Architecture to inject for. If empty --adb or --gadget\n                    must be specified.\n  --adb             Use adb (if installed) to detect device architecture.\n  --activity TEXT   Name of the activity to inject into. If unspecified, the\n                    main activity will be injected.\n  --output          Custom path where the patched apk should be saved.\n  --force           Force delete destination directory.\n  --help            Show this message and exit.\n```\n\n#### Inject\n```\nUsage: python -m apkinjector inject [OPTIONS] APK\n\n  Inject a shared library (*.so) in a target apk.\n\nOptions:\n  --library TEXT   Shared library (*.so) to inject.  [required]\n  --include TEXT   Extra files to include in the lib folder. Can be used\n                   multiple times to include more files.\n  --arch TEXT      Architecture to inject for. If empty --adb or --library\n                   must be specified.\n  --adb            Use adb (if installed) to detect device architecture.\n  --activity TEXT  Name of the activity to inject into. If unspecified, the\n                   main activity will be injected.\n  --output         Custom path where the patched apk should be saved.\n  --force          Force delete destination directory.\n  --help           Show this message and exit.\n```\n\n#### Apk utils\n```\nUsage: python -m apkinjector apk [OPTIONS] APK\n\n  Apk utils\n\nOptions:\n  --activities   Gets all activities\n  --permissions  Gets all permissions\n  --libraries    Gets all libraries\n  --recievers    Gets all receivers\n  --help         Show this message and exit.\n```\n\n#### Plugins\n```\nUsage: python -m apkinjector plugins [OPTIONS]\n\n  Manage plugins\n\nOptions:\n  --list          List all installed and available plugins.\n  --install TEXT  Installs a plugin by name.\n  --remove TEXT   Removes an installed plugin.\n  --help          Show this message and exit.\n```\n\n\n### Using as a module\n\n```python\nfrom apkinjector import LOG\n\n\nLOG.info(\"This has been printed using apkinjector logging\")\n\n\n# Also comes with runners for apktool, uber-apk-signer, etc/\n\nfrom apkinjector.apktool import ApkTool\n\nfrom apkinjector.uber_apk_signer import UberApkSigner\n\n# Automatically download and setup apktool.\nApkTool.install()\n\n# Decompile apk\nApkTool.decode(...)\n\n# Automatically download and setup uber-apk-signer\nUberApkSigner.install()\n\n# Sign apk\nUberApkSigner.sign(...)\n\n\n# Check if a dependency is in path\n\nfrom apkinjector import DEPENDENCIES_MANAGER\n\n# Add a new dependency\njava = DEPENDENCIES_MANAGER.add_dependency('java', required=True) # Return Depedency(name, path, required)\n\n# Check if a dependency is path\n# Returns the path to the binary if found, if not returns None\n# See apkpatcher/apkpatcher to see how dependencies are automatically handled\nin_path = DEPENDENCIES_MANAGER.java\n```\n\n### Usage as a plugin\n\n```python\n\n# Can use the same methods as a it would been included in a separate module.\n\nfrom apkinjector import LOG\n\n# Adding a new command to the `apkinjector` application:\n\nfrom apkinjector.plugins import main\n\n# Define a new command. It uses click under the hood. See more at https://click.palletsprojects.com/en/8.1.x/\n# Check plugins/plugin_example.py for a full example.\n@main.command(help='Prints hello world to the console.')\ndef hello_world():\n    LOG.info('Hello World')  # prints info\n    LOG.warning(\"Hello World\")  # prints warning\n    LOG.error('Hello World')  # prints error and calls sys.exit(1)\n\n# This will be usable with `apkinjector hello_world`\n# \n# apkinjector hello-world --help\n# Usage: python -m apkinjector hello-world [OPTIONS]\n\n#   Prints hello world to the console.\n\n# Options:\n#   --help  Show this message and exit. \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitanmarcel%2Fapkinjector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitanmarcel%2Fapkinjector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitanmarcel%2Fapkinjector/lists"}