APK app's anti-compilation and source code generation

Source: Internet
Author: User

The anti-compilation has always held a matter of no or no attitude. After yesterday afternoon's attempt, also had a bit of experience and experience:

Let's take a look at the compilation process and our anti-compilation process Overview:




For example, the following is the root folder structure of the Anti-compilation tool:


The three directories are actually the following three steps:

(I do not know people found that, I changed the name of the three folders, Apktool is the tool to process the APK, Dex2jar is the tool to process the Dex file as a jar package.) Jar2gui is the tool that we convert the class from the jar package to the GUI interface of the source code for everyone to refer to.


SETP 1: in Apktool:
Open the DOS box (Cmd enters and then enters the folder. This should all be including women. Run Apktool D-S xxx.apk

Here will be in this folder to generate a folder with the name of the APK name, there are Classes.dex+res folder +androidmanifest.xml These three things, presumably we have understood the connotation of the, yes. This is the root folder of our project. And Dex is an Android executable file packaged with jars.

/*

* The Apktool in the command is actually the Apktool.bat batch file under the running folder, and the xxx.apk of the second side is the name of the APK package that we need to decompile.

Of course, people who use DOS commands all the time, until the file name or path can be replaced with their absolute path, so let's say we put the package we need to decompile into the current root folder, which is the ability to run the command directly by trying its name.

*/


SETP 2: in Dex2jar

Copy the classes.dex generated in 1 (that is, a runnable file under Android, generated by a cluster of. class file Jar packages) into the Dex2jar
Run Dex2jar classes.dex---> Generate jar package. That's Classses_dex2jar.jar.


SETP 3: Under Jar2gui execute Jd-gui Select the jar in 2, you can view the source code (here is the source code).



Since the concept of "real source code" is mentioned above. The corresponding must have pseudo-source code (purely I make words, if there is the same, you guess?) Haha, joking)

Here's another picture.


The left side is what we achieve with SETP 3, and the right side is the Java source file that we decompile the class file with the Jad tool. It is clear from the control that a very painful conclusion is drawn. The anti-compilation of the east of the eye can't bear to see Ah. Of course. The code on the left side can be copied directly. But suppose you want to generate the source code to compile the word. Please think again ~ ~ ~ after all, we decompile one is to use res resources, there is also a reference code, if you want to crack the original apk, I believe there is a way to decompile the better source code (with the tool for the copy, so although the class does not have to decompile. But get a relatively accurate source code)


Use the Jad tool in detail to decompile the word. I will not continue to write, the detailed tutorial written in the toolkit Readme.text text, Welcome to download:

Android Anti-compile tool

Jad Tool


APK app's anti-compilation and source code generation

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.