Apktool, Dex2jar, Jd-gui the difference and explanation

Source: Internet
Author: User

53126360

Anti-compilation Related:

Apktool function: The acquisition of resource files can be extracted from the picture file and layout file for viewing

Dex2jar: decompile apk to Java source (Classes.dex into Jar file)

Jd-gui effect: View apk in the Classes.dex converted to the jar file, namely the source file

Overview: Apktool Dex2jar Jd-gui All three of them are related to anti-compilation, but the focus is different, when we have different needs, choose different tools, can get different resources. Usually, we can combine the three together.

Apktool

Dex2jar

Jd-gui

I have aggregated three kit downloads

Use of Apktool:

CMD down into the Apktool directory execution: Apktool d xxxxx.apk


Operation Result:

You can see the directory after the Apktool anti-compilation apk, such as: Assets directory and res directory files and resources in the original project, Lib is a number of third-party. So files, Smail is Calsses.dex converted to

Smail file, not readable

Main uses of Apktool:

1. Can get the resource file in apk

2. Some of the configurations in the Androidmanifest.xml file can be modified after being recompiled, such as Mete-data, which can be used for multi-channel packaging implementations.

Configuration files placed under the 3.assets directory can also be modified.

Application scenario: We manually decompile and modify the channel number in the Mete-data in Androidmanifest.xml, in the Apktool b [modified file directory] back to the APK, note that after the codec is an unsigned apk, We need to re-sign the APK with the Jarsigner.exe in the JDK, and then use Zipalign.exe to align and optimize the signed apk so that it becomes an available apk.

The above step is to manually modify the Androidmanifest.xml to manually package a channel package process, we can certainly configure all the channel number in a configuration file, the above steps are used batch or Python-written packaging tools to replace, that is, we often say multi-channel packaging tools. This also avoids the probability of error.

Not yet? Teach you to decompile apk manually modify Androidmanifest.xml and then back up to play a channel pack

Use of Dex2jar:

1. First, the download good xxx.apk renamed to Xxx.rar, convenient decompression, decompression, such as:

2. Then unzip our downloaded dex2jar.zip into the following directory:

The image is selected as the tool we are going to use.

3. Open cmd to enter the directory to execute D2j-dex2jar.bat xxxx.classes.dex as

Running results such as:

The Classes-dex2jar.jar file is generated in the directory where the batch is processed

This step is mainly to the Classes.dex---------->xxxxxxx.jar file, and Xxxxx.jar inside is our. class file, unzip the Xxxxx.jar after the directory as follows:

We know that Xxxxxx.class bytecode files are not directly previewed. So we're going to use the tools below.

Use of 3.jd-gui

View the source code in Xxxxxxx.jar

1. Find our download Jd-gui-windows-1.4.0.zip and unzip, find the Jd-gui.exe, and the above steps to generate the Xxxxxx.jar file dragged in, you can see the source after the anti-compilation, done:

Apktool, Dex2jar, Jd-gui the difference and explanation

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.