Hi, I have a question regarding kotlin reflection.
Does anyone have experience with (sealed class).sealedSubclasses?
It always returns empty list if I apply obfuscation.
Here’s the definition of classes
Copy code
sealed class Data
object DataChild1 : Data()
object DataChild2 : Data()
and this is what I am trying to do:
Copy code
val dataList = Data::class.sealedSubclasses.mapNotNull { it.objectInstance }
It works fine when I do not apply obfuscation.
Josh Yun
05/02/2022, 12:39 PM
Copy code
@Keep
-keep * extends Data
-keep class kotlin.Metadata { *; }