android okhttp3 3.10.0 开启混淆报错

网上添加的混淆过滤规则试了好多中都不能用,后来升级okhttp的版本至

implementation 'com.squareup.okhttp3:okhttp:3.14.0'

混淆规则:

#-------------- okhttp3 start-------------
# OkHttp3
# https://github.com/square/okhttp
# okhttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.* { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**

# okhttp 3
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# Okio
-dontwarn com.squareup.**
-dontwarn okio.**
-keep public class org.codehaus.* { *; }
-keep public class java.nio.* { *; }
#----------okhttp end--------------

猜你喜欢

转载自blog.csdn.net/qq_35017727/article/details/88973040