Android Question Migration SQLCiper V1.50 to V1.60

Discussion in 'Android Questions' started by soyVB6, Jul 10, 2019.

  1. soyVB6

    soyVB6 Active Member Licensed 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.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Peter Simpson likes this.
  3. soyVB6

    soyVB6 Active Member Licensed User

    It is impossible for this command to work for me when the BD never starts
    Code:
    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 ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    What happens when you try to open the database?
     
  5. soyVB6

    soyVB6 Active Member Licensed User

    [​IMG]

    Attached small project with that error
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed 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.
     
    soyVB6 likes this.
  7. soyVB6

    soyVB6 Active Member Licensed 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
     
  8. KMatle

    KMatle Expert Licensed User

    Use a tool on your pc or export and load it into the new db or offer a new app version with 1.60 and download the db after install. There are soo many ways to do it.
     
  9. soyVB6

    soyVB6 Active Member Licensed 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...
     
  10. Erel

    Erel Administrator Staff Member Licensed User

  11. soyVB6

    soyVB6 Active Member Licensed 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: Jul 15, 2019
  12. soyVB6

    soyVB6 Active Member Licensed User

    In summary, that file is ignored by both versions...
    [​IMG]
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    1. You should configure the additional libraries folder and use it instead of adding libraries to the internal folder.
    2. Use V1.60 and change the XML file to depend on sqlcipher-3.5.9.aar.
     
    Peter Simpson likes this.
  14. soyVB6

    soyVB6 Active Member Licensed User

    1. Configure the additional libraries folder
    C:\B4X_LIBRERIAS\B4A
    [​IMG]

    2. Add v1.60, xml v1.50 and android-database-sqlcipher-3.5.9.aar
    [​IMG]
    3. This is what I understood in point 2 of your answer
    [​IMG]
    4. the new error
    [​IMG]
     
  15. DonManfred

    DonManfred Expert Licensed User

    why are you using the xml from 1.5? Erel asked you to use v1.6 and change the xml to depend on sqlcipher-3.5.9.aar.

    BTW: You should not post such big images! And you should post ERRORS as TEXT instead of Screenshots!
     
    soyVB6 likes this.
  16. soyVB6

    soyVB6 Active Member Licensed User

    I also tried it and the result was that the IDE did not find the library
    [​IMG]
     
  17. soyVB6

    soyVB6 Active Member Licensed User

    because we try to solve this
     
  18. soyVB6

    soyVB6 Active Member Licensed User

    Sorry I did not see the instruction manual for the publications in the forum, where can I see it?
     
  19. DonManfred

    DonManfred Expert Licensed User

    i dont see a xml there.

    Anyway; good luck
     
    Peter Simpson and soyVB6 like this.
  20. soyVB6

    soyVB6 Active Member Licensed 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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice