Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating ormlite-4.9 with sqlcipher-2.08

I'm integrating ormlite-4.9 with sqlcipher-2.08. I've googled around but, I didn't succeed. I also saw Mr. Gray's answer(How can I use ORMLite with SQLCipher together in Android?) about integration. I tried by his answer. However, I guess it was for older versions of ORMLite and SQLCipher which has different packages than mine which is downloaded from http://sqlcipher.net/sqlcipher-for-android.

Can someone explain me a bit in detail?

like image 443
Sardor Dushamov Avatar asked Oct 07 '12 17:10

Sardor Dushamov


2 Answers

I just add the same problem than you. The problem is that you have to change the ormlite-android.jar code to make it work with the SQLCipher lib. So what you have to do is :

  1. Download the SQLCipher latest version from here or directly from the website
  2. Unzip the folder then copy it in to your project.
  3. Add the zip in the assets folder to your build path.
  4. Download the ormlite-core code for 4.46 (you can try higher but i don't guarante that it is going to work), you can do it here.
  5. Add the library to your libs folder
  6. Download this git project : https://github.com/d-tarasov/ormlite-android-sqlcipher
  7. Copy the source folder in your project
  8. The package of ormlite classes have changed so just correct it.

And it should work :) Let me know i you have any problem with that !

like image 111
Eliott Roynette Avatar answered Sep 20 '22 02:09

Eliott Roynette


I know this is quite old thread. But I had to go the same way recently. I've read two threads in search for solution: this and this.

  1. I followed ge0rg's answer, it almost worked, were some problems and I have to replace methods inside my code (I wanted to avoid it).
  2. I did what Eliott Roynette suggested here and it worked good except I needed to add one method to Helper class to accept password and I did it.
  3. I wanted to exclude code into lib to have more smart solution instead of code mix, so I build lib/module separately.

And now I have solution that works (you can clone working demo from GitHub). Placing my answer into both threads to help others in the future.

like image 2
Igor K Avatar answered Sep 23 '22 02:09

Igor K