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

#-repackageclasses com.wibmo.addons

#Keep class name but allow method obfuscation
-keeppackagenames com.wibmo.tridentity.sdk.**

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keep class com.wibmo.tridentity.sdk.di.TokenValidation { *; }
-keep class com.wibmo.tridentity.sdk.TridentitySDK { *; }
-keep class com.wibmo.tridentity.sdk.di.ValidateTokenCallback{ *; }
-keep class com.wibmo.tridentity.sdk.SingletonHolder { *; }


-keep class com.wibmo.tridentity.sdk.BaseTridentSDK {
    public static **$* *;
}
# Keep all companion objects in the package com.wibmo.tridentity_headless
-keep class com.wibmo.tridentity.sdk.**$Companion {
    *;
}
# Keep the companion object of the HeadlessTridentitySDK class
-keep class com.wibmo.tridentity.sdk.BaseTridentSDK$Companion {
    *;
}
-keep public class com.wibmo.tridentity_headless.SingletonHolder {
    public <fields>;
    public <methods>;
}

-keep public class com.wibmo.tridentity.sdk.theme.ThemeConfig {*;}
-keep public class com.wibmo.tridentity.sdk.theme.UICustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.TextCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.LabelCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.HeadingContentCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.SubContentCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.ButtonCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.PrimaryButtonCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.SecondaryButtonCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.ToolbarCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.TextCustomization {*;}
-keep public class com.wibmo.tridentity.sdk.theme.ConsentScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.TncScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.BottomSheetPermissionPopupConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.SimBindingScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.BottomSheetSimBindingProcessingPopupConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.BottomSheetRegistrationSuccessfulPopupConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.BottomSheetFailureScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.TransactionHistoryScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.OfflineOTPScreenConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.BottomSheetAuthenticationPopupConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.DeRegPopupConfiguration {*;}
-keep public class com.wibmo.tridentity.sdk.theme.SubHeadingCustomization {*;}

# Keep Analytics classes from tridentity_headless
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys$*{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues$*{*;}
-keep public enum com.wibmo.tridentity_headless.util.EventType{*;}
-keep public enum com.wibmo.tridentity_headless.util.Severity{*;}
-keep public enum com.wibmo.tridentity_headless.util.Status{*;}

# Keep `Companion` object fields of serializable classes.
# This is also needed for R8 in compat mode since multiple
# optimizations will remove the generic signature such as class
# merging and argument removal. See:
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson

# Optional. For using GSON @Expose annotation
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


-dontwarn com.payu.payuanalytics.analytics.factory.AnalyticsFactory
-dontwarn com.payu.payuanalytics.analytics.model.AnalyticsConfig
-dontwarn com.payu.payuanalytics.analytics.model.AnalyticsType
-dontwarn com.payu.payuanalytics.analytics.model.BaseAnalytics
-dontwarn com.payu.payuanalytics.analytics.model.PayUAnalytics

# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class kotlin.coroutines.Continuation

-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-dontwarn kotlinx.serialization.Serializable

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}

##---------------End: proguard configuration for Gson  ----------

# Keep the Gson classes and methods
#-keep class com.google.gson.** { *; }
# Keep all classes, fields, and methods (including static methods) in the Gson package
#-keep class com.google.gson.** {
#    public static *;
#}
# Keep all custom TypeAdapters that might include static methods
#-keep class * extends com.google.gson.TypeAdapter {
 #   public static *;
#}


-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking interface retrofit2.Call



# Keep TypeToken and its subclasses
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken


# 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
# 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


#-repackageclasses com.wibmo.tridentity_headless.addons

#Keep class name but allow method obfuscation
-keeppackagenames com.wibmo.**

