Skip to main content

ApkSource is a program to directly transform APK into source code.

Project description

ApkSource

Apksource Banner

License: MIT Python CLI

ApkSource is a command-line tool that automatically decompiles Android APK files and reconstructs them into a fully structured Gradle project — ready to be opened in Android Studio.


🚀 Features

  • 🔍 Smart dependency check
    Ensures that all required tools (java, apktool, jadx) are installed and meet the minimum versions.

  • 🧠 Automatic project setup
    Creates a full Gradle-based Android Studio project structure from a single APK.

  • 📦 Dependency detection
    Scans the decompiled source code and automatically injects the necessary dependencies (e.g. Retrofit, Room, Hilt, Glide, etc.) into build.gradle.

  • 🧾 ProGuard mapping support
    Optionally applies mapping.txt to de-obfuscate class names.

  • ⚙️ Fully CLI-based
    Fast, simple, and ideal for developers who prefer the terminal.


📦 Installation

You can install ApkSource directly from PyPI:

pip install apksource

Or, if you have the source code:

git clone https://github.com/Llucs/apksource.git
cd apksource
pip install .

🧰 Requirements

Make sure the following dependencies are installed and available in your PATH:

Tool Minimum Version Description

Java (JDK) 17+ Required for apktool and jadx apktool 2.7.0+ Used to decompile APK resources jadx 1.4.7+ Used to decompile DEX (Java/Kotlin code)


⚙️ Usage

Once installed, you can use the apksource command globally:

🧩 Basic usage

apksource decompile myapp.apk

This will:

  1. Check all dependencies (java, apktool, jadx)

  2. Decompile the APK into source code and resources

  3. Create a Gradle-ready project directory

🏗️ Optional flags

Option Description

--project-name NAME Custom name for the generated project folder --skip-backup Skip backup if a folder with the same name already exists

Example:

apksource decompile myapp.apk --project-name MyAppSource --skip-backup


🗂️ Output Structure

After running successfully, you’ll get a directory like this:

MyAppSource/ ├── app/ │ ├── build.gradle │ ├── src/ │ │ └── main/ │ │ ├── java/ │ │ └── res/ │ └── debug.keystore ├── build.gradle ├── settings.gradle └── gradlew

This project can be opened directly in Android Studio for analysis, modification, or rebuilding.


⚠️ Notes for Termux Users

ApkSource can run on Termux with some setup:

pkg install python openjdk-17 wget git pip install apksource

However, apktool and jadx must be manually installed and configured in your Termux environment. Make sure to test Java execution with:

java -version apktool --version jadx --version


🧑‍💻 Author

Llucs 📧 c307lucas@gmail.com 🌍 GitHub: Llucs


📜 License

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


⭐ Support

If you find this project helpful, please give it a ⭐ on GitHub and share it with other Android developers!

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

apksource-1.3.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apksource-1.3.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file apksource-1.3.0.tar.gz.

File metadata

  • Download URL: apksource-1.3.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for apksource-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ac8e99ff65ca70a89f6da5330e33cc15afba6f5cce9b35c5b0d1196b33bbf8a3
MD5 6db36ad3a57fdaeac37cd7ff285e153e
BLAKE2b-256 271224919338b9fe4c5f82c6ad3fd074d6eb8df55dcbc34ab5a4b5b9eb598216

See more details on using hashes here.

File details

Details for the file apksource-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: apksource-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for apksource-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05669a9f29eb7b7f2ccdaa349d20a42f71b31eaa7b8a3c823d2c733bdb6c8f6e
MD5 ac088fac409f65c49fd76751a7d747a1
BLAKE2b-256 aef33a63c7434bd4f791a78fb906796707953d0ecdd3bbb49abfdf49617e36b1

See more details on using hashes here.

Supported by

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