我在我的项目中使用改造2和使用proguard.
我的节目:
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
# Begin twitter 4j.
-dontwarn twitter4j.**
-keep class twitter4j.conf.PropertyConfigurationFactory
-keep class twitter4j.** { *; }
# End twitter 4j.
# Start androidsocialnetworks
-keep class com.androidsocialnetworks.lib.** { *; }
# End androidsocialnetworks.
# Google api
-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {
*; …Run Code Online (Sandbox Code Playgroud) 我正在使用Proguard我的项目和下面的代码在我的proguard-rules.pro:
# Retrofit
-keep class com.google.gson.** { *; }
-keep class com.google.inject.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.apache.james.mime4j.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.xml.stream.** { *; }
-keep class retrofit.** { *; }
-keep class com.google.appengine.** { *; }
-keepattributes *Annotation*
-keepattributes Signature
-dontwarn com.squareup.okhttp.*
-dontwarn rx.**
-dontwarn javax.xml.stream.**
-dontwarn com.google.appengine.**
-dontwarn java.nio.file.**
-dontwarn org.codehaus.**
-dontwarn retrofit2.**
-dontwarn org.codehaus.mojo.**
-keep class retrofit2.** { *; …Run Code Online (Sandbox Code Playgroud)