This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
SuperSearch/entry/proguard-rules.pro

76 lines
3.0 KiB
Prolog
Raw Normal View History

# config module specific ProGuard rules here.
-dontwarn
# 代码混淆压缩比在0~7之间
-optimizationpasses 15
# 混合时不使用大小写混合,混合后的类名为小写
-dontusemixedcaseclassnames
# 在读取依赖的库文件时不要略过那些非public类成员
-dontskipnonpubliclibraryclassmembers
# 指定不去忽略非公共库的类
-dontskipnonpubliclibraryclasses
# 不做预校验preverify是proguard的四个步骤之一去掉这一步能够加快混淆速度
-dontpreverify
-verbose
# google推荐算法
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
#-dontoptimize#注意在上传时配置,本地无需配置
# 保留注解内部类泛型匿名类
-keepattributes *Annotation*,Exceptions,InnerClasses,Signature,EnclosingMethod
# 重命名抛出异常时的文件名称
-renamesourcefileattribute SourceFile
# 抛出异常时保留代码行号
-keepattributes SourceFile,LineNumberTable
-dontwarn javax.annotation.**
# 保留本地native方法不被混淆
-keepclasseswithmembernames,allowshrinking class * {
native <methods>;
}
# 保留枚举类不被混淆
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# 保留自定义类
-keep enum com.xcl.supersearch.**
-keep class com.xcl.supersearch.**{*;}
-keep class com.xcl.supersearch.**
-keepclassmembers enum com.xcl.supersearch.**{*;}
-keep interface com.xcl.supersearch.**
# 忽略继承
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# 保留HMS相关接入[AnalyticsKit SDK和依赖SDK的混淆配置]
-ignorewarnings
-repackageclasses
-keep class com.huawei.agconnect.**{*;}
-keep class com.huawei.hms.analytics.**{*;}
-keep class com.huawei.hms.push.**{*;}
-keep class com.huawei.hms.**{*;}
# HMS接口服务
-keepattributes Exceptions
-keep interface com.huawei.hms.analytics.type.HAEventType{*;}
-keep interface com.huawei.hms.analytics.type.HAParamType{*;}
-keep class com.huawei.hms.analytics.HiAnalyticsInstance{*;}
-keep class com.huawei.hms.analytics.HiAnalytics{*;}
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.harmony.**{*;}
-keep class com.huawei.mylibrary.**{*;}
# 保留HarmonyOS应用/服务入口类
-keep public class * extends *.aafwk.ability.Ability
-keep public class * extends *.ace.ability.AceAbility
-keep public class * extends *.aafwk.ability.AbilitySlice
-keep public class * extends *.aafwk.ability.AbilityPackage
-dontwarn java.lang.invoke.**
-dontwarn javax.naming.**
-dontwarn ohos.utils.PacMap.**
-keep class **.ResourceTable$* {*;}
-keepattributes Signature, InnerClasses, EnclosingMethod, Exceptions
# 保留配置文件
-printmapping mapping.txt