Decompilation of Android APK files

Source: Internet
Author: User

During this time, I was learning about Android Application Development. I was thinking that since it was developed in Java, it should be a good decompilation to get the source code. google is actually very simple. The following is my practical process.

I solemnly declare that the purpose of the post is not to crack the software of other people, but it is completely a learning attitude, but it seems that some foreign software can be customized in this way.

 

 

In this document, the Android decompilation tutorial and test environment are as follows:

Win7 Ultimate x64

Ubuntu 12.04 x86_x64

Decompilation Toolkit Download(Updated on February 10)


I. ApkDecompilationObtain the Java source code

Download the decompilation toolkit, open the dex2jar-0.0.9.9 folder under the apk2java directory, contains apk decompilation into java source code tools, as well as source code viewing tools.

The apk decompilation tool dex2jar is used to convert the classes. dex in the apk into a jar file.

Jdgui is a decompilation tool that allows you to directly view the decompilation jar package source code.

 

Dex2jar and jdgui are downloaded in the latest version. For details, see google code:

Dex2jar (google code)

For the latest version of jdgui (google code), see the official website

 

Procedure:

First, change the suffix of the apk file to zip and decompress it to obtain the classes. dex, which is compiled by a java file and then packaged by the dx tool. copy dex to dex2jar. the dex2jar-0.0.9.9 folder in the directory where bat is located.

Locate the directory of dex2jar. bat in the command line and run

Dex2jar. bat classes. dex

Generate

Classes_dex2jar.jar

 

Then, double-click jd-gui.exe and open the jar package classes_dex2jar.jar generated above to view the source code, as shown in the following figure:


The following is a comparison of the HelloAndroid source code before and after decompilation:

Ii. apkDecompilationGenerate program source code and images, XML configuration, language resources, and other files

This is especially useful if it is a Chinese software.

First, download the decompilation toolkit mentioned above. For the latest apktool, download it from google code.

Apktool (google code)

 

Procedure:

Download the decompilation toolkit and open the apktool1.4.1 folder under the apk2java directory, which contains three files: aapt.exe, apktool. bat, and apktool. jar.

Note: apktool_bk.jar is the old backup version. It is best to use the latest apktool. jar

 

Go to the apktool. bat folder under the command line and enter the following command:Apktool. bat d-f abc123.apk abc123Such:

Apktool. bat command line explanation: apktool. bat d-f [apk file] [Output Folder]

 

The decompiled file is as follows (AndroidManifest. xml is used as an example ):

Re-package decompiled files into apk, which is easy to inputApktool. bat B abc123(You can compile the folder). The command is as follows:

The package apk file is in the directory C: \ HelloAndroid and two folders are generated:

Build

Dist

In this example, package the generated helloandroid.apk. In the above dist folder, OK

 

 

Iii. Graphic decompilation apk

Steps 1 and 2 above describe the command line decompilation apk, and now provides a graphical decompilation tool: Androidfby

First, download the decompilation tool package, open the androidfbydirectory, and double-click the androiddecompilation tool .exe to open the decompilation apk.


 


This document decompile the toolkit to sort out the previous versions:

Android decompilation Toolkit (upgrade)

Android decompilation tool)

Android decompilation tool)

 

 

This blog decompilation method is for reference only. It cannot be used for illegal or commercial purposes. Thank you!

From: http://blog.csdn.net/ithomer/article/details/6727581

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.