Build an Apk decompilation environment in CentOS

Source: Internet
Author: User

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

  1. [Root @ fedora apktool1.5.2] # java-jar apktool. jar d ../AnZhi.apk

  2. I: Baksmaling...

  3. I: Loading resource table...

  4. I: Loaded.

  5. I: Decoding AndroidManifest. xml with resources...

  6. I: Loading resource table from file:/root/apktool/framework/1.apk

  7. I: Loaded.

  8. I: Regular manifest package...

  9. I: Decoding file-resources...

  10. W: Cant find 9 patch chunk in file: "drawable-hdpi/AB _menu_item_focused.9.png". Renaming it to *. png.

  11. I: Decoding values */* XMLs...

  12. I: Done.

  13. 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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.