Search code examples
androidsecuritysdkandroid-proguardpayumoney

How to enable proguard for only one module


I have a payment application with payumoney integration. It was working fine until i added the proguard. Recently I have added Proguard to my build.gradle file (Module: app)

  ` buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
}` 

After this App gets closed when i proceed to payment. It is working fine when i Changed minifyEnabled to false.

Following is my Module:PayuMoneySdk Build.gradle File

`buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }`

How can I solve this issue? I can't disable proguard.

Can I enable proguard to only Module:app? And will it solve the issue?

I am new to programming. Please help!!


Solution

  • The solution is to look up for the methods and classess that needs to be exempted and add them to the proguard rules as follows..

    -keep class com.mm.** {*;}
    -keep class com.company.** {*;}
    -keepclassmembers  class com.mm.** {*;}
    -keepclassmembers  class com.company.** {*;}