We have just released a patch release of SQLCipher for Android, version 3.3.1-2. This addresses an issue reported on Android OS 4.0.3 for the x86 platform. New binaries are available on Maven Central, synchronization should occur today if you are using JCenter. The latest AAR reference is:
Were you able to reproduce the issue when running the test suite? Are you a commercial license holder, or are you using the community edition of the library?
I have an existing Android App with encrypted DB (encrypted using SQL cipher 2.2.0)
Recently we updated the cipher lib to 3.3.1-2 ( compile ‘net.zetetic:android-database-sqlcipher:3.3.1-2@aar’)
App works fine on new installation. Problem occurs on devices where i am trying to use existing set up (i mean access existing Db)
Following is my code.
SQLiteDatabaseHook hook=new SQLiteDatabaseHook() {
public void preKey( SQLiteDatabase database){
database.rawExecSQL("PRAGMA cipher_default_use_hmac=off;");
}
public void postKey( SQLiteDatabase database){ }
};
try {
SQLiteDatabase source=SQLiteDatabase.openOrCreateDatabase(databaseToMigrate,password,null,hook);} catch(Exception e) { }
********DB was created using this line *************
db = SQLiteDatabase.openOrCreateDatabase(vDbPath, mdbEKey, null);
It gives following error:
11-17 14:02:24.067 2247-2247/org.bz.mws.Screens I/Database: sqlite returned: error code = 26, msg = file is encrypted or is not a database
11-17 14:02:24.067 2247-2247/org.bz.mws.Screens E/Database: CREATE TABLE android_metadata failed
11-17 14:02:24.069 2247-2247/org.bz.mws.Screens E/Database: Failed to setLocale() when constructing, closing the database
11-17 14:02:24.069 2247-2247/org.bz.mws.Screens E/Database: net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: create locale table failed
I am stuck in this for quiete a few days. please help to resolve this. Tried out different options in PreKey but nothing helped.
Were you previously disabling the per page HMAC when you used SQLCipher 2.2.0? If not, you should not need the PRAGMA cipher_default_use_hmac=off; command. You will need to migrate the existing database files to the 3.x format, you can do this with the PRAGMA cipher_migrate; command.
With regard to the impact SQLCipher may have on your application, we have a post covering the details of performance here. Would you review that and see if it may apply to your application? Thanks!
your test suite working proper on my tablet but in my project when calling SQLiteDatabase.loadLibs(context); give error
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/system/framework/com.google.android.maps.jar”, zip file “/data/app/com.atscene.icrimefighterle-1/base.apk”],nativeLibraryDirectories=[/data/app/com.atscene.icrimefighterle-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn’t find “libstlport_shared.so”