GreenDAO with Sqlcipher Integration Example
Asked Answered
H

1

9

I have setup a new project using GreenDAO, was able to generate with ExampleDAO using DaoGenerator. Everything works fine.

I also have a prepopulated sqlite database shipped in android assets folder, on app run, it is being copied to android database system path.

Now I want to integrate with SqlCipher, to have my database encrypted... If anybody can help or give example app, that would be a great help.

Hejaz answered 5/3, 2014 at 11:26 Comment(2)
I have produced encrypted version of my assets sqlite database, now I can ship it within asset folder and then start using Sqlcipher with GreenDao. Waiting for next step helpHejaz
take a look at this #39638046Benfield
L
3

Please let me know if these solutions work for you:

A sample project with the integration: https://github.com/ywenblocker/GreenDao-SQLCipher

Here is the original thread with all discussion about how to implement it: https://github.com/greenrobot/greenDAO/issues/6

Edit:

After removing the private libraries from the build path, and adding them again, I found a not implemented method of DevOpenHelper:

sDaoMaster = new DaoMaster(sDevOpenHelper.getWritableDatabase("secret-key"));

There was no such method implemented on the sample project, unfortunately it looks like you should implement the getWritable and getReadable methods all by yourself. Without these modifications you would get a non-encrypted database, as shown by screenshoots below:

Device ScreenShot:

enter image description here

Database snapshot:

enter image description here

Lope answered 10/3, 2014 at 13:38 Comment(1)
can't run their dao-example app? any ideaHejaz

© 2022 - 2024 — McMap. All rights reserved.