davidmartos96 / sqflite_sqlcipher

SQLite flutter plugin
BSD 2-Clause "Simplified" License
99 stars 44 forks source link

[macos] Database not encrypted #27

Closed gibutm closed 3 years ago

gibutm commented 3 years ago

First off, Great Job David! Secondly, it seems that macos support is broken when there is a another plugin that has a dependency on sqflite. Seems to be the same problem that was encountered on iOS and was fixed by the fmdb_override branch.

I went ahead and experimented and found the same fix done on iOS would solve the issue on macos if we modified the sqflite.podspec in the fmdb_override branch. (https://github.com/davidmartos96/sqflite_sqlcipher/blob/fmdb_override/sqflite/macos/sqflite.podspec)

Changing s.dependency 'FMDB', '~> 2.7.2' to s.dependency 'FMDB/SQLCipher', '~> 2.7.5'

seems to fix the issue.

Could you please make this change or would you prefer me to raise a PR?

davidmartos96 commented 3 years ago

Oh, thank you for letting me know. That would indeed fix it. I forgot to update the macos pod when creating that branch. I'll update it myself, so that I can update the README with the new commit reference in the dependency_override workaround.

Thanks again!

davidmartos96 commented 3 years ago

@gibutm I've just updated the repository. Maybe you need to do flutter pub upgrade so that it fetches the new version from the repository. Please let me know if you have any issues. I don't have a Mac at hand to test it.

gibutm commented 3 years ago

@davidmartos96 Thanks for the super quick update! I have tested it out and the changes look good. I have managed to create a new encrypted DB as well as open and existing encrypted DB.

davidmartos96 commented 3 years ago

Great to hear that!