About Android confusing files Project.Properties and proguard-project.txt detailed

Source: Internet
Author: User

Have not understood the specific role of some files in the development of Android, and later used, the specific study, a reference to the information on the Internet, the final summary, easy to view later!

The old version of a file default.properties, since it is the old version, has been eliminated, no longer delve into.

While the new version of ADT creates the project, the mixed-code files are project.properties and proguard-project.txt.

If you need to make a global mix of items, do the following:

Add the Project.Properties file in the

"#" in "# Proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt" will be removed.

But some code can not be confused, because he is called third-party certain methods, classes, etc... After this confusion, the program may not be able to find the method of confusion after the method name corresponding to the problem, such as the addition of so file, need to call the method inside, then call JNI Access so file method can not be mixed code. We need to use proguard-project.txt at this time. In fact, the Proguard-project.txt file is a description of our confusion of the rules, which should be confused, which should remain as is, the following is a detailed explanation of the written rules (the original version of the contents of the Proguard.cfg file):

-injars Androidtest.jar "jar Package Address"
-outjars out "Output address"
The jar of the library referenced by-libraryjars ' D:\android-sdk-windows\platforms\android-9\android.jar ', used to parse the jar class specified by Injars "

-optimizationpasses 5
-dontusemixedcaseclassnames "does not produce a variety of class names when confused"
-dontskipnonpubliclibraryclasses "Specifies that non-public library classes are not ignored. 】
-dontpreverify "No pre-check"

-verbose
-optimizations!code/simplification/arithmetic,!field/*,!class/merging/* "Optimization"

-keep public class * extends Android.app.Activity "No confusion remains as is"
-keep public class * extends Android.app.Application
-keep public class * Extends Android.app.Service
-keep public class * extends Android.content.BroadcastReceiver
-keep public class * extends Android.content.ContentProvider
-keep public class * extends Android.app.backup.BackupAgentHelper
-keep public class * extends Android.preference.Preference
-keep public class Com.android.vending.licensing.ILicensingService

-keep Public Abstract Interface com.asqw.android.listener{
Public protected <methods>; "All methods are not confused"
}
-keep public class com.asqw.android{
public void Start (java.lang.String); "No confusion with this method"
}

-keepclasseswithmembernames class * {"protects the name of a member of a specified class and class if all the specified class members are present (after the compression step)"

Native <methods>;
}

-keepclasseswithmembers class * {"Protects the members of the specified class and class, but the condition is that all specified classes and class members are to be present." 】
Public <init> (Android.content.Context, Android.util.AttributeSet);
}

-keepclasseswithmembers class * {
Public <init> (Android.content.Context, Android.util.AttributeSet, int.);
}

-keepclassmembers class * extends Android.app.Activity {"Protects members of a specified class if this class is protected they will be better protected"
public void * (Android.view.View);
}

-keepclassmembers enum * {
public static **[] values ();
public static * * VALUEOF (java.lang.String);
}

-keep class * Implements Android.os.Parcelable {"Protection of members of specified class files and classes"
public static final Android.os.parcelable$creator *;
}

The above quoted from a web blog ~ ~ ~ Thank you!!!

About Android confusing files Project.Properties and proguard-project.txt detailed

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.