To carry out such actions you will need:
- dex2jar
- Java decompiler
- ApkTool
Next, perform the following steps:
- Download dex2jar and extract it to a folder, for example
С:\Decompile . - We download Java Decompiler (for example, JD-GUI) and extract files for convenience in the same folder as dex2jar.
- We download apktool and apktool-install-windows-r04-brut1.tar.bz2 and extract the files already in the system folder. The default is
C:\Windows . (Do not forget to download the second archive) - We take the necessary
apk файл and put it in the folder with dex2jar and Java Decompiler . - Open the Command Prompt (Windows Command Handler) in the above folder (In the folder over the empty space while holding the Shift button, press the right mouse button and select the Windows Command Handler).
dex2jar <ваш apk файл> command dex2jar <ваш apk файл> and if everything went well, the file <название вашего файла>.apk.dex2jar.jar will appear in the same folder- Run jd-gui and open the file obtained in the previous step. (On Windows 7 open with administrator rights and with compatibility Windows XP SP3)
- Select the menu item
File-Save All Source s and save. - Extract the resulting zip archive.
- We place the resulting folder in the src folder (you must first create it). (To get something like this structure
С:\Decompile\<название вашего файла>\src\com\android ) - Again, on the command line, enter the command
apktool d <название вашего файла>.apk <название вашего файла> , where <название вашего файла>.apk package name, <name of your file> is a folder for decompiling.
If everything is good, then the specified folder will contain source files in two formats (java and smali), resources and AndroidManifest.xml files, apktool.yml
This will get the source code. True, after decompiling, there are errors in the code, for example, instead of true and false, 1 and 0 are respectively.