Integrating ormlite-4.9 with sqlcipher-2.08

我们两清 提交于 2019-12-10 04:35:06

问题


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 :

  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 !




回答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.

  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.



来源:https://stackoverflow.com/questions/12771251/integrating-ormlite-4-9-with-sqlcipher-2-08

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!