proguard-rules.pro 6.94 KB
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


#-ignorewarnings
#-keepattributes *Annotation*
#-keepattributes Exceptions
#-keepattributes InnerClasses
#-keepattributes Signature
#-keepattributes SourceFile,LineNumberTable
#
#
##指定代码的压缩级别
#-optimizationpasses 5
#
##包明不混合大小写
#-dontusemixedcaseclassnames
#
##不去忽略非公共的库类
#-dontskipnonpubliclibraryclasses
#
# #优化  不优化输入的类文件
#-dontoptimize
#
# #预校验
#-dontpreverify
#
# #混淆时是否记录日志
#-verbose
#
# # 混淆时所采用的算法
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
#
##保护注解
#-keepattributes *Annotation*

# 保持哪些类不被混淆
-keep public class * extends android.app.Fragment
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

##记录生成的日志数据,gradle build时在本项目根目录输出##
#apk 包内所有 class 的内部结构
#-dump proguard/class_files.txt
#未混淆的类和成员
#-printseeds proguard/seeds.txt
#列出从 apk 中删除的代码
#-printusage proguard/unused.txt
#混淆前后的映射
#-printmapping proguard/mapping.txt
########记录生成的日志数据,gradle build时 在本项目根目录输出-end######


#如果引用了v4或者v7包
-dontwarn android.support.**

####混淆保护自己项目的部分代码以及引用的第三方jar包library-end####



#保持 native 方法不被混淆
-keepclasseswithmembernames class * {
    native <methods>;
}

#保持自定义控件类不被混淆
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

#保持自定义控件类不被混淆
-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

#保持 Parcelable 不被混淆
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

#保持 Serializable 不被混淆
-keepnames class * implements java.io.Serializable

#保持 Serializable 不被混淆并且enum 类也不被混淆
-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    !static !transient <fields>;
    !private <fields>;
    !private <methods>;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

#保持枚举 enum 类不被混淆
-keepclassmembers enum * {
  public static **[] values();
  public static ** valueOf(java.lang.String);
}

-keepclassmembers class * {
    public void *ButtonClicked(android.view.View);
}

#不混淆资源类
-keepclassmembers class **.R$* {
    public static <fields>;
}



-keep public class * extends android.app.Dialog

-dontwarn com.bumptech.glide.**

-dontwarn java.lang.invoke.**

-dontnote org.apache.http.**
-dontnote android.net.http.**

-dontnote android.os.**
-dontnote com.android.internal.**
-dontnote android.view.**

-dontnote com.hhmedic.android.sdk.module.gesturesview.views.**

-dontnote com.willy.ratingbar.ScaleRatingBar


-keep class com.hhmedic.android.sdk.HHDoctor {*;}
-keep class com.hhmedic.android.sdk.config.HHPushConfig {*;}
-keep class com.hhmedic.android.sdk.config.HHSDKOptions {*;}

-keep class com.hhmedic.android.sdk.module.SDKRoute {*;}



-keep class com.hhmedic.android.sdk.config.NetEnvironmental {*;}



-dontwarn com.squareup.picasso.**
-dontwarn okio.**
-dontwarn com.bumptech.glide.**
-dontnote com.netease.nimlib.**
-keep class com.hhmedic.android.sdk.module.permission.**{*;}
-keep class okhttp3.**{*;}
-keep class okio.**{*;}
-keep class com.zhy.http.**{*;}
-keep class com.alexvasilkov.**{*;}
-keep class com.hhmedic.android.sdk.core.net.volley.**{*;}
-keep class com.bumptech.glide.**{*;}
-keep class android.arch.**{*;}
-keep class com.google.gson.**{*;}

-dontnote com.bumptech.glide.**
-dontnote com.google.gson.**
-dontnote okhttp3.internal.**
-dontnote okhttp3.**
-dontnote okio.**

-keepattributes *Annotation*
-keep @**annotation** class * {*;}


-keep class com.alibaba.sdk.android.**{*;}
-dontnote com.alibaba.**
-keep class com.ut.**{*;}
-keep class com.ta.**{*;}
-dontwarn com.zhihu.matisse.**
-dontnote com.ut.**
-dontnote android.net.**
-keep class com.hhmedic.android.sdk.uikit.widget.dialog.HHTipDialog.*{*;}
-keep class com.hhmedic.android.sdk.uikit.widget.dialog.HHTipDialog$*{*;}

-keep class com.hhmedic.android.sdk.uikit.utils.HHStatusBarHelper{*;}


-keep class com.tencent.** { *; }
-keep class com.hhmedic.android.sdk.utils.HHFileProvider {*;}


-dontwarn com.netease.**
-dontwarn io.netty.**
-keep class com.netease.** {*;}
#如果 netty 使用的官方版本,它中间用到了反射,因此需要 keep。如果使用的是我们提供的版本,则不需要 keep
-keep class io.netty.** {*;}
-keep class com.netease.mobsecurity.** {*;}