Skip to content

Instantly share code, notes, and snippets.

@hoc081098
Created October 17, 2023 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoc081098/b0953e93090319171281aeafdb40cb5b to your computer and use it in GitHub Desktop.
Save hoc081098/b0953e93090319171281aeafdb40cb5b to your computer and use it in GitHub Desktop.
proguard-rules.pro
#### Nav
-keepnames class androidx.navigation.fragment.NavHostFragment
-keepnames class * extends android.os.Parcelable
-keepnames class * extends java.io.Serializable
#### OkHttp, Retrofit and Moshi
-dontwarn okhttp3.**
-dontwarn retrofit2.Platform$Java8
-dontwarn okio.**
-dontwarn javax.annotation.**
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
-keepclasseswithmembers class * {
@com.squareup.moshi.* <methods>;
}
-keep @com.squareup.moshi.JsonQualifier interface *
-dontwarn org.jetbrains.annotations.**
-keep class kotlin.Metadata { *; }
-keepclassmembers class kotlin.Metadata {
public <methods>;
}
-keepclassmembers class * {
@com.squareup.moshi.FromJson <methods>;
@com.squareup.moshi.ToJson <methods>;
}
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-keepclassmembers @com.squareup.moshi.JsonClass @kotlin.Metadata class * {
synthetic <init>(...);
}
#### Data Models
-keepnames @kotlin.Metadata class com.example.demo.unsplash.data.remote.response.**
-keepnames @kotlin.Metadata class com.example.demo.unsplash.data.remote.response.**$*
-keep class com.example.demo.unsplash.data.remote.response.** { *; }
-keep class com.example.demo.unsplash.data.remote.response.**$* { *; }
-keepclassmembers class com.example.demo.unsplash.data.remote.response.** { *; }
-keepclassmembers class com.example.demo.unsplash.data.remote.response.**$* { *; }
#### Java 8
-keepnames @kotlin.Metadata class j$.time.**
-keepnames @kotlin.Metadata class j$.time.**$*
-keep class j$.time.** { *; }
-keep class j$.time.**$* { *; }
-keepclassmembers class j$.time.** { *; }
-keepclassmembers class j$.time.**$* { *; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment