I was looking at our `proguard-rules.pro` file and...
# serialization
s
I was looking at our
proguard-rules.pro
file and we had a bunch of things there related to kotlinx.serialization. I was trying to look into cleaning up any potential unused things, and going through the docs After that, I tried just commenting out all of our rules and running the app in release mode with r8 and everything and everything seems to just work fine? Maybe everything we had is now obsolete because either kotlinx.serialization now has them in the library itself or we were doing something weird back in those days? So my question is, do you use any proguard rules in your android apps when using kotlinx.serialization nowadays? If yes what are you using and why?
e
we didn't use any anymore, everything we needed went upstream. but if you're looking up serializers at runtime, maybe rules are still needed? not sure
s
Yeah I have been trying to just QA everything in the app with all of our custom rules removed and it seems like everything just works. Looked in here https://github.com/Kotlin/kotlinx.serialization/blob/master/rules/common.pro too and it seems to contain basically everything we had as well. Some slight differences but my lack of proguard knowledge does not really help me understand if they mean anything for us. I think it’s also a matter that everything we used to have is now upstreamed.
you’re looking up serializers at runtime
By that would you mean doing
serializer<T>()
inside an inline fun with a
reified
T
? Or something else?
e
no, I mean the non-reified reflective lookups, there's non-inline versions of https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/serializer.html
s
Ah okay thanks for clarifying. So we should be safe on this, we don’t seem to be doing this somewhere as far as I can tell 😊 Will check more carefully though.
e
looking at the upstream rules I think those are covered now too
🌟 1