#Suppress warnings for proguard, for all irrelevant warnings

############################
# RunnerUp internal

# will keep line numbers and file name obfuscation
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keepattributes EnclosingMethod

# All implementations of internal interfaces do not use all methods
# org.runnerup.view.StepButton.**
# org.runnerup.widget.ClassicSpinner.**
# org.runnerup.widget.TitleSpinner.**
-keep,includedescriptorclasses class org.runnerup.**

#PlayServices related?
-dontnote com.google.protobuf.zz*
-dontnote com.google.android.gms.dynamic.IObjectWrapper

#AntPlus is optional - used by reflection
-keep,includedescriptorclasses class org.runnerup.hr.AntPlus {
  *;
}
-keepclassmembers class org.runnerup.hr.AntPlus {
    *;
}

############################
# ANTplus

-keep class com.dsi.ant.plugins.**
-keeppackagenames com.dsi.ant.**

#ref to com.garmin.fit
-dontwarn com.dsi.ant.**

############################
# GraphView

-dontnote com.jjoe64.graphview.LegendRenderer

############################
# other, unknown
-dontnote Object

############################
# Other mapbox

-keep class com.google.gson.**
-dontnote okhttp3.**
-dontnote sun.misc.Unsafe
-dontnote com.almeros.android.multitouch.gesturedetectors.*
-dontnote okio.BufferedSink

#############################
# Keep descriptor class
-keep class com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.MapboxGLSurfaceView$OnGLSurfaceViewDetachedListener

# From mapbox demo https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/proguard-rules.pro

# Retrofit 2
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**

-dontwarn okhttp3.**
-keep class retrofit.**
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
    @retrofit.http.* <methods>;
}
-dontwarn retrofit.**

# Picasso
-dontnote com.squareup.**

#-dontwarn android.support.**
-dontwarn java.lang.**
-dontwarn org.codehaus.**
-dontwarn com.google.**
-dontwarn java.nio.**


-keep class com.segment.analytics.** { *; }
-keep class com.mapbox.mapboxandroiddemo.model.usermodel.** { *; }

# MAS data models that will be serialized/deserialized over Gson
-keep class com.mapbox.services.api.directionsmatrix.v1.models.** { *; }

# --- GMS ---
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**


# Consumer proguard rules for plugins

# --- AutoValue ---
# AutoValue annotations are retained but dependency is compileOnly.
-dontwarn com.google.auto.value.**

# --- Retrofit ---
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain service method parameters.
-keepclassmembernames interface * {
    @retrofit2.http.* <methods>;
}
# Ignore annotation used for build tooling.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# --- OkHttp ---
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn okio.BufferedSink
-dontwarn javax.annotation.**
-dontwarn org.conscrypt.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

-dontwarn okhttp3.internal.platform.ConscryptPlatform

# --- Java ---
-dontwarn java.awt.Color
-dontwarn com.mapbox.api.staticmap.v1.models.StaticMarkerAnnotation
-dontwarn com.mapbox.api.staticmap.v1.models.StaticPolylineAnnotation


## Android architecture components: Lifecycle
# LifecycleObserver's empty constructor is considered to be unused by proguard
-keepclassmembers class * implements androidx.lifecycle.LifecycleObserver {
    <init>(...);
}
# ViewModel's empty constructor is considered to be unused by proguard
-keepclassmembers class * extends androidx.lifecycle.ViewModel {
    <init>(...);
}

# keep Lifecycle State and Event enums values
-keepclassmembers class androidx.lifecycle.Lifecycle$State { *; }
-keepclassmembers class androidx.lifecycle.Lifecycle$Event { *; }
# keep methods annotated with @OnLifecycleEvent even if they seem to be unused
# (Mostly for LiveData.LifecycleBoundObserver.onStateChange(), but who knows)
-keepclassmembers class * {
    @androidx.lifecycle.OnLifecycleEvent *;
}

-keepclassmembers class * implements androidx.lifecycle.LifecycleObserver {
    <init>(...);
}

-keep class * implements androidx.lifecycle.LifecycleObserver {
    <init>(...);
}
-keepclassmembers class android.arch.** { *; }
-keep class android.arch.** { *; }
-dontwarn android.arch.**


# Other Android
-dontnote android.net.http.*
-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**

-dontwarn org.xmlpull.v1.**
-dontnote org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }
-keepclassmembers class org.xmlpull.** { *; }
-keep class androidx.core.app.CoreComponentFactory { *; }