问题
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?
回答1:
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 :
- Download the
SQLCipher
latest version from here or directly from the website - Unzip the folder then copy it in to your project.
- Add the zip in the assets folder to your build path.
- 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. - Add the library to your libs folder
- Download this git project : https://github.com/d-tarasov/ormlite-android-sqlcipher
- Copy the source folder in your project
- 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 !
回答2:
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.
- 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).
- 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.
- 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.
来源:https://stackoverflow.com/questions/12771251/integrating-ormlite-4-9-with-sqlcipher-2-08