Android Question Migration SQLCiper V1.50 to V1.60

Duque

Active Member
Licensed User
Longtime User
Colleagues, I'm pretty worried, I should do this migration from SQLCiper V1.50 to V1.60, as we all know from the 64BIT binary.

The problem is generated because the database created in V1.50 will not be compatible with V1.60, so as I do to pass that data to the new database when updating the app it will take V1.60 You will NOT be able to open the database .

I happened to move the database from V1.50 to a temporary normal SQLite database, then create the new database with V1.60 that would work, but the process would be too long, my clients have tables of up to 2,000 .000 of records.

What other solution can there be?

Thank you.
 

Duque

Active Member
Licensed User
Longtime User
It is impossible for this command to work for me when the BD never starts
B4X:
Bd.ExecNonQuery("PRAGMA cipher_page_size = 1024; PRAGMA kdf_iter = 64000; PRAGMA cipher_hmac_algorithm = HMAC_SHA1; PRAGMA cipher_kdf_algorithm = PBKDF2_HMAC_SHA1;")

I'm doing it wrong ?
 
Upvote 0

Duque

Active Member
Licensed User
Longtime User
console.png


Attached small project with that error
 

Attachments

  • prueba.zip
    10.3 KB · Views: 330
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This happens internally. You will not be able to run the PRAGMA command.

You need to provide a method to decrypt the database and then encrypt it with the new version of your app (or better a new app).

Another option is to download v3.5.9 of SQLCipher: https://mvnrepository.com/artifact/net.zetetic/android-database-sqlcipher/3.5.9
The AAR does include 64 bit binaries (x86_64). You need to add them to your library.
 
Upvote 0

Duque

Active Member
Licensed User
Longtime User
I do not know how to do it
You need to add them to your library.

It's what I had in mind since the consultation
You need to provide a method to decrypt the database and then encrypt it with the new version of your app (or better a new app).

I'm disappointed with SQLCipher, I'll have to go back to normal SQLite :(

Thank you very much for your time Mr. Erel
 
Upvote 0

Duque

Active Member
Licensed User
Longtime User
The problem is that there are more than 2,000 clients using the app, each client has tables of up to 2,000,000 records.

I will not be able to update each one with a PC.

Offering an update is the idea but it is impossible to open the old DB with V1.60.

I'll have to go from v1.50 to normal sqlite, then from normal to v1.60 it's the only option I see that works.

But I will listen to the many options that you offer #KMatle...
 
Upvote 0

Duque

Active Member
Licensed User
Longtime User
If I tried it, it did not make any difference.
V1.50
does not care whether or not you have that file.
"android-database-sqlcipher-3.5.9.aar"

V1.60
It only works with (android-database-sqlcipher-4.0.0.aar), nor is it interested in the file "android-database-sqlcipher-3.5.9.aar"

Maybe we are talking about different bookstores.
 
Last edited by a moderator:
Upvote 0

Duque

Active Member
Licensed User
Longtime User
1. Configure the additional libraries folder
C:\B4X_LIBRERIAS\B4A
2.png


2. Add v1.60, xml v1.50 and android-database-sqlcipher-3.5.9.aar
1.png

3. This is what I understood in point 2 of your answer
3.png

4. the new error
4.png
 
Upvote 0

Duque

Active Member
Licensed User
Longtime User
Thanks DonManfred somehow enlightened me this was what I did in the xml
HTML:
<dependsOn> android-database-sqlcipher-3.5.9.aar </ dependsOn>

The database worked
 
Upvote 0
Top