Android APK Anti-compilation details (drawings)

Source: Internet
Author: User

This period of time learning Android application development, in the thinking since it is developed in Java should be very good anti-compilation to get the source code bar, Google a bit, it is really simple, the following is my practice process.

In this solemn declaration, the purpose is not to crack people's software, is completely a learning attitude, but it seems that through this way can also go to the Chinese some foreign software.


This article Android anti-compilation tutorial, test environment:

Win7 Ultimate x64

Ubuntu 12.04 x86_x64

Anti-compilation toolkit Download (2012-10-10 update)

One, APK anti-compilation get Java source code

Download the anti-compilation toolkit above, open the dex2jar-0.0.9.9 folder under the Apk2java directory , including the apk decompile to Java source Tools, as well as the Source view tool.

APK Anti-compilation tool Dex2jar, is to convert the Classes.dex in the apk into a jar file

Source View tool Jdgui, is an anti-compilation tool that can directly view the source code of the anti-compiled jar package


Dex2jar and Jdgui The latest version of the download, see Google Code:

Dex2jar (Google Code)

Jdgui (Google code), the latest version please see the official


Specific steps:

First, the apk file suffix to zip and unzip, get the Classes.dex, it is Java file compilation and then through the DX tool packaging, copy the Classes.dex to Dex2jar.bat directory dex2jar-0.0.9.9 folder.

Under command line, navigate to the directory where the Dex2jar.bat is located, run

Dex2jar.bat Classes.dex

Generated

Classes_dex2jar.jar


Then, go to the Jdgui folder double-click jd-gui.exe, open the above generated jar package Classes_dex2jar.jar, you can see the source code, such as:



Helloandroid source code in the anti-compilation before and after the comparison is as follows:



The source code and pictures, XML configuration, language resources and other files of apk decompile Generator

This is especially useful if you have a Chinese software.

The first is to download the above anti-compilation toolkit, where the latest apktool, please go to google code download

Apktool (Google Code)


concrete steps:

Download the anti-compilation toolkit above, open Aapt.exe,apktool.bat,< Span style= "word-wrap:normal; Word-break:normal; line-height:21px; Color: #ff0000; " >apktool.jar 

Note: The Apktool_bk.jar inside is the old version of the backup, preferably with the latest Apktool.jar


Under command line, navigate to the Apktool.bat folder and enter the following command:apktool.bat d-f abc123.apk abc123, such as:

, Apktool.bat command line explanation: Apktool.bat d-f [apk file] [output folder]


The following files are deserialized (Androidmanifest.xml, for example):



To repackage the finished file into an apk, it is easy to enter apktool.bat b abc123(you compiled the folder), the command is as follows:

After packaging the apk file under directory C:\HelloAndroid, two folders were generated:

Build

Dist

wherein, the package generated helloandroid.apk, in the above Dist folder, Ok



Three, graphical anti-compilation apk

Step one or two above describes the command-line anti-compilation apk, which now provides a graphical anti-compilation tool:androidfby

First, download the Anti-compilation toolkit above, open the androidfby directory, double-click the Android Anti-compilation tool,. exe, you can browse to open the apk you want to decompile

Android APK Anti-compilation details (drawings)

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.