Skip to content
Home », make reverse engineering Android apps easier!, make reverse engineering Android apps easier!

# 🕹

[]( is a Bash script that makes reverse engineering Android apps easier, automating some repetitive tasks like pulling, decoding, rebuilding and patching an APK.

## Features basically uses [apktool]( to disassemble, decode and rebuild resources and some bash to automate the [frida](https:// gadget injection process. It also supports app bundles/split APKs.

* 🍄 Patching APKs to load on start.
* 🆕 Support for app bundles/split APKs.
* 🔧 Disassembling resources to nearly original form with apktool.
* 🔩 Rebuilding decoded resources back to binary APK/JAR with apktool.
* 🗝 Code signing the apk with apksigner.
* 🖥 Multiple arch support (arm, arm64, x86, x86_64).
* 📵 No rooted Android device needed.

## Getting started

◀ Pulling an APK from a device is simple as running `./ pull <package_name>`

🔧 Decoding an APK is simple as running `./ decode <apk_name>`

🔩 Rebuilding an APK is simple as running `./ build <apk_dir>`

## pull

` pull` pull an APK from a device. It supports app bundles/split APKs, which means that split APKs will be joined in a single APK (this is useful for patching). If the package is an app bundle/split APK, will combine the APKs into a single APK, fixing all public resource identifiers.

## patch

` patch` patch an APK to load []( on start. is a Frida’s shared library meant to be loaded by programs to be instrumented (when the Injected mode of operation isn’t suitable). By simply loading the library it will allow you to interact with it using existing Frida-based tools like frida-trace. It also supports a fully autonomous approach where it can run scripts off the filesystem without any outside communication.

Patching an APK is simple as running `./ patch <apk_name> –arch arm`.

You can calso specify a Frida gadget configuration in a json `./ patch <apk_name> –arch arm –gadget-conf <config.json>`

## 🍄 Frida’s Gadget configurations

In the default interaction, Frida Gadget exposes a frida-server compatible interface, listening on localhost:27042 by default. In order to achieve early instrumentation Frida let Gadget’s constructor function block until you either `attach()` to the process, or call `resume()` after going through the usual `spawn()` -> `attach()` -> `…apply instrumentation…` steps.

If you don’t want this blocking behavior and want to let the program boot right up, or you’d prefer it listening on a different interface or port, you can customize this through a json configuration file.

The default configuration is:

“interaction”: {
“type”: “listen”,
“address”: “”,
“port”: 27042,
“on_port_conflict”: “fail”,
“on_load”: “wait”

You can pass the gadget configuration file to `` with the `–gadget-conf` option.

A typically suggested configuration might be:

“interaction”: {
“type”: “script”,
“path”: “/data/local/tmp/script.js”,

script.js could be something like:

var android_log_write = new NativeFunction(
Module.getExportByName(null, ‘__android_log_write’),
[‘int’, ‘pointer’, ‘pointer’]

var tag = Memory.allocUtf8String(“[frida-sript][ax]”);

var work = function() {
setTimeout(function() {
android_log_write(3, tag, Memory.allocUtf8String(“ping @ ” +;
}, 1000);

// console.log does not seems to work. see:
android_log_write(3, tag, Memory.allocUtf8String(“>–(O.o)-<)”);

`adb push script.js /data/local/tmp`

`./ patch <apk_name> –arch arm –gadget-conf <config.json>`

`adb install file.gadget.apk`

## Requirements

* apktool
* apksigner
* unxz
* zipalign
* aapt
* adb

## 📃Links of Interest







View RedditView Source

Leave a Reply

Your email address will not be published. Required fields are marked *