Code obfuscation for Android development

Source: Internet
Author: User

1. Start the obfuscation switch
In the project directory under the Project.Properties file, known as the proguard.config tag, the default is the off state, open. 2. Confusing configuration
In the project directory under the Proguard-project.txt file for specific confusion configuration, after configuration right click on the project, select Export exported apk package, the APK package is a confusing package.

Example: Package named Com.test

-dontwarn org.*
-keepattributes Enclosingmethod, innerclasses
-keepattributes *annotation

-keepattributes Signature
-keepattributes sourcefile,linenumbertable

#配置不进行混淆的类
-keep class Android.support. * { *; }
-keep class Com.test.model.
* { *; }

#配置不进行混淆的枚举类型
-keepclassmembers enum * {*;}

#配置不进行混淆的成员变量
-keepclassmembernames class Com.test.db.Table {
public long *;
}

For more information, refer to: http://developer.android.com/guide/developing/tools/proguard.html

Linghaihua

Code obfuscation for Android development

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.