On the problem of confusing file configuration under Android Studio (i)

Source: Internet
Author: User

1. Reference https://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html Recent project summaries for official documents and online blogs2. Android Studio (hereafter abbreviated AS) has the default proguard-project.txt, which configures the path for the confusing configuration file under the Gradel of the project. actually for a proguard3 Confusing objects Proguard default is to confuse all files

No confusion is generally made in the following situations:

A four components, support package (General V4, V7)

b resource file, R file

C JS Call

D reflection and invocation of reflected classes

E JNI Invocation

f so libraries, jar packages (which are generally confusing)

4. Basic grammar because the information on the Web is omitted this part of this paper gives an important part:

A. A wildcard character similar to Java * * represents a class that matches all characters * * denotes all classes and their sub-paths of the package class

B. If you keep a class that does not confuse the -keep class name {*;} Class name is full name (contains package name)

C. Keep Subclasses of a class from being confused-keep * Extends class name {*;} It's like Java, isn't it?

E. Keeping a single method of a class unchanged-keepclassmembers class name { can contain a wildcard character method name}

F. Maintaining a class containing a method is not confused-keepclasseswithmembers class name { can contain wildcard characters }

See https://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/usage.html

5 Other

A.optimize whether the algorithm is used for compression

B. shrink whether to delete unused (unused files) This should be careful like reflection, etc.

C -libraryjars for imported jar packages, so libraries (just imports) Gradel some have been configured to report a .... Twice's fault .

D Close Obfuscation dontobfuscate


PS: Open Confusion in Build.gradel: Buildtypes--"release--" minifyenabled true




Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

On the problem of confusing file configuration under Android Studio (i)

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.