I'm trying to add Kotlin to my project and I need to use proguard. Which rules should I add to proguard to support Kotlin?
Thank you
if you use android studio, proguards comes with default. But you should on "Enables code shrinking" and "Enables resource shrinking" options for your code security and code optimization. open your gradile file and check below. Show activity on this post.
ProGuard will apply the same obfuscations to Kotlin identifiers in metadata, such as class or member names, to match those in the Java class files. This ensures that, even where the Kotlin metadata is required, no sensitive names remain in the metadata.
You don't need to do anything special. Kotlin works with ProGuard out of the box. But you may face some strange errors when processing your application with ProGuard. In this case just add
-dontwarn kotlin.**
Also if you want to get rid of null checks at runtime you may use the following rule:
-assumenosideeffects class kotlin.jvm.internal.Intrinsics { static void checkParameterIsNotNull(java.lang.Object, java.lang.String); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With