修改project.properties檔案 [html] #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt去掉之前的#,即取消注釋 修改proguard-project.txt檔案(忽略第三方jar)引入第三方庫: -libraryjars /libs/umeng_sdk.jar 忽略類: -keep class com.umeng.** {*;} [java] -optimizationpasses 7 -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -dontpreverify -verbose -allowaccessmodification -repackageclasses -dontusemixedcaseclassnames -dontoptimize -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 * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class com.android.vending.licensing.ILicensingService -libraryjars /libs/umeng_sdk.jar -keep class com.umeng.** {*;} -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 *; } -optimizationpasses 7-dontskipnonpubliclibraryclasses-dontskipnonpubliclibraryclassmembers-dontpreverify-verbose-allowaccessmodification-repackageclasses -dontusemixedcaseclassnames-dontoptimize -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 * extends android.app.backup.BackupAgentHelper-keep public class * extends android.preference.Preference-keep public class com.android.vending.licensing.ILicensingService -libraryjars /libs/umeng_sdk.jar -keep class com.umeng.** {*;} -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 *;} 配置好混淆,最後打包項目: