In windows, The Decompilation will not be mentioned. Baidu is a bit more versatile. Next we will talk about the decompilation of Apk in Linux.
Decompilation can be divided into two types: obtaining the application resource file and obtaining the application source code.
1. Get resource files
The resource files in Apk are xml files except for the most images. After extracting the apk file, the xml file displays garbled characters, which can be solved in many ways, here I will introduce a kind of favorite.
Apktool ---- Apk packaging tool: https://code.google.com/p/android-apktool/downloads/detail? Name‑apktool1.5.2.tar.bz2 & can = 2 & q =
After decompression, there is only one file: apktool. jar
[Root @ fedora apktool1.5.2] # java-jar apktool. jar d ../AnZhi.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest. xml with resources...
I: Loading resource table from file:/root/apktool/framework/1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9 patch chunk in file: "drawable-hdpi/AB _menu_item_focused.9.png". Renaming it to *. png.
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
After the command is executed, the corresponding apk folder is automatically generated under the directory apktool1.5.2, which contains the image and xml file, so you can study it well.
Download the apktool-install-linux-r05-ibot.tar.bz2 file, extract the apktoolfile and the apktool.apk file, and put it in the/bin directory, so that you can run it anywhere.
Apktool-install-linux-r05-ibot.tar.bz2: https://code.google.com/p/android-apktool/downloads/list
2. Obtain the source code
A. decompress the Apk file, which contains the class. dex file,
B. Download dex2jar: https://code.google.com/p/dex2jar/downloads/detail? Name‑dex2jar-0.0.9.15.zip & can = 2 & q =
Decompress the package to the directory and run dex2jar. sh classes. dex.
C. JD-gui: view the generated jar file.