Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLCipher for Android: icudt46l.zip really needed?

I was expecting that the localization data file icudt46l.zip wasn't really needed, but if I don't include it on the Nexus 5 I get a runtime error:

E/AndroidRuntime(4341): Caused by: net.sqlcipher.database.SQLiteException: not an error

This means that overall, almost 7MB of extra files are needed for SQLCipher for Android:
- 2.7MB assets/icudt46l.zip
- 0.2MB lib/armeabi/libdatabase_sqlcipher.so
- 2.3MB lib/armeabi/libsqlcipher_android.so
- 0.4MB lib/armeabi/libstlport_shared.so
- 0.1MB lib/commons-codec.jar
- 1.1MB lib/guava-r09.jar
- 0.1MB lib/sqlcipher.jar

Is everyone else experiencing the need to include the file icudt46l.zip?

like image 332
Daniele B Avatar asked Feb 25 '14 19:02

Daniele B


2 Answers

Quoting the documentation for SQLCipher for Android:

SQLCipher for Android depends on localization data from the ICU project. SQLCipher for Android will attempt to use a system provided ICU localization data file called icudt46l.dat located in the /system/usr/icu directory if available. If that is not found, SQLCipher for Android will attempt to unzip the icudt46l.zip file located within the applications asset directory. It is recommended that the icudt46.zip file be included with your application for best platform compatibility. If you need to adjust the size of the localization data for your application, a ICU data library customizer is available here.

I am not aware of any version of Android in which the system-supplied ICU data meets SQLCipher's needs.

like image 187
CommonsWare Avatar answered Sep 20 '22 03:09

CommonsWare


If you use gradle to get it from maven central, you don't need to worry about its dependencies. It actually has shed a few of these libraries, such as guava and apache commons, so is much smaller in both size and method count.

compile 'net.zetetic:android-database-sqlcipher:3.4.0'

like image 36
Tom Avatar answered Sep 22 '22 03:09

Tom