Disassembly of APK package in Android

Source: Internet
Author: User

Address: http://blog.csdn.net/ariesjzj/article/details/7311340

Two popular methods are described here.

The advantage of method 1 is that byte code can be decompiled into code form, but after all, it is reverse engineering and sometimes some byte code will be inserted, I also encountered some files that were opened through disassembly and crash, but after all, there were a few. In addition, the disassembly of XML and resource files does not seem powerful. This method is much better. Method 2: The decompiled items are relatively regular. The disadvantage is that the Java code is smali's byte code. Generally, I use the first method, but I cannot use the second method. In most cases, we need to combine them.

Method 1: JD-Gui + dex2jar

Decompress the APK with unzip. After converting windows to. Zip, decompress it. In fact, if you use 7-zip, you don't need to forcibly decompress it. in Linux, unzip will work, for example:

$ Unzip abc.apk-D unpack

Among them, abc.apk is the APK name, and unpack is the directory where the extracted content is stored. After decompression, there is a classes. Dex file in the directory. Use dex2jar. Sh in the dex2jar tool to convert it into a jar file (dex2jar. BAT in Windows ):

$ Dex2jar. Sh classes. Dex

Finally, open the jar using JD-Gui.

Second: apktool. Another advantage of this method is that it can be packaged after being decompressed. Although I have never used the packaging function.

APK unpack:

$ Apktool D abc.apk <directory>

The advantage of extracting this method is that the configuration files androidmanifest. XML are all readable, and the preceding method becomes garbled. The disadvantage is that the Java code is smali Code and is not easy to read. Therefore, it is better to combine the two methods.

APK packaging:

Apktool B <directory>

After decompression, there may be a. So file called by JNI In the lib directory, so let's take objdump and readelf honestly.

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.