Skip to main content

Frida gadget into an APK

Project description

Docker Coverage-Status Branch-Coverage-Status Codacy-Grade Libraries-Rank

frida-gadget is a APK patcher for frida gadget.
I hope this will help you to patch APK when you want to utilize the Frida gadget.

Installation

Py-Versions PyPI-Downloads Libraries-Dependents

pip install frida-gadget

Prerequirement

You should install the Apktool and set the PATH environment variable. (Install apktool)

brew install apktool

Usage

$ frida-gadget --help
  Usage: frida-gadget [OPTIONS] APK_PATH

  Options:
    --arch TEXT  Support [arm, arm64, x86]
    --help       Show this message and exit.

Example

$ frida-gadget /Users/ksg/demo.apk  --arch arm64
  [INFO] Auto-detected frida version: 16.1.3
  [INFO] APK: '[REDACTED]\frida-gadget\tests\demo-apk\handtrackinggpu.apk'
  [INFO] Gadget Architecture(--arch): arm64(default)
  [DEBUG] Decompiling the target APK using apktool
  [DEBUG] Downloading the frida gadget library for arm64
  [DEBUG] Checking internet permission and extractNativeLibs settings
  [DEBUG] Adding 'android.permission.INTERNET' permission to AndroidManifest.xml
  [DEBUG] Searching for the main activity in the smali files
  [DEBUG] Found the main activity at '[REDACTED]\frida-gadget\tests\demo-apk\handtrackinggpu\smali\com\google\mediapipe\apps\handtrackinggpu\MainActivity.smali'
  [DEBUG] Locating the onCreate method and injecting the loadLibrary code
  [DEBUG] Recompiling the new APK using apktool
  [INFO] Success!

  [INFO] Output: [REDACTED]\frida-gadget\tests\demo-apk\handtrackinggpu\dist\handtrackinggpu.apk

$ unzip -l handtrackinggpu.apk | grep libfrida-gadget
  21133848  09-15-2021 02:28   lib/arm64-v8a/libfrida-gadget-16.1.3-android-arm64.so

loadLibrary code will be injected

https://github.com/ksg97031/frida-gadget/blob/patch-frida-15.1.1/images/decompile.png

Easy to re-sign your app by apk-signer

$ apk-signer handtrackinggpu.apk
  [Warning] Signing with default keystore.
  [Warning] Please pass --key_path, --key_alias, --key_pass, --ks_pass parameter, if you want to use your keystore
  handtrackinggpu-signed.apk

$ adb install handtrackinggpu-signed.apk

Similar Projects

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frida-gadget-1.1.0.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file frida-gadget-1.1.0.tar.gz.

File metadata

  • Download URL: frida-gadget-1.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for frida-gadget-1.1.0.tar.gz
Algorithm Hash digest
SHA256 88774ddcce02f003422657e39c54657bf62aa68449fe6acaa7bef08e897628e0
MD5 5ab3cc35ecbfed76e199e32fbb31e939
BLAKE2b-256 ae0b88d31a3256a21014c4bc6e03d26604428768ce836f72b2ff02c2694d3478

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page