Android-mac computer How to do apk decompile-using Apktool, Jd-gui

Source: Internet
Author: User

Recently, someone in the group asked how to do the APK anti-compilation under the Mac, I have not tried, was previously in Windows Anti-compilation, Windows is very simple, there are many better integration tools, such as apkide (change the rationale), but I guess the Mac should be similar to Windows under, Taking advantage of Kegua Zi's kung fu, I studied how the next Mac under the APK decompile, in fact, is the same as under Windows, where I recorded the following:

The first step: Download the anti-compilation toolset, Apktool, Dex2jar, Jd-gui, and finally I will upload these tools, extracted as follows:

The following popup box is Jd-gui, which is used to decompile the bytecode into a Java source file.

The second step is that the Toolset is not ready to be deserialized, and you can perform input apktool under the command window to indicate that the command does not exist and you need to configure the environment variable

, how to configure it, such as the following command:

1. Open the Command window, Cd/usr/local/bin, there may be Mac computer does not exist bin this directory, directly in the creation of a good, the command is: sudo mkdir bin, after the execution will let you enter the root password, after input to execute the LS command to view, The bin directory is there,

2. AAPT, Apktool, Apktool.jar to the/usr/local/bin/directory under the Apktool folder you extracted, how to copy it, of course, with command CP, such as:

Copy multiple files separated by a space, android-workspace/apk/apktool/directory is the source directory, storage is we want to copy the three files, after executing the command, prompt for password, after the password is copied successfully, LS view, the three files already exist.

At this time, the environment variable is already configured path, what, I did not see any command related to path, in fact,/usr/local/bin is in the path, do not believe me to execute the command you see:

This is why we put apktool3 files under the/usr/local/bin, now you enter the Apktool command to try:

Output such a command will represent the environment configuration.

Step three: Start the anti-compilation, in fact, the command is very simple, we can take an apk, for example:

We're going to decompile the dz-android.apk, the command line goes into this directory cd/users/hailonghan/android-workspace/apk, after this directory,

Execute commands apktool D dz-android.apk, such as:

After successful execution, will be in the current directory to generate a da-android folder, click to see the relevant APK resource files, select Androidmanifest.xml, and then the space bar, you can see the anti-compiled content:

Fourth step: Decompile the Java source file

This is used to Dex2jar and Jd-gui, the dz-android.apk renamed to Dz-android.zip, and then extracted using the decompression software to get a dz-android directory, we want to get inside the Classes.dex file,

Copy it to the dex2jar-0.0.9.15 directory,

Then execute the command: SH dex2jar.sh classes.dex,

A Classes_dex2jar.jar file is generated after successful execution.

Finally, open the jar package with the Jd-gui tool to see the Java source code,

Android-mac computer How to do apk decompile-using Apktool, Jd-gui

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.