Use the proguard obfuscation source code that comes with Android

Source: Internet
Author: User

Android projects are not obfuscated for a long time, because even obfuscation cannot confuse activity, service, and broadcastreceiver classes, so they can be analyzed by decompilation. And your ownCodeThere is no reason for confusion. However, the more Android is studied recently, the more decompilation, and the confusion is found in most applications. when analyzing the source code, it also has a certain value, so I tried obfuscation.

My ADT version is 10, so obfuscation is there. I don't know which version of ADT has proguard, therefore, make sure that your "SDK directory \ tools \" contains the proguard folder.

Now we create a new project in eclipse, and the file proguard. cfg will usually appear. This file is our obfuscation script file. Fortunately, ADT provides a lazy solution. Therefore, in most cases, we do not need to change this obfuscation script file. Of course, if you want to know more about proguard and obfuscation scripts, you can visit the installed SDK documentation:

Your SDK installation directory \ docs \ guide \ developing \ tools \ proguard.html

Here I use the notepad example in Samples

You may have noticed that there is no obfuscation script file proguard. cfg. It doesn't matter. We copied one from other projects.

Then, we add a code in the default. properties file, so that the compiler will automatically run proguard to call the proguard. cfg script during release for obfuscation.

Because it is impossible for someone to confuse the code in debug, this is only valid in release.

Next, export the unsigned APK of this project.

Then, we use dex2jar to convert the dex in the current APK into a jar, and then use JD-Gui for decompilation. Next we can find that our APK has been confused, Hoho ~~~

Have fun!

Related Article

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.