Closed Mookiies closed 1 year ago
The docs website has a page on how to go about this.
To answer this question for anyone else that comes upon it:
If an MMKV instance has been previously created, then adding withEncryption
to the initializer will have no effect. To migrate a pre-existing instance to be encrypted it should be done via .encryption.encrypt()
one instantialized.
To verify you can inspect the files MMKV stores:
iOS: Data/Application/<application>/Library/mmkv
Android: /data/data/<com.myapp>/files/mmkv/
I may submit a PR to clarify the docs as it is, imo, not clear that initialization options may not have any impact in this regard
I have an MMKV instance that's existed for awhile across several app releases, and now I want to start encrypting it.
Can I simply add
withEncryption
to the initialization?Or is something slightly more complex where I must initialize a non-encrypted instance as it used to be, and then encrypt it via the
encrypt
method?