-keep class com.wibmo.tridentity_headless.HeadlessTridentitySDK {
    public static **$* *;
}
# Keep all companion objects in the package com.wibmo.tridentity_headless
-keep class com.wibmo.tridentity_headless.**$Companion {
    *;
}
# Keep the companion object of the HeadlessTridentitySDK class
-keep class com.wibmo.tridentity_headless.HeadlessTridentitySDK$Companion {
    *;
}
-keep public class com.wibmo.tridentity_headless.SingletonHolder {
    public <fields>;
    public <methods>;
}
-keep public class com.wibmo.tridentity_headless.di.** { public protected *;}
-keep public class com.wibmo.tridentity_headless.SingletonHolder.*
-keep public class com.wibmo.tridentity_headless.HeadlessTridentitySDK{public protected *; }
-keep public class com.wibmo.tridentity_headless.util.PrefsUtil { public protected *; }
-keep public class com.wibmo.tridentity_headless.util.IPreferenceHelper { public protected *; }
-keep public class com.wibmo.tridentity_headless.util.LoggingUtils.** { *; }
-keep public class com.wibmo.tridentity_headless.util.SecureConfigHeadlessKt { public protected *; }

-keep public class com.wibmo.tridentity_headless.TransactionRepository { public protected *; }
-keep public class com.wibmo.tridentity_headless.TridentityRepository { public protected *; }
-keep public class com.wibmo.tridentity_headless.SdkRepository { public protected *; }
# Keep classes with @Keep annotation
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * { *; }

