Turn to Android anti-compilation and anti-compilation methods

Source: Internet
Author: User
Tags rar

Android is Java-based, and the Java Anti-compilation tool is very powerful, so the normal APK application can basically do 100% anti-compilation restore.

So developers who are not ready to open up their own projects need to know how to prevent anti-compilation and decompile other people's projects to learn.

More than 2.3 versions add a "Proguard.config=proguard.cfg" to the Eclipse Auto-generated default.properties file to confuse the code, which is hard to read after it is recompiled.

The SDK version before 2.3 does not matter, copy the above proguard.cfg file into the project, and then do the same.

Android-proguard obfuscation use, there is a reference to the third-party jar package when the error: You could need to specify additional library jars (using '-libraryjars ') processing method: in Progu Add-dontwarn Com.motorola.**-keep class com.motorola.** {*;} at the top of the Ard.cfg file Description:-dontwarn and-keep combine parameters to maintain classes in third-party libraries without confusion,-dontwarn com.motorola.** means to keep com.motorola.** all classes and all methods inside the package without confusing

-keep class com.motorola.** {*;} It means proguard do not warn you that you cannot find a reference to the class com.motorola.** the package. The corresponding package name is changed to your corresponding jar top-level package

Detailed view of official documents Http://developer.android.com/tools/help/proguard.html

Some applications after the Java code with JD-UI can not open, even confusing code can not see, I try to do many times (online there is a confusion tool for the Anti-compilation tool), want to know how to deal with the notice.

--Note: The above problems after I have tried to finally find part of the reason, The use of the version is relatively low, the latest version is dex2jar-0.0.9.7, two. Dex2jar directory do not have Chinese, three. You need to drag the Class.dex directly to the Dex2jar.bat, generate Classes.dex.dex2jar.jar. If a heap of at Com.googlecode.dex2jar.ir.ts.TopologicalSort.dfsRemove (topologicalsort.java:135) errors are reported during the jar generation process, the Look at the official issue report there are a lot of people have similar problems, seemingly into a dead loop, and the size of the APK file is a bit related, should be a dex2jar bug.

Note: The above features just confuse the Java code, XML and resource files, pictures are not confused, some game application image is important to convert to DAT files, plus their own encryption and decryption algorithm to restore.

In addition to the obfuscation function also has the function of compression, after the confusion of the apk than the original small (the proportion of your code to see the repetition of the amount)

So, when you're done with anti-compilation, how do you decompile it?

Let's talk about the process and principle of anti-compilation:

1. Apktool the apk--> resource Bundle (Java code to Smali file), you can modify the file in the resource bundle.

2.apk suffix renamed to zip or rar decompression, get Classes.dex file, with Dex2jar converted to jar package (note: Directly extracted resources file is not directly open, to use the first step of the anti-compilation tool, Dex2jar.bat file directory do not have Chinese).

------------------------------------------

new instructions for use (do not replace the APK into a zip decompression, you can directly drag the apk file onto the Dex2jar.bat-not include the Chinese name)Download Dex2jar Latest Version http://code.google.com/p/dex2jar/downloads/list extract dex2jar-version.zip files to a directory. Let's say/home/panxiaobo/, C:\unzip-x dex2jar-version.zip-d/home/panxiaobo uses Dex2jar to generate. jar files.   Dex2jar will generate a Someapk_dex2jar.jar file in the directory where someapk.apk is located. Linux sh/home/panxiaobo/dex2jar-version/dex2jar.sh/home/panxiaobo/someapk.apk Windows C:\dex2jar-version\ Dex2jar.bat someapk.apk

--------------------------------------------------

3. View the Java code directly with the Java Decompile tool such as Jd-ui.

4. Put the Java code and the first version of the resource bundle together to re-compose a new application.

5. Recompile with Apktool.

6. Re-sign with the signature tool.

7. Republish the app with the new signature.

Note: If you don't need to change Java code, just change style and Han 2.3.4 Steps is not necessary.

Open source projects on Google Code

Apktool http://code.google.com/p/android-apktool/

Dex2jar Http://code.google.com/p/dex2jar/ps: This is written by the Chinese.

In addition, someone made a tool set, integrated Apktool Dex2jar Jd-ui, but I downloaded the operation can not know whether the corresponding environment is not the result of pairing

hackapk http://code.google.com/p/hackapk/

In addition, some people have apktool made a package to make EXE file graphical interface convenient to use, cut a figure out to everyone to see it

Note: The above software can not be signed, to use another software (apksign) to sign, as follows:

Also give the above two tools download connection Jifeng forum above, estimated direct click on the connection can not download

Xwindows, with graphical interface: apktool.rar (3.33 MB)--This can be downloaded to http://code.google.com/p/android-apktool/ Download the latest version of Apktool.jar to replace the original.

Signature tool:auto-sign.rar(312.45 KB)

There are also some command line tools, I give the APK editor different version of the above description does not correspond to waste a lot of time

1. Normal apk file (which is the third-party software downloaded from various websites)

(1) Put him in the Place-apk-here-for-modding folder. (Do not have spaces and Chinese, Chinese to English) (2) Open Script.exe, enter in CMD window 22 or 23 (set up the current project), select the number of the APK file you want to edit, enter confirm

As above: Some version of the current project options to change to 23, but the document did not change, press 221 straight can not select the APK, the reason is not good to find.

It is recommended that you use the graphical interface.

Turn to Android anti-compilation and anti-compilation 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.