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.35k stars 234 forks source link

Custom storage #138

Closed dipcore closed 5 years ago

dipcore commented 5 years ago

Hello, I cannot find a basic Storage class to extend. Is there a way to use my own custom storage instead of DbStoragePlainFile?

Thank you.

pilgr commented 5 years ago

Hey, unfortunately not. Paper has been built around Kryo and idea of storing binary in plain files. Despite it has DbStoragePlainFile to concern separation, it has never been intended to be replaced by some other storage/serialization method.

pilgr commented 5 years ago

Also wondering, why you'd like to use different storage?

dipcore commented 5 years ago

My idea is to add some additional layer to encrypt data your library is generating. The AES key I want to query from my license server (every app instance will have it's own AES key). That functionality partially or fully I want to implement using ndk.

pilgr commented 5 years ago

I see, in this case, you need to rewrite the storage a little bit. You can add optional Encryption dependency to the storage (if you'd like to add your changes to the main project here)