Android APK decompilation tool usage and tool download (mac), androidapk

Source: Internet
Author: User

Android APK decompilation tool usage and tool download (mac), androidapk

Tool Name, introduction and:

Apktool (obtain resource files)

Purpose: Obtain resource files. You can extract image files and layout files for viewing.

: Http://download.csdn.net/detail/xue_wei_love/8633211

Dex2jar (obtain the source code file)

Purpose: decompile the apk into the java source code (classes. dex is converted into a jar file ).

: Http://download.csdn.net/detail/xue_wei_love/8633259

Jd-gui (View Source Code)

Purpose: view the jar file converted from classes. dex in the APK, that is, the source code file.

: Http://download.csdn.net/detail/xue_wei_love/8633233

 

 

Decompilation process:

1. decompile the apk to obtain the program's resource files, files, layout files, and other XML configuration and language resources.

Download apktool from the preceding tool and decompress it to obtain three files: aapt, apktool, and apktool. jar,

Put the decompiled APK file in this directory,

Open the command line interface (terminal), locate the apktool folder, and enter the following command:./apktool d-f demo.apk demo

Note:./indicates the current directory.

(In the command, demo.apk indicates the full name of the APK file to be decompiled. demo indicates the Directory Name of the decompiled resource file, that is,./apktool d-f [apk file] [Output Folder]).

After the decompilation is completed, the directory structure is as follows:

It indicates that the file has been obtained successfully, and a demo folder has been added to the folder. You can click it to view all the resource files of the application.

If you want to repackage the decompiled file into an apk, you can enter./apktool B demo (the folder just compiled). The effect is as follows:

 

Then, you can find two more folders in the demo file:

Build and dist (which store the packaged APK files)

 

Ii. decompile apk to get the Java source code

Download dex2jar and jd-gui from the above tools and decompress them.

Change the suffix of apkto to .rar or. zip, decompress it, and obtain the classes. dex file (which is a file compiled by a java file and packaged by the dx tool), for example:

Put the obtained classes. dex in the decompressed tool dex2jar-0.0.9.15 folder, locate the directory of dex2jar. bat under the command line, and enter dex2jar. bat classes. dex. The effect is as follows:

 

In this directory will generate a classes_dex2jar.jar file, then open the tool jd-gui folder in the jd-gui.dmg, then use the tool to open the previous generated classes_dex2jar.jar file, you can see the source code, the effect is as follows:

Note: The name of the class file and the method names in it are all named in a, B, c... and other styles ).

 

Through decompilation, you can know the third-party library files used by the application and how the code is compiled. However, if the APK is obfuscated, the name of the class file you see and the method name in it will be a, B, c .... you can find the interface code you want to know. It may be very difficult to find the code, but a general idea will be obtained, with this idea, you can try it on your own.

 

Refer:

Android APK decompilation is so simple (for windows)

Confusion reference Tutorial: how to prevent the apk program from being decompiled

 

 


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.