ApkSource is a program to directly transform APK into source code.
Project description
ApkSource
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.) intobuild.gradle. -
🧾 ProGuard mapping support
Optionally appliesmapping.txtto 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:
-
Check all dependencies (java, apktool, jadx)
-
Decompile the APK into source code and resources
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40639446cc4993143eddd76d559fe4ca1c9259608c1589c8247aefb41de5ca4f
|
|
| MD5 |
72dca7e68a66b6871741182c2e73b220
|
|
| BLAKE2b-256 |
f455f3104b5c7b3e4023cf1e2fdf387499b64db7473c3c53dcbfcab4a7b3519c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f84362690f6fa6ea460de643c93c5baf1813f0b71ad1a53c9e5e2f0d1f742777
|
|
| MD5 |
427b6c6153207ec734e9548a6aa08116
|
|
| BLAKE2b-256 |
00df2fd15cea175619258e96ea7c53330612de0b5121711cf6cbe53c61f71809
|