okhttputils开源库的混淆配置(Eclipse)

#=====================okhttputils框架=====================
#====okhttputils====
-libraryjars libs/okhttputils.jar
-dontwarn com.zhy.http.**
-keep class com.zhy.http.**{*;}
-keep interface com.zhy.http.**{*;}

#====okhttp====
-libraryjars libs/okhttp-2.7.0.jar
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
-keep interface okhttp3.**{*;}

-keepattributes Signature
-keepattributes *Annotation*
-dontwarn com.squareup.okhttp.**
-keep class com.squareup.okhttp.**{*;}
-keep interface com.squareup.okhttp.**{*;}

#====okio====
-libraryjars libs/okio-1.6.0.jar
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
-keep class okio.**{*;}
-keep interface okio.**{*;}

#====gson====
-libraryjars libs/gson-2.2.1.jar
-keep class sun.misc.Unsafe{*;}
-dontwarn com.google.gson.**
-keep class com.google.gson.**{*;} 
-keep class com.google.gson.stream.**{*;}
-keep class com.google.gson.examples.android.model.**{*;}

在proguard-project.txt中添加以上代码。

参考资料:

https://github.com/hongyangAndroid/okhttp-utils

https://github.com/pengjianbo/OkHttpFinal

关于使用了OkHttp和Android-PullToRefresh开源库后如何混淆:

http://www.codes51.com/article/detail_124186.html

Android之混淆心得与亲身体验

http://www.cnblogs.com/lee0oo0/archive/2013/12/04/3457877.html

[置顶] Android 混淆代码总结

http://blog.csdn.net/lovexjyong/article/details/24652085

android 代码混淆示例

http://www.cnblogs.com/lesliefang/p/3819259.html

原文地址:https://www.cnblogs.com/whycxb/p/5482396.html