Metadata-Version: 2.4
Name: alpaka-re
Version: 0.2.1
Summary: A tool for mapping classes between different versions of the same APK.
Keywords: apk,android,mapping,reverse-engineering,deobfuscation
Author-email: Daniel Firer <danielfirefire@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
License-File: LICENSE
Requires-Dist: click
Requires-Dist: lief
Project-URL: Bug Tracker, https://github.com/DanielFi/alpaka/issues
Project-URL: Homepage, https://github.com/DanielFi/alpaka
Project-URL: Repository, https://github.com/DanielFi/alpaka

# Alpaka

[![PyPI - Version](https://img.shields.io/pypi/v/alpaka-re.svg)](https://pypi.org/project/alpaka-re)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/alpaka-re.svg)](https://pypi.org/project/alpaka-re)

-----

Alpaka is a command-line tool designed for mapping classes across different
versions of the same APK. This is particularly useful for reverse engineering,
allowing you to track class renames and changes across different builds, and
preserving manual deobfuscation efforts.

## Features

* Class Mapping: Generates a JSON mapping of classes from one APK version to another.

* Deobfuscation Migration: Migrate existing Enigma deobfuscation
  mapping files to new APK versions, helping maintain your renaming efforts
  in tools like Jadx.

## Installation

```console
git clone https://github.com/DanielFi/alpaka
pip install ./alpaka
```

## Usage

### Basic Class Mapping

Output a JSON mapping from `A.apk` (older version) to `B.apk` (newer version).
This will show how classes in `A.apk` correspond to classes in `B.apk`.

```console
> alpaka map A.apk B.apk1
{
    "LX/003;": "LX/003;",
    "LX/004;": "LX/004;",
    "LX/005;": "LX/005;",
    "LX/006;": "LX/006;",
...
```

### Migrating Deobfuscation Mappings Across Versions

If you have an Enigma mapping file (e.g., `A.mapping`) for `A.apk`, you can use
Alpaka to generate a new mapping file (`B.mapping`) that applies your existing
renames to `B.apk`. This is incredibly useful for maintaining your manual
deobfuscation work when a new version of the APK is released.

The generated `B.mapping` file can then be imported into tools like Jadx to preserve your manual renamings!

```console
> alpaka map --deobfuscation A.mapping --only-obfuscated A.apk B.apk1 > B.mapping
```

### Advanced Options

The `map` command supports several options to fine-tune its behavior:

* `--only-obfuscated`: Prevents Alpaka from creating unnecessary mappings
  between unobfuscated classes.
* `--no-propagation`: Only run the first analysis stage. Usually leads to more
  accurate results but fewer mappings overall.

## License

Alpaka is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

