Skip to main content

ROSAL

ROSAL (Reverse Obfuscated Standard Android Libraries) helps reverse-engineer Android applications by mapping obfuscated classes from an APK to their plain-text equivalents in the declared standard libraries (androidx, core, ...).

It helps recover actual names for classes like RecyclerView, LiveData, Fragment, CompatActivity, and so on, partly automating the manual process of reverse engineering and allowing for an easier Static Analysis of Android apps.

The mapping is limited to the classes from the standard libraries: it does not involve the mapping of the proprietary classes of the app.

Fully deterministic, no heuristics. No AI is involved in the process.

!!!! DISCLAIMER !!!!
This software is intended for research and for testing on authorized targets EXCLUSIVELY.
Any other purpose is not supported or endorsed by the creators by any means.
Don't be a cunt.

Getting started

Prerequisites & Dependencies

Dependencies on Androguard, loguru and tqdm should be resolved automatically during installation... If not, install manually.

The tool relies on the Android SDK. You'll definitely need D8 and platform-tools.

Install it in ~/Android/Sdk ( <<-- please use this exact path, otherwise things will break)

https://developer.android.com/tools/releases/build-tools
https://developer.android.com/tools/releases/platform-tools

Java is also required. Install it if you haven't already.

Installing from local repository

Clone the repository, then cd to its directory and:

python -m pip install .

Use the -e option if you wish to make it an editable installation

pip install -e .
pip install rosal

Run

# (Optional) Define APK path
export APK=...

Basic usage:

rosal --apk "$APK" # or <path_to_apk>

The command runs the fetch, extraction, catalog, matching and mapping stages in sequence.

By default, intermediate files and matches.tiny are written to ~/rosal. Use --work-dir to specify another directory:

rosal --apk "$APK" --work-dir ./anything_you_want

Relevant sample outputs

matches.json

{
  "matches": [
    {
      "library_class": "Landroidx/activity/Api34Impl;",
      "target_class": "Landroidx/activity/a;",
      "provenance": "androidx.activity_activity-1.8.1.dex",
      "methods": [
        {
          "library_name": "createOnBackEvent",
          "target_name": "a",
          "library_descriptor": "(FFFI)Landroid/window/BackEvent;",
          "target_descriptor": "(FFFI)Landroid/window/BackEvent;"
        },
        {
          "library_name": "progress",
          "target_name": "b",
          "library_descriptor": "(Landroid/window/BackEvent;)F",
          "target_descriptor": "(Landroid/window/BackEvent;)F"
        },
        {
          "library_name": "swipeEdge",
          "target_name": "c",
          "library_descriptor": "(Landroid/window/BackEvent;)I",
          "target_descriptor": "(Landroid/window/BackEvent;)I"
        },
        {
          "library_name": "touchX",
          "target_name": "d",
          "library_descriptor": "(Landroid/window/BackEvent;)F",
          "target_descriptor": "(Landroid/window/BackEvent;)F"
        },
        {
          "library_name": "touchY",
          "target_name": "e",
          "library_descriptor": "(Landroid/window/BackEvent;)F",
          "target_descriptor": "(Landroid/window/BackEvent;)F"
        }
      ],
      "fields": []
    },
    ...

matches.tiny

tiny	2	0	obf	named
c	androidx/activity/a	androidx/activity/Api34Impl
	m	(FFFI)Landroid/window/BackEvent;	a	createOnBackEvent
	m	(Landroid/window/BackEvent;)F	b	progress
	m	(Landroid/window/BackEvent;)I	c	swipeEdge
	m	(Landroid/window/BackEvent;)F	d	touchX
	m	(Landroid/window/BackEvent;)F	e	touchY
c	androidx/activity/p	androidx/activity/ComponentActivity
c	androidx/activity/q	androidx/activity/ComponentDialog
c	androidx/activity/s	androidx/activity/OnBackPressedCallback
c	androidx/activity/w	androidx/activity/OnBackPressedDispatcher$Api33Impl

Files and Directories involved

With the exception of matches.tiny, these files are intermediates that can end up being quite large. Feel free to delete them if you don't need them for further analysis.

markers_file = work_dir / "markers.txt"
library_dex_dir = work_dir / "library_dex"
target_dex_dir = work_dir / "target_dex"
features_file = work_dir / "features.ndjson"
catalog_file = work_dir / "catalog.json"
matches_file = work_dir / "matches.json"
mapping_file = work_dir / "matches.tiny"

Applying the matches.tiny file

Once the command has (hopefully) run successfully, you can apply the generated matches.tiny to an instance of jadx / jadx-gui

jadx-gui --mappings-path <path_to>/matches.tiny "$APK"

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Metadata

Release files for rosal 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rosal 0.0.2
File Size Uploaded
rosal-0.0.2.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rosal 0.0.2
File Interpreter ABI Platform
rosal-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 kB

Release files / rosal-0.0.2.tar.gz

Download URL rosal-0.0.2.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
498f3f80ccd9e815f65ae09d7f18e4e9ccb97d3bcd7a1014da7cea5ad6434c3d
BLAKE2b-256 checksum
How to use checksums
79e1909924bdd7f605798ff6c669d179e2d6a47ca3da74b60039e36c07d0051e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / rosal-0.0.2-py3-none-any.whl

Download URL rosal-0.0.2-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9eb6afd82994290b814b40cc843bc7a570e98b10132838c9500b68277a2f0e10
BLAKE2b-256 checksum
How to use checksums
2d262e0a53eeca18bf84ab07d71828e3bbebc296f699b7d74636826f44650da8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page