APK anti-compilation view *.java,androidmanifest.xml, layout XML file

Source: Internet
Author: User

Posted 3 years ago (2012-08-13 16:50) Read (9359) | comments (2) 8 People collection This article, I want to collect likes 5

Mu-NET, programmer promotion raise pay artifact, click Free to learn

APK anti-compilation view *.java androidmanifest.xml layout XML file

This is useful for not using jockey to confuse code!

One, decompile apk get java source code
First to download 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 (2013-8-8 update--->https://code.google.com/p /dex2jar/downloads/list)

Jd-gui :http://jd.benow.ca/#jd-gui-download

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 dex2jarand 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, anti-compilation apk generate the program's source code and pictures, XML files such as configuration, language resources, etc.

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:

Unzip the downloaded two packages to the same folder, there will be three files in total:aapt.exe,apktool.bat,apktool.jar

Under command line, navigate to the Apktool.bat folder, and enter the following command:apktool.bat 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

APK anti-compilation view *.java,androidmanifest.xml, layout XML file

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.