Skip to content

SQLCipher and SQLite support

xcesco edited this page Dec 12, 2021 · 1 revision

Since version 7 of Kripton you can choose to use plain SQLite databases or ciphered databases through the SQLCipher database. Sqlcipher is an SQLite version that enabled storage using the AES algorithm to persist data.

In your project, when you want to use Kripton, the following dependencies have to be included:

annotationProcessor 'com.abubusoft:kripton-processor:8.0.0-rc.3'
implementation "com.abubusoft:kripton-android-library:8.0.0-rc.3"

Moreover, you have to choose which type of SQLite to use. You can do it simply defining the SQLite version you want to use.

Use SQLite

To use a simple SQLite database, simply add to the project's dependencies the SQLite aar.

implementation "androidx.sqlite:sqlite:2.1.0"

Use SQLcipher

To enable this feature, just include in your dependencies the SQL cipher aar:

implementation "net.zetetic:android-database-sqlcipher:4.3.0"

And use the KriptonSQLCipherHelperFactory as a factory in your DataSources:

KriptonSQLCipherHelperFactory factory = new KriptonSQLCipherHelperFactory(password.toCharArray());

BindAppDataSource.build(DataSourceOptions.builder()
        .populator(new AppPopulator())
        .openHelperFactory(factory)
        .build());

Table of Contents

Query definition

Features

Relations

Multithread supports

Modularization

Annotations for data convertion

Annotations for SQLite ORM

Annotations for shared preferences

Clone this wiki locally