#model classes for PayU flavour
-keep public class com.wibmo.tridentity_headless.model.Config {*;}
-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
-keep public class com.wibmo.tridentity_headless.model.Access {*;}
-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.Customer{*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerData{*;}
-keep public class com.wibmo.tridentity_headless.model.Bank{*;}
-keep public class com.wibmo.tridentity_headless.model.BankDeregStatus{*;}
-keep public class com.wibmo.tridentity_headless.model.Card{*;}
-keep public class com.wibmo.tridentity_headless.util.CustomerPreferenceManager
-keep public class com.wibmo.tridentity_headless.util.ConstantsKt{*;}

# Keep Analytics Constants and Enums
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys$*{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues$*{*;}
-keep public enum com.wibmo.tridentity_headless.util.EventType{*;}
-keep public enum com.wibmo.tridentity_headless.util.Severity{*;}
-keep public enum com.wibmo.tridentity_headless.util.Status{*;}

# enable this commented block is for payU data classes





-dontwarn com.wibmo.tridentity_headless.model.Consent
-dontwarn com.wibmo.tridentity_headless.model.ConsentData
-dontwarn com.wibmo.tridentity_headless.model.ConsentDetails
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibility
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam
-dontwarn com.wibmo.tridentity_headless.model.Feature
-dontwarn com.wibmo.tridentity_headless.model.Features
-dontwarn com.wibmo.tridentity_headless.model.FeaturesSubParam
-dontwarn com.wibmo.tridentity_headless.model.Notifications
-dontwarn com.wibmo.tridentity_headless.model.SubParamTransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TncData
-dontwarn com.wibmo.tridentity_headless.model.TransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TransactionStatus
-dontwarn com.wibmo.tridentity_headless.model.Transactions
-dontwarn com.wibmo.tridentity_headless.model.RootedPackageInfo
# end of model classes for PayU flavour



#-keep public class com.wibmo.tridentity_headless.model.** { *; } //todo check if this can be used instead of below -  @Vinod

#Add all the below data class varialbles for other flavours
#-keep public class com.wibmo.tridentity_headless.model.* {*;}
#
#-keep public class com.wibmo.tridentity_headless.model.Config {*;}
#-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
#-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
#-keep public class com.wibmo.tridentity_headless.model.Access {*;}
#-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
#-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibility {*;}
#-keep public class com.wibmo.tridentity_headless.model.Consent {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentData {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentDetails {*;}
#-keep public class com.wibmo.tridentity_headless.model.TncData {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilityRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParamTransactionHistory {*;}
#-keep public class com.wibmo.tridentity_headless.model.GetTxnHistoryRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.TransactionHistory {*;}
#-keep public class com.wibmo.tridentity_headless.model.Transactions {*;}
#-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.UpdateStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.Notifications {*;}
#-keep public class com.wibmo.tridentity_headless.model.GetFeaturesRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.Feature {*;}
#-keep public class com.wibmo.tridentity_headless.model.Features {*;}
#-keep public class com.wibmo.tridentity_headless.model.FeaturesSubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.RootedPackageInfo {*;}
##
#-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
##
#-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
#-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
# enable this commented block is for payU data classes





-dontwarn com.wibmo.tridentity_headless.model.Consent
-dontwarn com.wibmo.tridentity_headless.model.ConsentData
-dontwarn com.wibmo.tridentity_headless.model.ConsentDetails
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibility
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam
-dontwarn com.wibmo.tridentity_headless.model.Feature
-dontwarn com.wibmo.tridentity_headless.model.Features
-dontwarn com.wibmo.tridentity_headless.model.FeaturesSubParam
-dontwarn com.wibmo.tridentity_headless.model.Notifications
-dontwarn com.wibmo.tridentity_headless.model.SubParamTransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TncData
-dontwarn com.wibmo.tridentity_headless.model.TransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TransactionStatus
-dontwarn com.wibmo.tridentity_headless.model.Transactions
-dontwarn com.wibmo.tridentity_headless.model.RootedPackageInfo
# end of model classes for PayU flavour



#-keep public class com.wibmo.tridentity_headless.model.** { *; } //todo check if this can be used instead of below -  @Vinod

#Add all the below data class varialbles for other flavours
-keep public class com.wibmo.tridentity_headless.model.* {*;}

-keep public class com.wibmo.tridentity_headless.model.Config {*;}
-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
-keep public class com.wibmo.tridentity_headless.model.Access {*;}
-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibility {*;}
-keep public class com.wibmo.tridentity_headless.model.Consent {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentData {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentDetails {*;}
-keep public class com.wibmo.tridentity_headless.model.TncData {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilityRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParamTransactionHistory {*;}
-keep public class com.wibmo.tridentity_headless.model.GetTxnHistoryRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionHistory {*;}
-keep public class com.wibmo.tridentity_headless.model.Transactions {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.Notifications {*;}
-keep public class com.wibmo.tridentity_headless.model.GetFeaturesRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.Feature {*;}
-keep public class com.wibmo.tridentity_headless.model.Features {*;}
-keep public class com.wibmo.tridentity_headless.model.FeaturesSubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.RootedPackageInfo {*;}
#
-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
#
-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
#
##for SIB enable these as well along with above
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenResponseObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenDataObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenErrorObject{*;}
#

# Keep all DefaultLifecycleObserver methods
-keep public class androidx.lifecycle.DefaultLifecycleObserver {
    public *;
}

# This is also needed for R8 in compat mode since multiple
# optimizations will remove the generic signature such as class
# merging and argument removal. See:
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson

# Optional. For using GSON @Expose annotation
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class kotlin.coroutines.Continuation

-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;

}

-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

#Keep BouncyCastle classe
-keep class com.nimbusds.jose.JOSEException**
-keep class com.nimbusds.jose.jwk.Curve**
-keep class com.nimbusds.jose.jwk.ECKey**

-keep class org.bouncycastle.jce.provider.asymmetric.ec.KeyPairGenerator**
-keep class org.bouncycastle.jce.provider.asymmetric.EC**





# 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
# 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


#-repackageclasses com.wibmo.tridentity_headless.addons

#Keep class name but allow method obfuscation
-keeppackagenames com.wibmo.**

-keep class com.wibmo.tridentity_headless.HeadlessTridentitySDK {
    public static **$* *;
}
# Keep all companion objects in the package com.wibmo.tridentity_headless
-keep class com.wibmo.tridentity_headless.**$Companion {
    *;
}
# Keep the companion object of the HeadlessTridentitySDK class
-keep class com.wibmo.tridentity_headless.HeadlessTridentitySDK$Companion {
    *;
}
-keep public class com.wibmo.tridentity_headless.SingletonHolder {
    public <fields>;
    public <methods>;
}
-keep public class com.wibmo.tridentity_headless.di.** { public protected *;}
-keep public class com.wibmo.tridentity_headless.SingletonHolder.*
-keep public class com.wibmo.tridentity_headless.HeadlessTridentitySDK{public protected *; }
-keep public class com.wibmo.tridentity_headless.util.PrefsUtil { public protected *; }
-keep public class com.wibmo.tridentity_headless.util.IPreferenceHelper { public protected *; }
-keep public class com.wibmo.tridentity_headless.util.LoggingUtils.** { *; }
-keep public class com.wibmo.tridentity_headless.util.SecureConfigHeadlessKt { public protected *; }

-keep public class com.wibmo.tridentity_headless.TransactionRepository { public protected *; }
-keep public class com.wibmo.tridentity_headless.TridentityRepository { public protected *; }
-keep public class com.wibmo.tridentity_headless.SdkRepository { public protected *; }
# Keep classes with @Keep annotation
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * { *; }

#model classes for PayU flavour
-keep public class com.wibmo.tridentity_headless.model.Config {*;}
-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
-keep public class com.wibmo.tridentity_headless.model.Access {*;}
-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.Customer{*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerData{*;}
-keep public class com.wibmo.tridentity_headless.model.Bank{*;}
-keep public class com.wibmo.tridentity_headless.model.BankDeregStatus{*;}
-keep public class com.wibmo.tridentity_headless.model.Card{*;}
-keep public class com.wibmo.tridentity_headless.util.CustomerPreferenceManager
-keep public class com.wibmo.tridentity_headless.util.ConstantsKt{*;}

# Keep Analytics Constants and Enums
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsKeys$*{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues{*;}
-keep public class com.wibmo.tridentity_headless.util.AnalyticsConstantsValues$*{*;}
-keep public enum com.wibmo.tridentity_headless.util.EventType{*;}
-keep public enum com.wibmo.tridentity_headless.util.Severity{*;}
-keep public enum com.wibmo.tridentity_headless.util.Status{*;}

# enable this commented block is for payU data classes





-dontwarn com.wibmo.tridentity_headless.model.Consent
-dontwarn com.wibmo.tridentity_headless.model.ConsentData
-dontwarn com.wibmo.tridentity_headless.model.ConsentDetails
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibility
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam
-dontwarn com.wibmo.tridentity_headless.model.Feature
-dontwarn com.wibmo.tridentity_headless.model.Features
-dontwarn com.wibmo.tridentity_headless.model.FeaturesSubParam
-dontwarn com.wibmo.tridentity_headless.model.Notifications
-dontwarn com.wibmo.tridentity_headless.model.SubParamTransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TncData
-dontwarn com.wibmo.tridentity_headless.model.TransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TransactionStatus
-dontwarn com.wibmo.tridentity_headless.model.Transactions
-dontwarn com.wibmo.tridentity_headless.model.RootedPackageInfo
# end of model classes for PayU flavour



#-keep public class com.wibmo.tridentity_headless.model.** { *; } //todo check if this can be used instead of below -  @Vinod

#Add all the below data class varialbles for other flavours
#-keep public class com.wibmo.tridentity_headless.model.* {*;}
#
#-keep public class com.wibmo.tridentity_headless.model.Config {*;}
#-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
#-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
#-keep public class com.wibmo.tridentity_headless.model.Access {*;}
#-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
#-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
#-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibility {*;}
#-keep public class com.wibmo.tridentity_headless.model.Consent {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentData {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentDetails {*;}
#-keep public class com.wibmo.tridentity_headless.model.TncData {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilityRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParamTransactionHistory {*;}
#-keep public class com.wibmo.tridentity_headless.model.GetTxnHistoryRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.TransactionHistory {*;}
#-keep public class com.wibmo.tridentity_headless.model.Transactions {*;}
#-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.UpdateStatus {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.Notifications {*;}
#-keep public class com.wibmo.tridentity_headless.model.GetFeaturesRequest {*;}
#-keep public class com.wibmo.tridentity_headless.model.Feature {*;}
#-keep public class com.wibmo.tridentity_headless.model.Features {*;}
#-keep public class com.wibmo.tridentity_headless.model.FeaturesSubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.RootedPackageInfo {*;}
##
#-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
##
#-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
#-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
#-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
#-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
#-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
# enable this commented block is for payU data classes





-dontwarn com.wibmo.tridentity_headless.model.Consent
-dontwarn com.wibmo.tridentity_headless.model.ConsentData
-dontwarn com.wibmo.tridentity_headless.model.ConsentDetails
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibility
-dontwarn com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam
-dontwarn com.wibmo.tridentity_headless.model.Feature
-dontwarn com.wibmo.tridentity_headless.model.Features
-dontwarn com.wibmo.tridentity_headless.model.FeaturesSubParam
-dontwarn com.wibmo.tridentity_headless.model.Notifications
-dontwarn com.wibmo.tridentity_headless.model.SubParamTransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TncData
-dontwarn com.wibmo.tridentity_headless.model.TransactionHistory
-dontwarn com.wibmo.tridentity_headless.model.TransactionStatus
-dontwarn com.wibmo.tridentity_headless.model.Transactions
-dontwarn com.wibmo.tridentity_headless.model.RootedPackageInfo
# end of model classes for PayU flavour



#-keep public class com.wibmo.tridentity_headless.model.** { *; } //todo check if this can be used instead of below -  @Vinod

#Add all the below data class varialbles for other flavours
-keep public class com.wibmo.tridentity_headless.model.* {*;}

-keep public class com.wibmo.tridentity_headless.model.Config {*;}
-keep public class com.wibmo.tridentity_headless.model.CallbackResponse {*;}
-keep public class com.wibmo.tridentity_headless.model.CallBackData {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceRegistration {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceIDInfo {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenRequestObject {*;}
-keep public class com.wibmo.tridentity_headless.model.TokenResObject {*;}
-keep public class com.wibmo.tridentity_headless.model.SIMCard {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectDevice {*;}
-keep public class com.wibmo.tridentity_headless.model.Access {*;}
-keep public class com.wibmo.tridentity_headless.model.Siminfo {*;}
-keep public class com.wibmo.tridentity_headless.model.LatLong {*;}
-keep public class com.wibmo.tridentity_headless.model.CheckRegistrationRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.DeviceStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.CustomerObject {*;}
-keep public class com.wibmo.tridentity_headless.model.DeregisterDeviceRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibility {*;}
-keep public class com.wibmo.tridentity_headless.model.Consent {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentData {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentDetails {*;}
-keep public class com.wibmo.tridentity_headless.model.TncData {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilityRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.ConsentEligibilitysubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParamTransactionHistory {*;}
-keep public class com.wibmo.tridentity_headless.model.GetTxnHistoryRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionHistory {*;}
-keep public class com.wibmo.tridentity_headless.model.Transactions {*;}
-keep public class com.wibmo.tridentity_headless.model.TransactionStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateStatus {*;}
-keep public class com.wibmo.tridentity_headless.model.SubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.UpdateTxnStatusRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.Notifications {*;}
-keep public class com.wibmo.tridentity_headless.model.GetFeaturesRequest {*;}
-keep public class com.wibmo.tridentity_headless.model.Feature {*;}
-keep public class com.wibmo.tridentity_headless.model.Features {*;}
-keep public class com.wibmo.tridentity_headless.model.FeaturesSubParam {*;}
-keep public class com.wibmo.tridentity_headless.model.RootedPackageInfo {*;}
#
-keep public class com.wibmo.tridentity_headless.model.FeatureConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.ResponseObjectConfig {*;}
-keep public class com.wibmo.tridentity_headless.model.SDKConfig {*;}
#
-keep public class com.wibmo.tridentity_headless.model.AuthenticationView {*;}
-keep public class com.wibmo.tridentity_headless.model.BiometricAuthentication {*;}
#
##for SIB enable these as well along with above
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenResponseObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenDataObject {*;}
#-keep public class com.wibmo.tridentity_headless.model.SIBTokenErrorObject{*;}
#

# Keep all DefaultLifecycleObserver methods
-keep public class androidx.lifecycle.DefaultLifecycleObserver {
    public *;
}

# This is also needed for R8 in compat mode since multiple
# optimizations will remove the generic signature such as class
# merging and argument removal. See:
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson

# Optional. For using GSON @Expose annotation
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class kotlin.coroutines.Continuation

-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;

}

-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

#Keep BouncyCastle classe
-keep class com.nimbusds.jose.JOSEException**
-keep class com.nimbusds.jose.jwk.Curve**
-keep class com.nimbusds.jose.jwk.ECKey**

-keep class org.bouncycastle.jce.provider.asymmetric.ec.KeyPairGenerator**
-keep class org.bouncycastle.jce.provider.asymmetric.EC**




