optimized proguard rules
This commit is contained in:
parent
89466f8209
commit
398a0d7986
279
app/proguard-rules.pro
vendored
279
app/proguard-rules.pro
vendored
@ -20,92 +20,233 @@
|
|||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
|
-keepattributes Signature, *Annotation*, SourceFile, LineNumberTable, InnerClasses, EnclosingMethod
|
||||||
|
-dontwarn sun.misc.**
|
||||||
|
|
||||||
# Keep Bouncy Castle classes for security providers
|
# Hilt ProGuard Rules - CRITICAL FOR DEPENDENCY INJECTION
|
||||||
-keep class org.bouncycastle.** { *; }
|
-dontwarn dagger.hilt.**
|
||||||
-dontwarn org.bouncycastle.**
|
|
||||||
-keep class com.squareup.okhttp.** { *; }
|
|
||||||
-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
|
|
||||||
|
|
||||||
############################
|
|
||||||
# HILT
|
|
||||||
############################
|
|
||||||
-keep class dagger.hilt.** { *; }
|
-keep class dagger.hilt.** { *; }
|
||||||
-keep class javax.inject.** { *; }
|
-keep class * extends dagger.hilt.** { *; }
|
||||||
-keep class * extends dagger.hilt.internal.GeneratedComponent { *; }
|
|
||||||
-keep class * extends dagger.hilt.internal.GeneratedComponentManager { *; }
|
|
||||||
-keep class hilt_aggregated_deps.** { *; }
|
|
||||||
|
|
||||||
############################
|
# Keep all Hilt generated classes
|
||||||
# ANDROIDX NAVIGATION
|
-keep class **_HiltComponents { *; }
|
||||||
############################
|
-keep class **_HiltComponents$* { *; }
|
||||||
-keep class androidx.navigation.** { *; }
|
-keep class **_HiltModules { *; }
|
||||||
|
-keep class **_HiltModules$* { *; }
|
||||||
|
-keep class * extends dagger.hilt.android.internal.managers.ApplicationComponentManager { *; }
|
||||||
|
-keep class * extends dagger.hilt.android.internal.managers.ActivityComponentManager { *; }
|
||||||
|
-keep class * extends dagger.hilt.android.internal.managers.FragmentComponentManager { *; }
|
||||||
|
-keep class * extends dagger.hilt.android.internal.managers.ViewComponentManager { *; }
|
||||||
|
-keep class * extends dagger.hilt.android.internal.managers.ServiceComponentManager { *; }
|
||||||
|
|
||||||
############################
|
# Keep Hilt entry points and components
|
||||||
# DATA BINDING
|
-keep @dagger.hilt.InstallIn class * { *; }
|
||||||
############################
|
-keep @dagger.hilt.android.AndroidEntryPoint class * { *; }
|
||||||
-keep class **.databinding.*Binding { *; }
|
-keep @dagger.hilt.android.HiltAndroidApp class * { *; }
|
||||||
-keep class androidx.databinding.** { *; }
|
|
||||||
|
|
||||||
############################
|
# Keep classes annotated with @Module, @Component, @Subcomponent
|
||||||
# FRAGMENTS
|
-keep @dagger.Module class * { *; }
|
||||||
############################
|
-keep @dagger.Component class * { *; }
|
||||||
-keep class * extends androidx.fragment.app.Fragment
|
-keep @dagger.Component.Builder class * { *; }
|
||||||
|
-keep @dagger.Subcomponent class * { *; }
|
||||||
|
-keep @dagger.Subcomponent.Builder class * { *; }
|
||||||
|
|
||||||
############################
|
# Keep all classes that have @Inject constructors, fields, or methods
|
||||||
# SERIALIZABLE / PARCELABLE
|
-keepclasseswithmembers class * {
|
||||||
############################
|
@javax.inject.Inject <init>(...);
|
||||||
-keepclassmembers class * implements java.io.Serializable {
|
}
|
||||||
static final long serialVersionUID;
|
-keepclasseswithmembers class * {
|
||||||
|
@javax.inject.Inject <fields>;
|
||||||
|
}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@javax.inject.Inject <methods>;
|
||||||
}
|
}
|
||||||
|
|
||||||
############################
|
# Keep Application class and its generated Hilt class
|
||||||
# NEXGO / SUNMI / PAYLIBS
|
-keep class com.utsmm.kbz.MyApplication { *; }
|
||||||
############################
|
-keep class com.utsmm.kbz.Hilt_MyApplication { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.BaseApplication { *; }
|
||||||
|
|
||||||
|
# Keep main activity and its generated classes
|
||||||
|
-keep class com.utsmm.kbz.MainActivity { *; }
|
||||||
|
|
||||||
|
# ViewModels and Repository classes (important for injection)
|
||||||
|
-keep class * extends androidx.lifecycle.ViewModel { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.repo.Repository { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.emv.EmvParamOperation { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.emv.TerminalParamOperation { *; }
|
||||||
|
|
||||||
|
# Keep all Dagger generated classes - these are critical!
|
||||||
|
-keep class **_Factory { *; }
|
||||||
|
-keep class **_MembersInjector { *; }
|
||||||
|
-keep class **_Provide* { *; }
|
||||||
|
|
||||||
|
-keep class com.utsmyanmar.baselib.network.model.* { <fields>; }
|
||||||
|
-keep class com.utsmyanmar.baselib.network.model.sirius.* { <fields>; }
|
||||||
|
-keep class com.utsmyanmar.baselib.db.model.* { <fields>; }
|
||||||
|
|
||||||
|
-keep class com.utsmyanmar.ecr.data.* { <fields>; }
|
||||||
|
-keep class com.utsmyanmar.ecr.data.model.* { <fields>; }
|
||||||
|
|
||||||
|
-keep class com.utsmyanmar.mpulib.data.model.* { <fields>; }
|
||||||
|
|
||||||
|
-keep class * extends 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
|
||||||
|
|
||||||
|
# this is start
|
||||||
|
-keep class org.bouncycastle.** { *; }
|
||||||
|
-keep interface org.bouncycastle.** { *; }
|
||||||
|
-keep class okhttp3.internal.platform.BouncyCastlePlatform { *; }
|
||||||
|
|
||||||
|
# Keep classes from the JNDI package
|
||||||
|
-keep class javax.naming.** { *; }
|
||||||
|
-keep class javax.naming.directory.** { *; }
|
||||||
|
|
||||||
|
# Keep Bouncy Castle classes
|
||||||
|
-keep class org.bouncycastle.** { *; }
|
||||||
|
|
||||||
|
# Keep Conscrypt classes
|
||||||
|
-keep class org.conscrypt.** { *; }
|
||||||
|
|
||||||
|
# Keep OpenJSSE classes
|
||||||
|
-keep class org.openjsse.** { *; }
|
||||||
|
|
||||||
|
# Keep classes from okhttp3.internal.platform.BouncyCastlePlatform
|
||||||
|
-keep class okhttp3.internal.platform.BouncyCastlePlatform { *; }
|
||||||
|
|
||||||
|
# Keep classes from okhttp3.internal.platform.ConscryptPlatform
|
||||||
|
-keep class okhttp3.internal.platform.ConscryptPlatform$Companion { *; }
|
||||||
|
#-keep class okhttp3.internal.platform.ConscryptPlatform$platformTrustManager$2 { *; }
|
||||||
|
|
||||||
|
# Keep classes from okhttp3.internal.platform.OpenJSSEPlatform
|
||||||
|
-keep class okhttp3.internal.platform.OpenJSSEPlatform { *; }
|
||||||
|
|
||||||
|
#this is end
|
||||||
|
|
||||||
|
-keepclassmembers,allowobfuscation class * {
|
||||||
|
@com.google.gson.annotations.SerializedName <fields>;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||||
|
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||||
|
|
||||||
|
|
||||||
|
# Jun9 2022
|
||||||
|
|
||||||
|
#-keep public class * implements com.bumptech.glide.module.GlideModule
|
||||||
|
#-keep class * extends com.bumptech.glide.module.AppGlideModule {
|
||||||
|
# <init>(...);
|
||||||
|
#}
|
||||||
|
#-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
|
||||||
|
# **[] $VALUES;
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
#-assumenosideeffects class android.util.Log {
|
||||||
|
#public static int d(...);
|
||||||
|
#public static int v(...);
|
||||||
|
#public static int i(...);
|
||||||
|
#public static int w(...);
|
||||||
|
#public static int wtf(...);
|
||||||
|
# }
|
||||||
|
|
||||||
|
-dontwarn okhttp3.internal.platform.**
|
||||||
|
-dontwarn org.conscrypt.**
|
||||||
|
-dontwarn org.bouncycastle.**
|
||||||
|
-dontwarn org.openjsse.**
|
||||||
|
|
||||||
|
# RxJava 3 Rules - Critical for Observable chains
|
||||||
|
-keep class io.reactivex.rxjava3.** { *; }
|
||||||
|
-dontwarn io.reactivex.rxjava3.**
|
||||||
|
-keep class io.reactivex.rxjava3.core.** { *; }
|
||||||
|
-keep class io.reactivex.rxjava3.android.** { *; }
|
||||||
|
-keep class io.reactivex.rxjava3.schedulers.** { *; }
|
||||||
|
|
||||||
|
# Retrofit and OkHttp rules
|
||||||
|
-keepattributes RuntimeVisibleAnnotations
|
||||||
|
-keep class retrofit2.** { *; }
|
||||||
|
-keepclassmembernames interface * {
|
||||||
|
@retrofit2.http.* <methods>;
|
||||||
|
}
|
||||||
|
|
||||||
|
# AndroidX and Lifecycle components
|
||||||
|
-keep class androidx.lifecycle.** { *; }
|
||||||
|
-keep class * extends androidx.lifecycle.ViewModel { *; }
|
||||||
|
-keep class androidx.activity.** { *; }
|
||||||
|
-keep class androidx.fragment.** { *; }
|
||||||
|
|
||||||
|
# Navigation component rules
|
||||||
|
-keep class androidx.navigation.** { *; }
|
||||||
|
-keep class * implements androidx.navigation.NavDirections { *; }
|
||||||
|
|
||||||
|
# DataBinding rules
|
||||||
|
-keep class androidx.databinding.** { *; }
|
||||||
|
-keep class * extends androidx.databinding.ViewDataBinding { *; }
|
||||||
|
|
||||||
|
# Room database rules (if using Room)
|
||||||
|
-keep class androidx.room.** { *; }
|
||||||
|
-keep class * extends androidx.room.RoomDatabase { *; }
|
||||||
|
|
||||||
|
# PayLibs and device-specific rules
|
||||||
|
-keep class com.utsmyanmar.paylibs.** { *; }
|
||||||
-keep class com.nexgo.** { *; }
|
-keep class com.nexgo.** { *; }
|
||||||
-keep class com.sunmi.** { *; }
|
-keep class com.sunmi.** { *; }
|
||||||
-keep class com.utsmyanmar.** { *; }
|
-keep class com.utsmyanmar.checkxread.** { *; }
|
||||||
-keep class com.kizzy.xpay.** { *; }
|
-keep class com.utsmyanmar.ecr.** { *; }
|
||||||
|
-keep class com.utsmyanmar.mpulib.** { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.** { *; }
|
||||||
|
|
||||||
############################
|
# Enum preservation for critical enums
|
||||||
# ENUMS (ISO / TRANSACTION TYPES)
|
|
||||||
############################
|
|
||||||
-keepclassmembers enum * {
|
-keepclassmembers enum * {
|
||||||
public static **[] values();
|
public static **[] values();
|
||||||
public static ** valueOf(java.lang.String);
|
public static ** valueOf(java.lang.String);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Keep Retrofit generic signatures
|
# Keep model classes from obfuscation completely
|
||||||
-keepattributes Signature
|
-keep class com.utsmyanmar.paylibs.model.** { *; }
|
||||||
-keepattributes *Annotation*
|
-keep class com.utsmyanmar.baselib.db.model.** { *; }
|
||||||
|
|
||||||
# RxJava
|
# Critical: Keep all native methods and JNI classes
|
||||||
-keep class io.reactivex.** { *; }
|
-keepclasseswithmembernames class * {
|
||||||
-dontwarn io.reactivex.**
|
native <methods>;
|
||||||
|
|
||||||
# Retrofit
|
|
||||||
-keep class retrofit2.** { *; }
|
|
||||||
-dontwarn retrofit2.**
|
|
||||||
|
|
||||||
# Your API interfaces
|
|
||||||
-keep interface com.utsmyanmar.baselib.api.** { *; }
|
|
||||||
|
|
||||||
# Your response models
|
|
||||||
-keep class com.utsmyanmar.baselib.model.** { *; }
|
|
||||||
|
|
||||||
# Keep model fields for Gson
|
|
||||||
-keepclassmembers class * {
|
|
||||||
@com.google.gson.annotations.SerializedName <fields>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Or keep all models directly (simpler & safer)
|
# Keep critical system params and utils
|
||||||
-keep class com.utsmyanmar.baselib.model.** { *; }
|
-keep class com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation { *; }
|
||||||
|
-keep class com.utsmyanmar.paylibs.utils.** { *; }
|
||||||
|
|
||||||
-keep class androidx.lifecycle.** { *; }
|
# Prevent obfuscation of classes used in reflection
|
||||||
-keep class * extends androidx.lifecycle.ViewModel { *; }
|
-keep class * extends java.lang.Exception
|
||||||
-keep class com.utsmyanmar.baselib.repo.** { *; }
|
-keep class * extends java.lang.Error
|
||||||
|
|
||||||
|
# CRITICAL: Keep all generated application components from obfuscation
|
||||||
|
-keep class com.utsmm.kbz.MyApplication_GeneratedInjector { *; }
|
||||||
|
#-keep class com.utsmm.kbz.MyApplication_HiltComponents$SingletonC { *; }
|
||||||
|
#-keep class com.utsmm.kbz.MyApplication_HiltComponents { *; }
|
||||||
|
|
||||||
|
# Keep all classes with "Generated" in their name (Hilt generates these)
|
||||||
|
-keep class **_Generated { *; }
|
||||||
|
-keep class **GeneratedInjector { *; }
|
||||||
|
|
||||||
|
# Additional protection for the specific classes causing crashes
|
||||||
|
-keep class **.D0.h { *; }
|
||||||
|
-keep class **.m2.f { *; }
|
||||||
|
-keep class **.J3.b { *; }
|
||||||
|
|
||||||
|
# Keep everything in the di package to prevent injection failures
|
||||||
|
-keep class com.utsmyanmar.baselib.di.** { *; }
|
||||||
|
-keep class com.utsmm.kbz.di.** { *; }
|
||||||
|
|
||||||
|
# Hilt Extension points
|
||||||
|
#-keep class * extends dagger.hilt.android.internal.managers.ApplicationComponentManager$ApplicationComponentBuilder { *; }
|
||||||
|
|
||||||
|
# Don't obfuscate any annotation processing related classes
|
||||||
|
-keep class dagger.internal.** { *; }
|
||||||
|
-keepnames class dagger.internal.** { *; }
|
||||||
|
|
||||||
|
# Keep annotation-based bindings
|
||||||
|
-keep @javax.inject.Inject class * { *; }
|
||||||
|
-keep @dagger.Provides class * { *; }
|
||||||
|
-keep @dagger.Module class * { *; }
|
||||||
25
baselib/proguard-rules.pro
vendored
25
baselib/proguard-rules.pro
vendored
@ -28,3 +28,28 @@
|
|||||||
-dontwarn com.android.org.bouncycastle.**
|
-dontwarn com.android.org.bouncycastle.**
|
||||||
|
|
||||||
-keep class org.bouncycastle.** {*;}
|
-keep class org.bouncycastle.** {*;}
|
||||||
|
|
||||||
|
-keepclassmembers,allowobfuscation class * {
|
||||||
|
@com.google.gson.annotations.SerializedName <fields>;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Hilt support for baselib
|
||||||
|
-keep class com.utsmyanmar.baselib.di.** { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.emv.EmvParamOperation { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.emv.TerminalParamOperation { *; }
|
||||||
|
-keep class com.utsmyanmar.baselib.repo.Repository { *; }
|
||||||
|
|
||||||
|
# Keep all Hilt generated classes in baselib
|
||||||
|
-keep class **_HiltModules { *; }
|
||||||
|
-keep class **_HiltModules$* { *; }
|
||||||
|
|
||||||
|
# Keep classes with @Inject annotations
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@javax.inject.Inject <init>(...);
|
||||||
|
}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@javax.inject.Inject <fields>;
|
||||||
|
}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@javax.inject.Inject <methods>;
|
||||||
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.utsmyanmar.baselib.emv;
|
package com.utsmyanmar.baselib.emv;
|
||||||
|
|
||||||
import com.sunmi.pay.hardware.aidlv2.bean.AidV2;
|
|
||||||
import com.utsmyanmar.baselib.db.model.ContactlessAid;
|
import com.utsmyanmar.baselib.db.model.ContactlessAid;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
import com.utsmyanmar.paylibs.utils.core_utils.ByteUtil;
|
||||||
|
|
||||||
|
|||||||
@ -225,7 +225,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
|||||||
// transData.setCashbackAmount("000000000100"); //if support cashback amount
|
// transData.setCashbackAmount("000000000100"); //if support cashback amount
|
||||||
transData.setEmvTransType(ByteUtil.hexStr2Byte(getTransactionType())); //0x00-sale, 0x20-refund,0x09-sale with cashback
|
transData.setEmvTransType(ByteUtil.hexStr2Byte(getTransactionType())); //0x00-sale, 0x20-refund,0x09-sale with cashback
|
||||||
transData.setCountryCode("104"); //CountryCode
|
transData.setCountryCode("104"); //CountryCode
|
||||||
transData.setCurrencyCode("104"); //CurrencyCode, 840 indicate USD dollar
|
transData.setCurrencyCode(mPayDetail.getCurrencyCode()); //CurrencyCode, 840 indicate USD dollar
|
||||||
transData.setTermId(mPayDetail.getTerminalNo());
|
transData.setTermId(mPayDetail.getTerminalNo());
|
||||||
transData.setMerId(mPayDetail.getMerchantNo());
|
transData.setMerId(mPayDetail.getMerchantNo());
|
||||||
transData.setTransDate(new SimpleDateFormat("yyMMdd", Locale.getDefault()).format(new Date()));
|
transData.setTransDate(new SimpleDateFormat("yyMMdd", Locale.getDefault()).format(new Date()));
|
||||||
|
|||||||
18
paylibs/proguard-rules.pro
vendored
18
paylibs/proguard-rules.pro
vendored
@ -19,3 +19,21 @@
|
|||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
|
# Keep the JNDI classes
|
||||||
|
-keep class javax.naming.** { *; }
|
||||||
|
-keep class javax.naming.directory.** { *; }
|
||||||
|
|
||||||
|
# Keep the Bouncy Castle classes
|
||||||
|
-keep class org.bouncycastle.** { *; }
|
||||||
|
|
||||||
|
# Keep the Conscrypt classes
|
||||||
|
-keep class org.conscrypt.** { *; }
|
||||||
|
|
||||||
|
# Keep the OpenJSSE classes
|
||||||
|
-keep class org.openjsse.** { *; }
|
||||||
|
|
||||||
|
# Keep specific classes from okhttp3.internal.platform
|
||||||
|
-keep class okhttp3.internal.platform.BouncyCastlePlatform { *; }
|
||||||
|
-keep class okhttp3.internal.platform.ConscryptPlatform { *; }
|
||||||
|
-keep class okhttp3.internal.platform.OpenJSSEPlatform { *; }
|
||||||
Loading…
Reference in New Issue
Block a user