Android Studio Obfuscation

Source: Internet
Author: User

This article explains the code obfuscation of Android Studio:

The first step: to make the confusion effective, to modify the project (APP) under the Build.gradle of a content:minifyenabled value is set to True, the current project can be used confused.

Apply plugin: ' Com.android.application 'Android {compilesdkversion24buildtoolsversion"24.0.0"Defaultconfig {ApplicationID"Com.aimqq.andfixdemo"minsdkversion15targetsdkversion24Versioncode1Versionname"1.0"Testinstrumentationrunner"Android.support.test.runner.AndroidJUnitRunner"} buildtypes {release {minifyenabledtrue//set here to true to indicate the use of confusion false means to disable confusionproguardfiles Getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro '}}}dependencies {compile Filetree (dir:' Libs ', include: [' *.jar ']) Androidtestcompile (' com.android.support.test.espresso:espresso-core:2.2.2 ', {Exclude group:' Com.android.support ', module: ' Support-annotations '}) Compile' com.android.support:appcompat-v7:24.1.1 'Testcompile' junit:junit:4.12 'Compile' Com.alipay.euler:andfix:[email protected] '}

Step two: Define our own obfuscation rules:

① let the obfuscation rule take effect only in the current project, we just need to add the rule to the project's Proguard-rules.pro file.

② If you want to be your own definition of the obfuscation rules after all the projects are in effect, then you need to go to your SDK directory under \tools\proguard\proguard-android.txt to modify, add the corresponding obfuscation rules.

If you want to know more about the confusion and grammar, please refer to this blog:

http://blog.csdn.net/u011889786/article/details/50945693

Android Studio Obfuscation

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.