android关于annotation的混淆错误
在之前的sdk版本中,不会有这个问题,从level8开始引入了注释。如果代码中有用到,而没有处理,就会出现错误的。主要是注释引起的。
proguard.cfg还是这个配置文件。
-optimizationpasses 5 -dontusemixedcaseclassnames #-dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -libraryjars D:\\libs\\commons-codec-1.4.jar -libraryjars E:\\android-sdk-windows\\platforms\\android-15\\android.jar -libraryjars E:\\android-sdk-windows\\tools\\support\\annotations.jar //这一句加不加似乎都不影响的。 -libraryjars ./libs/apache-mime4j-core-0.7.jar -libraryjars ./libs/httpmime-4.1.2.jar -libraryjars ./libs/signpost-commonshttp4-1.2.1.2.jar -libraryjars ./libs/signpost-core-1.2.1.2.jar -keep public class org.apache.james.mime4j.** { public protected *; } -keep public class org.apache.james.mime4j.codec.** { public protected *; } -keep public class org.apache.james.mime4j.io.** { public protected *; } -keep public class org.apache.james.mime4j.parser.** { public protected *; } -keep public class org.apache.james.mime4j.stream.** { public protected *; } -keep public class org.apache.james.mime4j.util.** { public protected *; } -keep public class org.apache.http.entity.mime.** { public protected *; } -keep public class org.apache.http.entity.mime.content.** { public protected *; } -keep public class oauth.signpost.commonshttp.** { public protected *; } -keep public class oauth.signpost.** { public protected *; } -keep public class oauth.signpost.basic.** { public protected *; } -keep public class oauth.signpost.exception.** { public protected *; } -keep public class oauth.signpost.http.** { public protected *; } -keep public class oauth.signpost.signature.** { public protected *; } -keep public class com.google.gdata.util.common.base.** { public protected *; } -keep public class oauth.signpost.commonshttp.** { public protected *; } 这是前面的部分,就要是一些引入的jar不混淆,目前我也没有发现好办法,只有一个包一个包的写了。 然后是: -keep public class android.** { public protected private *; } -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 -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 *; } 最后加上一句: -keepattributes *Annotation*就可以处理注释属性了。
相关推荐
shinecjj 2015-06-13
learningITwell 2011-12-30
易辰Android 2011-11-13
易辰Android 2012-04-20
RickyLee 2015-01-02
yuyu00 2019-06-29
知其然知其所以然 2012-08-10
mlsnatalie 2018-03-15
蓝天梦 2015-09-06
tdltdltdl 2015-08-14
mscn 2015-06-13
wolfoxkao 2013-10-28
NatureDay 2013-07-21
xuguolibeyondboy 2013-05-09
dingguagua 2013-03-17
GoAheadY 2012-12-19
kangtingting0 2012-08-20
huzhenv 2012-07-21
xuguolibeyondboy 2012-07-11
scott0 2012-07-07
chadeltu 2012-02-08