Android anti-compilation-anti-compilation tools and methods

Source: Internet
Author: User

Objective

Some of the development process will encounter some features, I do not know how to do, but other software has already, this time can be used in the way of anti-compilation, to solve the other procedures, to understand some of its practices, while Ah, can also draw on other people's software structure, resource files, and so on, haha. Then I will explain some of the anti-compilation related knowledge, mainly divided into three, the first introduction of anti-compilation tools and methods, the second, introduced the syntax of Smali, the third article describes how to prevent anti-compilation, mainly through these articles, learn how to do anti-compilation and code hardening.

Tool apktools-Currently the most powerful anti-compilation tool

Easily decompile apk, parse out the resource file, XML file, generate Smali file, and can also put the modified file you want to generate APK.

Support Windows,linux,mac.

: Https://code.google.com/p/android-apktool/downloads/list please bring your own ladder

Dex2jar

Convert the Dex file in the apk into a jar file, many people will not look at the Smali file, or look at the Java class file is more comfortable, this time can use this tool to turn to Java, but also support Windows,linux,mac.

: http://code.google.com/p/dex2jar/downloads/list

Jd-gui

Viewing the jar file, you can basically see the Java class file, and also support Mac,windows,linux.

: http://jd.benow.ca/

Apktool's command line synthesis tool recommended Apktool plus

In fact, someone else wrote a tool, set up the function of Apktool, but also support to the APK signature. The latest version is V9UPDATE6, which only supports Windows systems.

: http://dl.dbank.com/c0jndlkbu4#

Use Apktools for anti-compilation

Execute the following command under the Apktools directory

./apktool d pathtoapk outdir #mac Linux
Apktool.bat d pathtoapk OutDir #window

This will be able to decompile the successful, you can view the resource files, Smali files, of course, some apps have special processing, not all can be decompile.

At the same time Apktool can also reverse the anti-compiled file into an apk file, the format is as follows.

./apktool B AppPath Outpath

If the reverse file is unsigned, it needs to be signed before it can be installed.

Using Dex2jar

The apk file itself is actually a zip compression package, first of all, the APK changed to a . zip file after decompression to get a classes.dex. To the Dex2jar directory, execute the following command.

./d2j-dex2jar.sh Pathtoclasses.dex #mac Linux
D2j-dex2jar.bat Pathtoclasses.dex #wind

A jar file is then generated and the Java code can be seen with Jd-gui open.

Other

In fact, we use the anti-compilation is enough, often do not get a lot of code, after all, there are measures to deal with.

Original address: http://blog.isming.me/2015/01/11/android-decompile-tools/, reproduced please indicate the source.

Android anti-compilation-anti-compilation tools and methods

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.