This script deodexes .odex
files using the baksmali tool. It supports multithreading, enabling it to process multiple files at once for improved speed and efficiency.
- Java: Ensure Java is installed and accessible from the command line. Verify installation with:
java -version
- baksmali: The baksmali JAR file is required for deodexing. Download the latest version from the baksmali GitHub repository.
- Download or clone this repository.
- Ensure
baksmali.jar
is accessible, noting its path for the script.
Run the script from the command line as follows:
python deodexer.py --baksmali-jar /path/to/baksmali.jar \
--framework-dir /path/to/framework/dir \
--input-dir /path/to/input/dir \
--output-dir /path/to/output/dir \
--api-level 17 \
--max-workers 4
- --baksmali-jar (required): Path to
baksmali.jar
. - --framework-dir (required): Directory containing framework files (e.g.,
/system/framework
). - --input-dir (required): Directory containing
.odex
files to deodex. - --output-dir: Directory for saving deodexed files (default:
output
in the current directory). - --api-level: API level to use for deodexing (default:
17
). - --max-workers: Number of threads for parallel processing (default:
4
). Increase if your system supports it for faster processing.
python deodexer.py --baksmali-jar /usr/local/bin/baksmali.jar \
--framework-dir /system/framework \
--input-dir /system/app \
--output-dir ./deodexed_output \
--api-level 29 \
--max-workers 8
In this example:
- The
baksmali.jar
file is located at/usr/local/bin/baksmali.jar
. - The framework directory is
/system/framework
. .odex
files are read from/system/app
.- Deodexed files are saved to
./deodexed_output
. - API level for deodexing is set to
29
. - Eight threads are used for parallel processing.
The script provides detailed logging to aid tracking and debugging:
- INFO: Logs high-level operations, including each successful deodex operation.
- DEBUG: Provides command details and subprocess outputs, useful for troubleshooting.
- ERROR: Captures issues, such as failed operations or missing dependencies.
All logs are printed to the console.
If you encounter issues:
- Check that Java is installed (
java -version
). - Verify the baksmali JAR file path.
- Confirm the framework directory contains necessary files for deodexing.
This script is open-source and distributed under the MIT License. Feel free to modify and distribute it as per the terms of the license.