Ignoring Kotlin's lambdas while keeping Serializable classes names

Hello! I’ve recently discovered that -keepnames class * implements java.io.Serializable is preventing obfuscation of the class names for classes with nested kotlin.jvm.internal.Lambda implementations. It can be demonstrated in a following example:

class DataProvider {
    private val _data by lazy {

    fun getData() = _data

In this case static final class Interactor$_data$2 extends Lambda... is generated inside DataProvider and the DataProvider keeps it’s name. Once I replace by lazy with plain assignment private val _data = "data", DataProvider name is getting obfuscated.
While I understand that it’s an intended behaviour, I would like to ignore the -keepnames class * implements java.io.Serializable for kotlin.jvm.internal.Lambda and its’ implementations. Is that achievable?


Welcome to the ProGuard Community! That is not possible when using ProGuard. ProGuard always considers the union of all -keep options; there are no options to subtract from it.

Best Regards,