跳到主要内容

混淆

混淆脚本

融云 SDK 相关混淆脚本参考如下配置:

-keepattributes Exceptions,InnerClasses

-keepattributes Signature

-keep class io.rong.** {*;}
-keep class cn.rongcloud.** {*;}
-keep class * implements io.rong.imlib.model.MessageContent {*;}
-dontwarn io.rong.push.**
-dontnote com.xiaomi.**
-dontnote com.google.android.gms.gcm.**
-dontnote io.rong.**

# 下方混淆使用了融云 IMKit 提供的 locationKit 位置插件时才需要配置,可参考高德官网的混淆方式:https://lbs.amap.com/api/android-sdk/guide/create-project/dev-attention
-keep class com.amap.api.maps.**{*;}
-keep class com.autonavi.**{*;}
-keep class com.amap.api.trace.**{*;}
-keep class com.amap.api.location.**{*;}
-keep class com.amap.api.fence.**{*;}
-keep class com.loc.**{*;}
-keep class com.autonavi.aps.amapapi.model.**{*;}
-keep class com.amap.api.services.**{*;}

-ignorewarnings

当代码中有继承 PushMessageReceiver 的子类时,需 keep 所创建的子类广播。

示例:

-keep class io.rong.app.DemoNotificationReceiver {*;} 

io.rong.app.DemoNotificationReceiver 改成子类广播的完整类路径即可.