# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ~/Library/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 *;
#}

# Keep Google Mobile Ads Unity plugin classes.
-keep class com.google.unity.ads.** {
   *;
}

# Keep User Messaging Platform Unity plugin classes.
-keep class com.google.unity.ump.** {
   *;
}

# Keep Google Mobile Ads Native Ad Unity plugin classes.
-keep class com.google.unity.ads.nativead.** {
   *;
}

# Keep Google Mobile Ads classes.
-keep public class com.google.android.gms.ads.** {
   public *;
}

# Keep Google Mobile Ads Beta classes.
-keep public class com.google.android.libraries.ads.mobile.sdk.** {
   public *;
}

# Keep User Messaging Platform classes.
-keep public class com.google.android.ump.** {
   public *;
}

# Workaround for AppReduce VerifyError horizontal class merging bug (prevents
# stripping of Throwable inheritance from Exception classes during class
# merging). Omitting 'allowoptimization' disables horizontal class merging in
# R8/AppReduce while preserving shrinking and obfuscation. See b/547999771.
-keep,allowshrinking,allowobfuscation class * extends java.lang.Throwable {
    <fields>;
    <methods>;
}

# Direct name matching serves as a fail-safe if superclass hierarchy resolution
# fails during AppReduce repackaging, and '{ *; }' keeps static factory methods.
-keep,allowshrinking,allowobfuscation class com.google.protobuf.**Exception { *; }
-keep,allowshrinking,allowobfuscation class androidx.datastore.**Exception { *; }

