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.