How can I obfuscate my sdk coded with kotlin (and get rid of Metadata) How can I obfuscate my sdk coded with kotlin (and get rid of Metadata) android android

How can I obfuscate my sdk coded with kotlin (and get rid of Metadata)


Finally, I found a way to delete Kotlin metadata annotations.

In order to hide Kotlin metadata annotations, you need to enable R8 full mode.

Here is the information about my environment.

Environment

OS: macOS 10.15.1Android Studio: 3.5.1Gradle: 5.4.1Android Gradle Tool: 3.5.2

What you have to do is just add properties to gradle.properties like below

gradle.properties

android.enableR8.fullMode=true

And here is my Proguard Rules

proguard-rules.pro

-dontwarn kotlin.**-assumenosideeffects class kotlin.jvm.internal.Intrinsics {    static void checkParameterIsNotNull(java.lang.Object, java.lang.String);}

FYI, R8 full mode is still testing now, so sometimes it doesn't work well. However, for me, it works perfectly for now.