Apktool is a tool for reverse engineering Android applications. It allows to decode resources (XML files, images, etc.) to almost original form. After some modifications, decoded resources can be rebuilded back to binary APK.
This tutorial explains how to install Apktool on Ubuntu 20.04.
Prepare environment
Apktool requires Java. So make sure you have installed it. You can read post how to install Java.
Install Apktool
Get the latest version tag of Apktool release from GitHub and assign version tag to variable.
APKTOOL_VERSION=$(curl -s "https://api.github.com/repos/iBotPeaches/Apktool/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')Download apktool.jar from releases page of the Apktool repository.
sudo curl -Lo /usr/local/bin/apktool.jar "https://github.com/iBotPeaches/Apktool/releases/latest/download/apktool_${APKTOOL_VERSION}.jar"Download Linux wrapper script.
sudo curl -o /usr/local/bin/apktool https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktoolSet execute permission for both files.
sudo chmod a+x /usr/local/bin/apktool.jar
sudo chmod a+x /usr/local/bin/apktoolWe can check Apktool version as follows:
apktool --versionTesting Apktool
Download APK file:
sudo curl -o test.apk https://raw.githubusercontent.com/appium-boneyard/sign/master/tests/assets/tiny.apkNow run the apktool command and provide d argument followed by path of the APK file.
apktool d test.apkIn our case, command decodes test.apk to test folder.
Uninstall Apktool
If Apktool is no longer necessary, just remove JAR file and wrapper script:
sudo rm -rf /usr/local/bin/apktool.jar
sudo rm -rf /usr/local/bin/apktool 
             
                         
                         
                        
Leave a Comment
Cancel reply