Chris Fillmore
06/14/2022, 4:52 PMminifyEnabled true
on the release build.
My question is, is it necessary to configure ProGuard for Kotlin serialization, if you always provide a serializer explicitly? So I mean, in every case I call it like this:
serializer.decodeFromString(MyData.serializer(), json)
// or
serializer.encodeToString(MyData.serializer(), myObj)
On observation, my program seems to work fine with obfuscation enabled, without any ProGuard configuration, if I am passing the serializer like this. This seems to contradict the docs:
The library works on Android, but, if you’re using ProGuard, you need to add rules to yourconfiguration to cover all classes that are serialized at runtime.<http://proguard-rules.pro|proguard-rules.pro>
Chris Fillmore
06/14/2022, 4:53 PMephemient
06/14/2022, 5:08 PMSerializersModule {
contextual(serializer())
polymorphic(Base::class) {
subclass(Sub::class)
}
}
but as long as you're not using those, you're safe even under r8Chris Fillmore
06/14/2022, 6:00 PM