Decompilation of Android DEX and XML files

Source: Internet
Author: User
Tags java decompiler

The Dex file is a Java binary file running on delvik on Android. If you are interested in the content and the developer has not published the source code, you can decompile the DEX file using the following method:

1. Decompress system. img

Use xyaffs2 to decompress system. IMG and the imgfile you want to decompress:

Xyaffs2 img_file output_dir

Xyaffs2 can be downloaded from the following address:

Http://limodev.cn/download/xyaffs.tar.gz

2. Find the APK package you are interested in from the output directory and decompress the APK package with unzip:

Unzip contactsprovider.apk

3. Use the dex2jar tool to convert classes. Dex in the decompressed folder into a jar file:

Dex2jar. Sh classes. Dex

Or

Dex2jar. Bat classes. Dex

Dex2jar is as follows:

Http://code.google.com/p/dex2jar/

I am very grateful to the author of this tool "pxb1988". I did not know the author's full name, so I wrote the author's net name.

4. decompress the JAR file with unzip:

Unzip classes. Dex. dex2jar. Jar

5. decompile the class file in the jar package with DJ Java decompiler

Generally, a DJ has a graphical interface, which is easy to operate. You can decompile a single file or decompile it in batches. DJ:

Http://members.fortunecity.com/neshkov/dj.html

During batch decompilation, note that the suffix of the output file is changed to Java, and the default Suffix of the output file is Jad.

6 decompile the XML file with axmlprinter:

java -jar AXMLPrinter2.jar AndroidManifest.xml AndroidManifest2.xml 

    The axmlprinter is as follows:

Http://android4me.googlecode.com/files/AXMLPrinter2.jar

Finally, I would like to thank the developers of the above open-source software for their efforts to make Android decompilation much easier and the decompilation code is highly readable. Thanks again!

This article is reproduced from the http://www.cnitblog.com/houcy/archive/2011/01/27/72731.aspx, thanks to the netizen this article, decompile the software written by others can learn the strengths of others, but to respect others' achievements, not for commercial purposes.

Related Article

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.