Android APK decompilation and *. Class decompilation to *. Java

Source: Internet
Author: User

First, decompilation is not fully compiled. The more complex it is, the more difficult it is to decompile it into a machine language (assembly language ). However, it is usually not possible to convert an executable file into the source code of an advanced language, but to an assembler. It is difficult to decompile files such as *. EXE. For example, to use excoder, even the simplest program can only decompile the code into machine code, which is hard to understand or understand. Java is the JVM used, so it is easy to decompile and can be roughly decompiled into source code. Here I am talking about the approximate meaning. The following is a brief introduction to decompilation.

After the source program of the advanced language is compiled into an executable file, decompilation is the inverse process.
Decompilation: machine code (assembly language) → Advanced Programming Language
  
Reversepengineering, also known as computer software restoration engineering, refers to the "Reverse Analysis and Research" of the Target Program (executable program) of others' software, this product can be used as a reference for software development by others based on the design elements such as ideas, principles, structures, algorithms, processing processes, and running methods used by software products of others, or directly used in your own software products.
Decompilation is a complex process, so the more advanced the language, the more difficult it is to decompile, but there are still a lot of decompilation software:
VB: vbexplorer, VB decompilation genie, and vbrezq; only interface images can be decompiled, as if the Code cannot be decompiled completely
Java: Jad (Joint Application Development); Java decompilation is common, so the decompilation is complete. It is also possible to decompile the class file into a Java file.
C ++: exists
Dephi: Dede
C #: Reflector
Easy language: E-code assumer.exe (easy format Executable File analyzer)

Tools:
1. dex2jar
: Http://code.google.com/p/dex2jar/
2. JD-Gui: Http://java.decompiler.free.fr/jd-gui/downloads/jd-gui-0.3.3.windows.zip
3. apktoolDownload address: https://code.google.com/p/android-apktool (Note: extract apktool-1.3.1.tar.bz2and apktool-install-windows-2.2_r01-2.tar.bz2 to the same Directory, which contains three files: aape.exe, apktool. bat, apktool. Jar)

Android APK Decompilation(Reference: Android _ decompile APK _ to Java source code)
1. Obtain the resource image of the APKOpen it directly with WinRAR, and drag Res/drawable directly.
2. Get XML file information
DOS enters the path of apktool in cmd, and then enters apktool D "XXX1" "xxx2". XXX1 refers to the APK file to be decompiled, xxx2 indicates the path for storing decompiled files.
Example: D: \ apktool> apktool D "D:/lbs.apk" "D:/name"

Iii. decompilation *. Dex get Java source code 
1.decompress the lbs.apk file and find the lbs. Dex file.
2. Enter the path of dex2jar. bat under cmd.
C: \ Users \ HP> D:
D: \> Cd dex2jar
D: \ dex2jar> dex2jar. Bat D:/lbs. Dex
This will generate an lbs_dex2jar.jar file.
3. decompile the JAR file into a Java file using the jd-GUI tool and save all the files to generate a compressed file. All the source code is in the compressed file, after decompression, you can see the detailed code.

Set* Decompile the class to *. Java

Run the jd-GUI tool directly. Of course, you can also use the decompilation tool that comes with Java.

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.