How to install Apktool in Linux and Windows | Apktool installation on Ubuntu and Windows

September 20, 2020

In this blog, you will learn how to install APKTOOL (edit android applications) in Linux and Windows. Commands: apktool d appname.apk, apktool b appname.apk d stands for decompile and b stands for build.

For Video Version Please Click Here


YOU SHOULD ALSO CHECK FOR

TERMUX TUTORIAL
Termux And Functionality Click Here
Create Localhost Using Termux Click Here
TERMUXEasyPhishEFX Click Here
Hack An Android Device MSFVenom Click Here
Install Kali Nethunter In Termux Click Here
Download Youtube Playlist Termux Tutorial Click Here
Host A Payload Using Termux Click Here
What Is Termuxblack By Haxus Click Here

 Hello, and welcome back to EFX Tv once again. Today we are going to see How to install Apktool on Linux and Windows machine. First of all, we will start it with a question what is apktool? Apktools is another utility software to sign an Android APK and provide it valid certificates so that users can modify and reuse any Android application.
Let us install the apktool in Linux
Apktool in Linux (Ubuntu, Kali Linux, Backbox, and many more)
First, download the Linux wrapper script(click the hyperlink and copy the text inside the new page and
save it as apktool
Download apktool-2 the latest version and
rename the downloaded jar file to apktool.jar
Now move both the files apktool and apktool.jar to
/usr/local/bin
To move the files in the specified directory using command
sudo mv apktool apktool.jar /usr/local/bin
Provide the execution permission to both of the files.
cd /usr/local/bin && chmod +x apktool apktool.jar
Open the terminal by pressing
ctrl + alt + t and type apktool
to check if Apktool has installed correctly or not.
Apktool in Windows (Windows 7, 8, and 10)
First, download the Linux wrapper script click the hyperlink and copy the text inside the new page and
save it as apktool.bat 
Download apktool-2 the latest version and rename the
downloaded jar file to apktool.jar
Now move both the files
apktool.bat and apktool.jar to C://Windows
If you can not access the
C://Windows directory
No worries, simply paste it anywhere in the
C drive by creating a new folder as apktool
and add it to the
Environment Variables System PATH variable
Now
run apktool in cmd
To open cmd,
press windows+r and type cmd and hit enter
or search for cmd in the program search box and
use the cmd as an administrator
Once cmd gets opened type, apktool to use the functions.
Environment Variables System PATH variable
To add the apktool to Environment Variables follow the steps written below
Got o windows search box type - Advanced System Settings -Select Advance tab, clicks Environment Variables -In System variables, clicks New... button to add a new text apktool variable and point it to the installed folder apktool is installed.
Some commands and requirements for apktool
Provide the execution permission to both of the files
 chmod 755 * 
Copy the files to the specified directory so that apktool can work properly.
 sudo cp apktool apktool.jar /usr/local/bin 
Check after moving the files if they exist in the same directory you are supposed to move.
 ls /usr/local/bin |grep "apktool" 
Check for execution permision confirmation. If you want to know more about the execution permissions please visit the blog. Work with Permissions in Linux
 ls -l /usr/local/bin |grep "apktool" 
Try to run apktool by typing the command below.
 apktool 
Check for java version it needs to be java8. I've shown in the video and the below commands how to fix java8 issue in Kali Linux. If you want to do it on Ubuntu 2.4 Please visit this link. How to install JAVA 8 on Ubuntu | Java 8 Error
 java -version
In order to install java8 in Kali Linux please follow the command. Java 8 is required to run the apktool.
 echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list 
 sudo echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list 
Update the repositories
 sudo apt-get update 
You can run this command to install the Java8 in Kali Linux
 sudo apt-get install oracle-java8-installer 
This is another command to install java8 In kali liux. If in case 1st command dosent work.
 sudo apt-get install oracle-java8 
Install the default jdk version for your OS
 sudo apt install -y default-jdk 
Please runt this command and select option 2 to select the java8.
 update-alternatives --config java 
 select option 2 and hit enter 
Use this command to decompile the Android apk using apktool
 apktool d fb.apk  
This command is used to build the Android apk again to its original form or after some modifications
 apktool b fb.apk 
Path of build apk for every decompiled application will be the dist directory inside the decompiled path.
 cd fb/dist/ 
Use this command to generate the keystore file to sign the apk. You can change the name of file to anything you want file extension should be .keystore. You can also change the alias according to you. In my case alias name is test. Validity is for 1000 days. Enter the strong password to secure your application key.
 keytool -genkey -V -keystore test.keystore -alias test -keyalg RSA -keysize 2048 -validity 1000 
Sign the apk using Jarsigner prebuild software with java8. Enter the password and fill the owner details to authenticate the identity of developer.
 jarsigner -verbose -sigalg SHA1withRSA -digestalg ShA1 -keystore key.keystore fb.apk test 
Install zipalign, it is used to compress the apk files in the most possible way so that it can work perfectly in any android device.
 apt-get install zipalign 
Update and upgrade the system once again.
 apt-get update 
 apt-get upgrade 
Zipalign the older apk fb.apk with a new name to get the compressed form of the file.
 zipalign -v 4 fb.apk fbSigned.apk 
Change the ownership of the file to copy it somewhere else easily.
 sudo chown efxx:efxx * 
Provide the execution permission to the apk.
 chmod 755 * 
Remove the unwanted files. Now your apk is ready to use.
 rm -rf fb.apk test.keystore  
 sudo rm -rf fb.apk test.keystore 

Uk2blogger