pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.34k stars 234 forks source link

Add passthrough to kryo.register and Kryo.setRegistrationRequired as alternative to Proguard #130

Open wispborne opened 6 years ago

wispborne commented 6 years ago

Enhancement request.

Paper uses Kryo's default creation of class identifiers, which simply uses the class's package name + name. This necessitates excluding serialized classes from Proguard, which is something the dev needs to keep in mind and remember to add to their proguard config when adding new classes to serialize.

Adding a passthrough to Kryo.setRegistrationRequired and Kryo.register for a Book would result in better performance, but more importantly it would help developers prevent bugs caused by forgetting to add a new class to proguard (which they might only realize after it was in production, in the worst case scenario), because the app would crash if Paper tried to touch a class that wasn't registered for serialization.

https://github.com/EsotericSoftware/kryo#registration