# 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

-obfuscationdictionary s-proguard.txt
-classobfuscationdictionary s-proguard.txt
-packageobfuscationdictionary s-proguard.txt
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-optimizationpasses 5
-dontskipnonpubliclibraryclassmembers
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-ignorewarnings

-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes *Annotation*
-keepattributes JavascriptInterface
-keepattributes Signature
-keepattributes RuntimeVisibleAnnotations
-keepattributes SourceFile
-keepattributes LineNumberTable

#native
-keepclasseswithmembers class * {
    native <methods>;
}

#context
-keepclassmembers class * extends android.content.Context {
   public void *(android.view.View);
   public void *(android.view.MenuItem);
}

#Parcelable
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator CREATOR;
}

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
    <fields>;
    <methods>;
}

#Serializable
-keep class * implements java.io.Serializable {
    *;
}

-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    !static !transient <fields>;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

-keepclassmembers class * {
    public <init>(org.json.JSONObject);
}

#View相关
-keepclassmembers public class * extends android.view.View {
   void set*(***);
   *** get*();
}

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

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

#Enum
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
    public static ** valueOf(int);
}

#Resource
-keepclassmembers class **.R$* {
    public static <fields>;
}

-keep class **.R$* {*;}
-keep class **.R{*;}
-dontwarn **.R$*

#keep
-keep class androidx.annotation.Keep

-keep @androidx.annotation.Keep class * {*;}

-keepclasseswithmembers class * {
    @androidx.annotation.Keep <methods>;
}

-keepclasseswithmembers class * {
    @androidx.annotation.Keep <fields>;
}

-keepclasseswithmembers class * {
    @androidx.annotation.Keep <init>(...);
}

#android component
-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.preference.Preference
-keep public class * extends android.app.backup.BackupAgentHelper

#LOG
#xlog
-keep class com.tencent.mars.xlog.** {*;}

-assumenosideeffects class android.util.Log {
    public static *** println(...);
    public static *** wtf(...);
}

-assumenosideeffects class * extends java.lang.Throwable {
    public void printStackTrace();
}

#Rxjava@1.1.9
-dontwarn sun.misc.**
-dontwarn rx.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
   long producerIndex;
   long consumerIndex;
}

-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
    rx.internal.util.atomic.LinkedQueueNode producerNode;
}

-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
    rx.internal.util.atomic.LinkedQueueNode consumerNode;
}

#supportV4
-keep public class android.support.v4.content.LocalBroadcastManager{*;}
-dontwarn android.support.v4.**
-keep public class * extends android.support.v4.app.** { *; }
-keep public class * extends android.app.Fragment{ *; }
-keep public class * extends androidx.fragment.app.Fragment { *; }
-keep public class android.support.v4.app.**{ *; }
-keep public class android.support.v4.media.**{ *; }
-keep class androidx.annotation.** { *; }
-dontwarn androidx.annotation.**

#okhttp
-dontwarn okhttp3.**
-dontwarn okio.**
-dontnote retrofit2.Platform

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
-keep class com.google.gson.examples.android.model.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}

#gms
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

#webkit
-keepclassmembers class * extends android.webkit.WebChromeClient {
    public void openFileChooser(...);
    public void onShowFileChooser(...);
}

-keepclassmembers class * {
    @android.webkit.JavascriptInterface <methods>;
}

#来电浮窗代码
-keep interface com.android.internal.telephony.ITelephony {* ;}

#google installreferrer
-dontwarn com.appsflyer.**
-dontwarn com.android.installreferrer
-keep class com.appsflyer.** { *;}

#AppFlyer
-keep class com.appsflyer.** { *; }
-keep class kotlin.jvm.internal.** { *; }

# thinR
-keepclassmembers class **.R$* {
	 public static <fields>;
}
-keep class **.R {*;}
-keep class **.R$* {*;}
-keep class **.R$*
-keep class **.R

-keepclassmembers class **.R2$* {
	 public static <fields>;
}
-keep class **.R2 {*;}
-keep class **.R2$* {*;}
-keep class **.R2$*
-keep class **.R2

-dontpreverify

-keepclassmembers class * {
    void *(**On*Event);
}

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod

#router
-keep public class * implements com.adealink.frame.router.IBinder
-keep public class * implements com.adealink.frame.router.IInterceptor
-keep public class * extends com.adealink.frame.router.handler.UriHandler
-keep interface com.adealink.frame.router.IRouterInit
-keep class * implements com.adealink.frame.router.IRouterInit

#spi
-keep class * implements com.adealink.frame.aab.IService

# com.opensource.svgaplayer
-keep class com.squareup.wire.** {*;}
-keep class com.opensource.svgaplayer.proto.* {*;}

#fresco
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep,allowobfuscation @interface com.facebook.soloader.DoNotOptimize
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.common.internal.DoNotStrip *;
}
-keep @com.facebook.soloader.DoNotOptimize class *
-keepclassmembers class * {
    @com.facebook.soloader.DoNotOptimize *;
}
-keepclassmembers class com.facebook.** {
    native <methods>;
}
-keep public class com.facebook.soloader.SoLoader {
    public static void init(android.content.Context, int);
}
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn okhttp3.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**
-dontwarn com.facebook.infer.**

#aliyun oss
-keep class com.alibaba.sdk.android.oss.** { *; }
-dontwarn okio.**
-dontwarn org.apache.commons.codec.binary.**

#refrofit
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keepclassmembers,allowshrinking,allowobfuscation interface * {
    @retrofit2.http.* <methods>;
}
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn kotlin.Unit
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

#websocket
-if interface * {
    @com.adealink.frame.network.socket.annotation.* <methods>;
}
-keep,allowobfuscation interface <1>
-keepclassmembers,allowshrinking,allowobfuscation interface * {
    @com.adealink.frame.network.socket.annotation.* <methods>;
}
-keep class com.adealink.frame.network.socket.annotation.* { *; }

#agora
-keep class io.agora.**{*;}

#error
-keep public class * extends com.adealink.frame.base.IError { *; }

#java mail
-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}

#qttaudio
-keep class com.qttaudio.**{*;}

#trtc
-keep class com.tencent.** { *; }

#apm
-keepclassmembers public class * extends com.adealink.frame.apm.core.base.MonitorEvent {
   <fields>;
}

#fcm
-keep public class com.google.firebase.messaging.FirebaseMessagingService {
    public *;
}

#cocos
# Proguard Cocos2d-x-lite for release
-keep public class com.cocos.** { *; }
-dontwarn com.cocos.**
-keep public class com.google.** { *; }
-keep class com.adealink.frame.game.GameNativeBridge { *; }

# Banner
-dontwarn androidx.viewpager2.**
-keep class androidx.viewpager2.** {*;}
-dontwarn androidx.recyclerview.widget.RecyclerView
-keep class androidx.recyclerview.widget.RecyclerView{*;}
-dontwarn com.youth.banner.**
-keep class com.youth.banner.** {*;}

#rong cloud
-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.**

-ignorewarnings

#tceffect
-keep class com.tcmediax.** { *; }
-keep class com.tencent.** { *; }
-keep class com.tencent.xmagic.** { *; }
# 腾讯礼物动画特效SDK会通过 exifinterface 解析动效资源元数据，如果项目中引入了exifinterface， 必须加入下面的混淆配置
-keep class androidx.exifinterface.** {*;}