Greg Rynkowski

05/12/2022, 9:25 AM
In my project I have lots of sealed classes implementing certain interface.
interface Intent

sealed classes HomeIntent : Intent {
  data class TextChanged(val text: String) : HomeIntent
  object Exit : HomeIntent
I want to keep all the sealed classes like
, with all of the sub- data classes and objects extending sealed classes. How would you tackle it without adding @Keep to every
selead class
, every
and every
data class
? I tried this:
-keepclasseswithmembers class ** implements my.package.Intent {

-keepnames class ** implements my.package.Intent {
but it doesn't seem to keep objects' names. Any ideas?
The right solution is:
-keepnames class **$* implements chargedup.lib.ui.mvi.MviIntent { *; }