Failed to register native method org.android.spdy.SpdyAgent.freeAgent
crash 异常片段如上:
结合上下文怀疑是umeng sdk混淆的问题,但是官方最新文档给出的混淆如下:
#umeng 混淆
-keep class com.umeng.** {*;}
-keep class com.umeng.analytics.** { *; }
-keep class com.umeng.common.** { *; }
-keepclassmembers class * {
public (org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
如果你还集成了push sdk的话,这个根本不够,清楚告诉你会crash。
后面找到了老版本的混淆规则如下:
-dontwarn com.taobao.**
-dontwarn anet.channel.**
-dontwarn anetwork.channel.**
-dontwarn org.android.**
-dontwarn org.apache.thrift.**
-dontwarn com.xiaomi.**
-dontwarn com.huawei.**
-keepattributes *Annotation*
-keep class com.taobao.** {*;}
-keep class org.android.** {*;}
-keep class anet.channel.** {*;}
-keep class com.umeng.** {*;}
-keep class com.xiaomi.** {*;}
-keep class com.huawei.** {*;}
-keep class org.apache.thrift.** {*;}
-keep class com.alibaba.sdk.android.**{*;}
-keep class com.ut.**{*;}
-keep class com.ta.**{*;}
-keep public class **.R$*{
public static final int *;
}