I created one database with empty string("").It works fine & database created is unencrypted.
Then I rekeyed the database with some password new.
String password ="";
String str = "PRAGMA key = "+"'"+password+"'";
db.rawExecSQL(str);
str = "PRAGMA rekey = "+"'"+"new"+"'";
db.rawExecSQL(str);
Now when I again open the database with new password, I am getting exception as below
net.sqlcipher.database.SQLiteException: file is encrypted or is not a database
.
However if I open the database with empty string.It works fine--
Note - This is happening only when I create the database with empty string then try to rekey it with some password.
If I create the database initially with some password & then try to rekey it with some other password, it works perfectly fine..