android - Integrating SQLCipher with greenDAO -
how encrypt sqlite database in android sqlchipher while using greendao orm. have searched many time in , didn't find working solution .
in greendao generator module add dependency
compile 'org.greenrobot:greendao-generator-encryption:2.2.0'
so build.gradle file generator module
apply plugin: 'java' dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'org.greenrobot:greendao-generator-encryption:2.2.0' }
and in app gradle file (build.gradle module app) add these dependencies , remove other greendao related dependencies
compile 'org.greenrobot:greendao-encryption:2.2.2' compile 'net.zetetic:android-database-sqlcipher:3.5.1'
and set database way
daomaster.encrypteddevopenhelper helper = new daomaster.encrypteddevopenhelper(context, "secrets.db"); database database = helper.getwritabledatabase("your secret key"); daomaster daomaster = new daomaster(database);
if there other option , please share
Comments
Post a Comment