-
Notifications
You must be signed in to change notification settings - Fork 568
sqlcipher_export - "table android_metadata already exists" #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Atom99, Since you are using the release candidate libraries, could you try the |
Hi,
net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(databaseFile, "testit", null); causes following error: Is rekey pragma really the correct way to do that? I had a look on the SQLCipher API Doc and here it says: "PRAGMA rekey can not be used to encrypted a standard SQLite database! It is only useful for changing the key on an existing database. Instead, use sqlcipher_export() to encrypt a plaintext database." (http://sqlcipher.net/sqlcipher-api/#rekey) |
Hi Atom99, My apologizes for a delayed response. You are correct, |
Hi, Yes, that's how it works. |
Hi Atom99, Glad to hear you've got positive results. Thanks! |
I am encrypting a database using sqlite expert & then i am importing it into my project. It gives me following error CREATE TABLE android_metadata failed , Failed to setLocale() when constructing, closing the database. But when i am importing database without encrypting it works fine. What should i do to work with encrypted database |
Hi girisharora28, I'm not aware that the SQLite Expert tool is compatible with the type of database encryption that occurs with SQLCipher. You may wish to contact the vendor to confirm. You could take an unencrypted SQLite database and encrypt it using |
Thanks for the reply. I think that it is not compatible otherwise it will open it, i want to know that how can i achieve this task. Simply i just have to make an encrypt database & import it into android application |
Hi girisharora28, Following the steps in example # 1 for |
Thanks once again.. |
Hi girisharora28, We have a mailing list which provides a great searchable resource of information when it comes to SQLCipher usage. Should you have specific questions about SQLCipher, I urge you to check it out. With regard to learning Android itself, there are many great resources available, including the training section within the Android site. |
Hi,
I'm testing the v2.0.0 RC5 version.
I'm trying to export files from an unencrypted database to an encrypted database.
I'm using sqlcipher_export() function to export it.
Whenever i call sqlcipher_export() the error "table android_metadata already exists" occurs.
The android_metadata table is a default table created automatically. Of course, when I delete android_metadata table in the target database before calling sqlcipher_export() it works. But it would be nice that SqlCipher for Android would handle this.
Or maybe I'm doing somthing wrong?
[source]
SQLiteDatabase database = SQLiteDatabase.openDatabase(unEncryptedDBPath, "", null, SQLiteDatabase.OPEN_READWRITE);
database.execSQL("ATTACH DATABASE '" + encryptedDBPath + "' AS encrypted KEY 'testit';");
database.rawExecSQL("SELECT sqlcipher_export('encrypted');");
database.execSQL("DETACH DATABASE encrypted;");
database.close();
[/source]
regards,
Tom
The text was updated successfully, but these errors were encountered: