APK Anti-compilation

Source: Internet
Author: User

One, using Apktool to Decompile

1, first in

Http://code.google.com/p/android-apktool/downloads/list

Download two files: apktool1.4.3.tar.bz2 and apktool-install-windows-r04-brut1.tar.bz2

2, unzip the first file to get Apktool1.4.3.jar put into C:\Windows, the second file contains Aapt.exe and apktool.bat two files are also placed in the C:\WINDOWS folder.

3, you can see some help information by typing Apktool at the command line.

4. Enter Apktool D c:\***\***.apk c:\***\*** to decompile the c:\***\***.apk apk file to c:\***\***

Second, the use of Dex2jar anti-compilation

The first thing to download is two tools: Dex2jar and Jd-gui

The former converts the Classes.dex in the apk into a jar file, and Jd-gui is an anti-compilation tool that can view the source code of the jar package directly. The following are:

Dex2jar:http://laichao.googlecode.com/files/dex2jar-0.0.7-SNAPSHOT.zip

Jd-gui:http://laichao.googlecode.com/files/jdgui.zip

Specific steps:

First, the apk file, the suffix to zip, unzip, get the Classes.dex, it is the Java file compiled and then packaged with the DX tool;

Unzip the downloaded Dex2jar and copy the Classes.dex to the directory where Dex2jar.bat is located. Navigate to the directory where the Dex2jar.bat is located at the command line

Run

Dex2jar.bat Classes.dex

Generated

Classes.dex.dex2jar.jar

The following are the generated jar files:

Run Jd-gui (jd-gui.exe), open the jar package generated above, you can see the source code


Helloandroid Source code (pre-compiled apk source control) is as follows:

Second, the anti-compilation apk generator source code and pictures, XML configuration, language resources and other files

This would be especially useful if it was just a Chinese software.

The first is to download the tool, this time use is Apktool

: http://code.google.com/p/android-apktool/downloads/list

Download: apktool1.4.1.tar.bz2 and apktool-install-windows-r04-brut1.tar.bz2 (two packages are all downloaded)

Specific steps:

To extract the downloaded two packages to the same folder, there should be three files: Aapt.exe,apktool.bat,apktool.jar

Under command line, navigate to the Apktool.bat folder, and enter the following command: Apktool d c:\*.apk c:\* folder, such as:

Command line explanation: Apktool d [apk file] [output folder]

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

Special Note: The files you want to decompile must be placed in the root directory of the C drive.

To repackage the finished files to apk, it is very simple, enter the Apktool B c:\*** folder (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

Note: This Android anti-compilation tutorial is in Windows 7 Ultimate 64bit, tested by

The above anti-compilation toolkit downloads

In addition, as an application developer, you certainly don't want your code to be recompiled, and the next time the blog tells you how to put it in reverse by confusing the code:

How Android prevents the APK program from being recompiled

APK anti-compilation

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.