Make Proguard completely ignore the package

Is it possible that Proguard is enabled, but keep some classes completely unaffected by Proguard? My proguard config file has the following lines:

-keep class com.heyzap.** { *; }

      

But as I can see the classes inside the Heyzap package actually change anyway after going through Proguard (they are different from what I originally had in the Heyzap jar file).

I don't know what exactly Proguard does with the Heyzap SDK, but after this build process fails, converting the jar file to dex format with the error:

EXCEPTION FROM SIMULATION: com.android.dx.rop.cst.CstInterfaceMethodRef cannot be cast to com.android.dx.rop.cst.CstMethodRef

      

Also I have a -dontoptimize option in my config.

Heyzap recommends using this line to keep their SDK intact:

-libraryjars libs/heyzap-ads-sdk.jar 

      

But Android Studio cannot compile the project with this line added because heyzap-ads-sdk.jar is automatically added to the -injars list (it produces "Same input drum specified twice".)

+3


source to share


1 answer


To make ProGuard completely ignore the package you can use:

-keepclasseswithmembers class com.my.package.** {*;}

      



But the error you are getting means something else, you should try to remove the -libraryjars libs / heyzap-ads-sdk.jar from your ProGuard file because this library is probably being added somewhere else like in your file build.gradle probably along this line:

compile fileTree(dir: 'libs', include: ['*.jar'])

      

+1


source







All Articles