-
Notifications
You must be signed in to change notification settings - Fork 576
Description
https://github.com/sqlcipher/android-database-sqlcipher#using-sqlcipher-for-android-with-room
The documentation here cites two constructors, and there are three:
SupportFactory(byte[] passphrase)
SupportFactory(byte[] passphrase, SQLiteDatabaseHook hook)
SupportFactory(byte[] passphrase, SQLiteDatabaseHook hook, boolean clearPassphrase)
Also, we probably should explain more about what clearPassphrase
does. If set to true
(which is the default for the other two constructors), this will zero out the bytes of the byte[]
after we open the database. This is safest from a security standpoint, but it does mean that the SupportFactory
instance is a single-use object. Attempting to reuse the SupportFactory
instance later will result in being unable to open the database, because the passphrase will be wrong. If you think that you might need to reuse the SupportFactory
instance, pass false
for clearPassphrase
.
If you would like me to open a PR with these fixes, just let me know what branch to base it off of, and I'll happily do it!