drydart / flutter_sqlcipher

SQLCipher database plugin for Flutter apps.
https://pub.dev/packages/flutter_sqlcipher
The Unlicense
66 stars 14 forks source link

insert() fixed on Android 10 and new SQLCipher version #5

Open develhox opened 4 years ago

develhox commented 4 years ago

This commit fix two issues.

First of all, the insert() method was broken on my Pixel 2 XL with the Android 10 update. The convertMapToContentValues() method always returned null. I fixed it by filling the ContentValues explicitly instead of relying on a Parcel. I think this may be a little slower, but at least it works.

I also changed the SQLCipher version to the 4.2.0 to get rid of an annoying log.

develhox commented 4 years ago

I checked the Parcel source code and I didn't understand why it didn't work anymore. However in the end it does what I am doing, but with more steps, so probably the performance may not be worse in my solution, but even a little better. By reviewing that code I found a way to improve my solutions, therefore I made a new commit. Instead of cycling on the Map keys and then searching in the map for the corresponding value, I am cycling directly on the entries.