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.

hermann
  • 6,237
  • 11
  • 46
  • 66
Faisal Basra
  • 1,624
  • 4
  • 25
  • 40
  • 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 help – Faisal Basra Mar 05 '14 at 11:41
  • take a look at this http://stackoverflow.com/questions/39637546/integrating-sqlcipher-with-greendao/39637547#39637547 – Mithun Sarker Shuvro Sep 25 '16 at 05:13

1 Answers1

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

carlosmaciel
  • 801
  • 1
  • 6
  • 17