Android APK Anti-compilation

Source: Internet
Author: User

Preface

Why do I need apk anti-compilation?

is because we in the normal development of the APK process, may encounter some functions do not know how to implement, but some software has implemented the function, but there is no open source. At this point, with the APK's anti-compilation, we can look at the code level to see how others have implemented this part of the function.

Tools

As the saying goes, "工欲善其事, its prerequisite", so to decompile the APK, we need the following two powerful tools (PS: Both tools can cross the platform):

    1. Dex2jar
    2. Jd-gui
for anti-compilation

Next, we will use the above two tools to do the anti-compilation apk.

Unzip apk

First, we need to unzip the APK using unzip. The specific commands are as follows:

-d /tmp/test
Dex2jar

Next, use this artifact to convert the Classes.dex file in the apk to a jar file. The specific commands are as follows:

bash -x d2j-dex2jar.sh classes.dex

Note that you need to execute permissions for d2j-dex2jar.sh and d2j_invoke.sh two scripts.

Jd-gui

Like my Ubuntu 13.10 64-bit version when using Jd-gui, you may encounter the following error:

while loading shared libraries:...

The main is the lack of 32-bit libraries, the following installation commands can solve these problems:

sudo apt-get install libgtk2.0-0:i386 libxxf86vm1:i386 libsm6:i386 lib32stdc++6

Then, directly with Jd-gui open just dex2jar.sh generated Classes-dex2jar.jar can see the source of the anti-compilation. Such as:

However, as shown, most of the current market-released APK will be confusing code.

Android 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.