# Copied most part from standard 'proguard-android.txt', but removed part, related with optimization. Library should not make a decision about turning optimization on or off.

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
    native <methods>;
}

# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
   void set*(***);
   *** get*();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

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

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version.  We know about them, and they are safe.
# -dontwarn android.support.**

# Understand the @Keep support annotation.
-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>(...);
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/finik/work/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}

## Settings, recommended for libraries:
-keepparameternames
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, LineNumberTable, *Annotation*, EnclosingMethod

# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames, includedescriptorclasses class * {
    native <methods>;
}

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

-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();
}
## End of settings, recommended for libraries

## Custom Bugsee library settings
-keep class okhttp3copy.** { *; }
-keep class okiocopy.** { *; }
-keep class retrofit2copy.** { *; }
-keep class squareup.seismiccopy.** { *; }
-keep class com.google.gsoncopy.** { *; }
-keep class com.mp4parsercopy.** { *; }
-keep class com.googlecode.mp4parsercopy.** { *; }
-keep class com.coremedia.isocopy.** { *; }
-keep class com.scottyab.rootbeercopy.** { *; }

## Settings for okhttp3copy
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3copy.internal.platform.ConscryptPlatform
-dontwarn org.conscrypt.Conscrypt$ProviderBuilder
-dontwarn org.conscrypt.Conscrypt
## End of settings for okhttp3copy.

## Settings for retrofit2copy
-dontwarn kotlinx.coroutines.CancellableContinuation
-dontwarn kotlinx.coroutines.CancellableContinuationImpl
-dontwarn kotlinx.coroutines.CoroutineDispatcher
-dontwarn kotlinx.coroutines.Dispatchers
## End of settings for retrofit2copy.

# Prevent Bugsee obfuscation during app build, because Bugsee was obfuscated during it's self build.
-keep class !com.bugsee.library.obfuscation.TestClass,!com.bugsee.library.obfuscation.UnusedClass,com.bugsee.library.** { *; }

# Keep all public members in contracts package and nested packages from being mangled
-keep class com.bugsee.library.contracts.** {
    public *;
}
-keep interface com.bugsee.library.contracts.** {
    public *;
}
-keep enum com.bugsee.library.contracts.** {
    public *;
}

# Keep methods, which can be called from JS
-keepclassmembers class * {
    @android.webkit.JavascriptInterface public <methods>;
}

# If client app compileSdkVersion <= 23 , compiler can't find some classes and methods, used in Bugsee library. It is ok, because we check API version in runtime, but proguard generates
# warnings like the following:
# Warning: com.bugsee.library.events.ActivityLifecycleHandler: can't find referenced method 'boolean isInMultiWindowMode()' in library class android.app.Activity
# That's why we need to add -dontwarn commands for new classes and classes, which have new methods in Android API ( > 23).
-dontwarn android.app.Activity
-dontwarn android.os.DeadSystemException
-dontwarn android.webkit.WebViewClient
-dontwarn android.webkit.WebResourceRequest
-dontwarn android.webkit.WebResourceError
-dontwarn android.os.LocaleList
-dontwarn java.util.Locale
-dontwarn java.util.Locale$Category
-dontwarn android.view.View
-dontwarn android.view.View$OnScrollChangeListener
-dontwarn android.view.DisplayListCanvas
-dontwarn android.view.RenderNode
-dontwarn android.view.ThreadedRenderer
-dontwarn android.content.Context
-dontwarn com.bugsee.library.screencapture.ScreenCaptureRequestPermissionsActivity
-dontwarn android.app.NotificationChannel
-dontwarn android.app.NotificationManager
-dontwarn android.app.Notification$Builder
## End of custom Bugsee library settings

## Settings for okhttp, okhttp3
-keep class com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
-keep class okhttp3.** {*; }
-dontwarn okhttp3.**
## End of settings for okhttp, okhttp3


## Settings for retrofit
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
#-keepattributes Signature
#-keepattributes Exceptions

#-keepattributes *Annotation*
## End of settings for retrofit.

-dontwarn okio.**

# Ktor
-dontwarn io.ktor.**

# Picasso
-dontwarn com.squareup.picasso.**

# AndroidX
-dontwarn com.google.android.material.**