Skip to content

Commit cbcc6ce

Browse files
committed
Set kdf_iter for current connection, not global default
1 parent db6d74c commit cbcc6ce

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libs/SmartStore/src/com/salesforce/androidsdk/smartstore/store/DBOpenHelper.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,16 @@ public static boolean smartStoreExists(Context ctx, String dbNamePrefix,
377377

378378
static class DBHook implements SQLiteDatabaseHook {
379379
public void preKey(SQLiteDatabase database) {
380-
// Using sqlcipher 2.x kdf iter because 3.x default (64000) and 4.x default (256000) are too slow
381-
// => should open 2.x databases without any migration
382-
database.execSQL("PRAGMA cipher_default_kdf_iter = 4000");
383380
}
384381

385382
/**
386383
* Need to migrate for SqlCipher 4.x
387384
* @param database db being processed
388385
*/
389386
public void postKey(SQLiteDatabase database) {
390-
database.rawExecSQL("PRAGMA cipher_migrate");
387+
// Using sqlcipher 2.x kdf iter because 3.x default (64000) and 4.x default (256000) are too slow
388+
// => should open 2.x databases without any migration
389+
database.rawExecSQL("PRAGMA kdf_iter = 4000");
391390
}
392391
}
393392

0 commit comments

Comments
 (0)