Table of contents
This project is a forked version of amimo/dcc, which aims to make it easy for everyone to use this tool. We automated plenty of processes that you had to do manually in the original DCC. Moreover, we always try to add new features to make this tool more usable in real-world applications. Check out Roadmap to know about the changes we made and also the changes we are planning to make in the feature.
Python 3.8 or higher is required for running this tool. So, make sure your python is up-to-date.
- Clone the repo.
git clone https://github.com/codehasan/dex2c
- Open the cloned directory.
cd dex2c
- Download Apktool latest version from bitbucket and save it in
tools
folder with the nameapktool.jar
wget -O tools/apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.9.3.jar
- Download android NDK for your OS and extract it. Copy the folder path where
ndk-build
executable is located inside the extracted folder and configurendk_dir
indcc.cfg
- Install required dependencies.
pip3 install -r requirements.txt
- Install JRE/JDK if you don't have it installed. The recommended JDK version is 11.
sudo apt-get install openjdk-11-jdk
- Install required dependencies.
pip3 install -r requirements.txt
- Install JRE/JDK from oracle if you don't have it installed. Search in Google, how to install JDK in Windows if you need more guidance on this topic. The recommended JDK version is 11.
One Step Installation: Run Below Command
pkg install wget && wget -O termux_install.sh https://raw.githubusercontent.com/codehasan/dex2c/master/termux_install.sh && chmod -R +x termux_install.sh && ./termux_install.sh
NOTE: Some users have reported about installation errors with latest
clang
on termux. If you happen to face the same issue, then uncomment the lines stated intermux_install.sh
and then proceed with the installation.
Add all your filters in filter.txt
file - one rule for each line. Filters are made using regex patterns. There are two types of filters available in Dex2c - whitelist, and blacklist. You can use them whenever you need them.
- Protect just one method in a specific class.
com/some/class;some_method(some_parameters)return_type
- Protect all methods in a specific class.
com/some/class;.*
- Protect all methods in all classes under a package path.
com/some/package/.*;.*
- Protect a method with the name onCreate in all classes.
.*;onCreate\(.*
Adding an exclamation !
sign before a rule will mark that rule as a blacklist.
- Exclude one method in a specific class from being protected.
!com/some/class;some_method(some_parameters)return_type
- Exclude all methods in a specific class from being protected.
!com/some/class;.*
- Exclude all methods in all classes under a package path from being protected.
!com/some/package/.*;.*
- Exclude a method with the name onCreate in all classes from being protected.
!.*;onCreate\(.*
- Copy your apk file to
dex2c
folder wheredcc.py
is located and run this command.
python3 dcc.py -a input.apk -o output.apk
- Run this command to know about all the other options available in dcc to find the best ones for your needs.
python3 dcc.py --help
Open project/jni/Android.mk
file in the cloned directory. You will find a variable named LOCAL_MODULE
, initially with the value stub
. Please change it to your desired lib name. Keep in mind the following instructions to prevent possible errors.
- Don't use spaces in lib name, use hyphen
-
or underscore_
- Don't use any kind of symbols or punctuations in lib name other than underscores and hyphens
- Don't start the lib name with the text
lib
itself
- Add custom lib loader
- Add new apksigner
- Add multi-dex support
- Add app abi handler
- Add signature configuration in
dcc.cfg
- Add new options
- --skip-synthetic
- --custom-loader
- --force-keep-libs
- --obfuscate
See the open issues for a full list of proposed features and known issues.
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give this project a star! Thanks again!
- Fork the project
- Create your feature branch. (
git checkout -b feature/AmazingFeature
) - Commit your changes. (
git commit -m 'Add some AmazingFeature'
) - Push to the branch. (
git push origin feature/AmazingFeature
) - Open a pull request.
Distributed under the Apache License. See LICENSE.txt
for more information.