当前位置: 代码迷 >> Android >> 在Android make上使用ProGuard
  详细解决方案

在Android make上使用ProGuard

热度:14   发布时间:2016-05-01 16:45:41.0
在Android make下使用ProGuard

应用的 Android.mk 加入

LOCAL_PROGUARD_ENABLED := fullLOCAL_PROGUARD_FLAGS := -include $(LOCAL_PATH)/proguard.cfg

?proguard.cfg

-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*-keep public class * extends android.app.Activity-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 com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native <methods>;}-keepclasseswithmembernames class * {    public <init>(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public <init>(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}
?奇怪的是生成的包和在Eclipse编译出来的不一样!
  相关解决方案