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.1.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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apksource-1.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 40639446cc4993143eddd76d559fe4ca1c9259608c1589c8247aefb41de5ca4f
MD5 72dca7e68a66b6871741182c2e73b220
BLAKE2b-256 f455f3104b5c7b3e4023cf1e2fdf387499b64db7473c3c53dcbfcab4a7b3519c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apksource-1.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f84362690f6fa6ea460de643c93c5baf1813f0b71ad1a53c9e5e2f0d1f742777
MD5 427b6c6153207ec734e9548a6aa08116
BLAKE2b-256 00df2fd15cea175619258e96ea7c53330612de0b5121711cf6cbe53c61f71809

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