Add Proguard.config=proguard.cfg to the project.properties.
The PROGUARD.CFG configuration is as follows:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations!code/simplification/arithmetic,!field/*,!class/merging/*
#忽略警告 can also use-ignorewarnings
-dontwarn
#声明第三方jar包, regardless of the. So file in the third-party jar package (if any)
-libraryjars Libs/baidumapapi.jar
-libraryjars Libs/tencent_openapi.jar
-libraryjars Libs/httpmime-4.1.3.jar
-libraryjars Libs/weibo.sdk.android.sso.jar
-libraryjars Libs/android-support-v4.jar
-keep public class * extends ANDROID.APP.ACTIVITY
-keep public class * extends ANDROID.APP.APPLICATION
-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 Com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
Native <methods>;
}
-keepclasseswithmembers class * {
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 {
public void * (Android.view.View);
}
-keepclassmembers enum * {
public static **[] values ();
public static * * VALUEOF (java.lang.String);
}
-keep class * Implements Android.os.Parcelable {
public static final Android.os.parcelable$creator *;
}
#不混淆第三方jar包中的类
-keep class com.baidu.mapapi.** {*;}
-keep class com.tencent.tauth.** {*;}
-keep class org.apache.http.entity.mime.** {*;}
-keep class android.support.v4.** {*;}
-keep class android.net.http.** {*;}
-keep class com.weibo.sdk.android.** {*;}
-keep class com.sina.sso.** {*;}
Note that if there is a. So file in the third-party jar package, do not bother with the introduction of third-party jar files do not confuse, otherwise you may report an exception
Android Obfuscation package configuration (ignoring third-party jar)