Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlcipher support #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

tntnt
Copy link

@tntnt tntnt commented Sep 7, 2015

i use sqlcipher and like ProviGen so i'm sending the code i did to allow them to work together. from the comment comment:

goal: support either SQLite or SqlCipher.

design: abstract the common behavior into the interfaces Database and OpenHelper and implementations of these. for SQLite the library uses AndroidSQLiteDatabase and ProviGenSQLiteOpenHelper. for SqlCipher it uses SQLCipherDatabase and ProviGenSQLCipherOpenHelper.

use: an application using SQLite should use ProviGenSQLiteOpenHelper in its ContentProvider in place of SQLiteOpenHelper. for SqlCipher, the application uses ProviGenSQLCipherOpenHelper. SqlCipher also requires the app to make to calls:
SQLiteDatabase.loadLibs(getApplicationContext());
ProviGenSQLCipherOpenHelper.setPassword("swordfish");

these are usually called in Application.onCreate(). they should be called before any use of the database. loadLibs() is required for any app using SqlCipher. as the SqlCipher database file is encrypted call ProviGenSQLCipherOpenHelper.setPassword() to provide the password used to decrypt it.

a new sample, ProviGenSqlcipherSample, shows how to use SqlCipher with ProviGen.

goal: support either SQLite or SqlCipher.

design: abstract the common behavior into the interfaces Database and OpenHelper and implementations of
these. for SQLite the library uses AndroidSQLiteDatabase and ProviGenSQLiteOpenHelper. for SqlCipher it
uses SQLCipherDatabase and ProviGenSQLCipherOpenHelper.

use: an application using SQLite should use ProviGenSQLiteOpenHelper in its ContentProvider in place of
SQLiteOpenHelper. for SqlCipher, the application uses ProviGenSQLCipherOpenHelper. SqlCipher also requires
the app to make to calls:
	SQLiteDatabase.loadLibs(getApplicationContext());
	ProviGenSQLCipherOpenHelper.setPassword("swordfish");

these are usually called in Application.onCreate(). they should be called before any use of the database.
loadLibs() is required for any app using SqlCipher. as the SqlCipher database file is encrypted call
ProviGenSQLCipherOpenHelper.setPassword() to provide the password used to decrypt it.

a new sample, ProviGenSqlcipherSample, shows how to use  SqlCipher with ProviGen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant