Decompile Android APK to obtain Java source code and resource files

Source: Internet
Author: User

I solemnly declare that the purpose of the post is not to crack the software of other people, but it is completely a learning attitude, but it seems that some foreign software can be customized in this way.

1. decompile Apk to get the Java source code

First download two tools: dex2jar and JD-GUI, the former is to convert the apk classes. dex into a Jar file, while the JD-GUI is a decompilation tool, you can directly view the source code of the Jar package.

The following are:

Dex2jar: http://laichao.googlecode.com/files/dex2jar-0.0.7-SNAPSHOT.zip

JD-GUI: http://laichao.googlecode.com/files/jdgui.zip

Procedure:

First, change the suffix of the apk file to zip, decompress it, and obtain the classes. dex, which is compiled by the java file and then packaged by the dx tool;

Decompress the downloaded dex2jar and copy classes. dex to the directory where dex2jar. bat is located. Locate the directory of dex2jar. bat in the command line and run

Dex2jar. bat classes. dex

Generate classes. dex. dex2jar. jar

Run the JD-GUI, open the jar package generated above, you can see the source code.

Ii. decompile the source code and images, XML configuration, language resources, and other files of the apk Generation Program

This is especially useful if it is just a Chinese software. First, download the tool. This time we use apktool ,:

Bytes.

Procedure:

Decompress the downloaded two packages to the same folder. There should be three files: aapt.exe, apktool. bat, and apktool. jar;

Go to the apktool. bat folder under the command line and enter the following command:

Apktool d C: \ ***. apk C: \ *** folder

Command Line explanation: apktool d [the apk file to be decompiled] [Output Folder]. Note: The files to be decompiled must be placed in the root directory of drive C;

Re-package the decompiled file into an apk. It is easy to enter the apktool B c: \ *** folder (you can compile the folder.

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.