Hi Luca,
Depending on which version of the Android binaries you downloaded, this
could be the cause of the issue you are seeing. If you built sqlcipher
from a recent git clone you would be using the new database format which
included page level HMAC. The 1.1 version of the library available on
SQLCipher for Android is compiled against an older version of sqlcipher
and would cause an issue. A simple check to identify what binary
version you have; if the package name you import on Java is
info.guardianproject.* this is from the 1.1 library.
If this is the case, you can download the release candidate binaries [1]
which are built against the newer sqlcipher database format. You will
want to upgrade all of the files provided in the zip, including updating
you import statements. Could you give this a try and let us know your
results? Thanks!
1.
https://github.com/downloads/sqlcipher/android-database-sqlcipher/SQLCipher%20for%20Android%202.0.0-RC5.zip
On 5/8/12 12:11 PM, Luca wrote:
> I should have specified better the situation maybe. Anyway thanks for
> your help!
>
> 1. Yes, the database exists. I created it using SQLCipher reading a
> dump after specifying the key on a Linux machine. Seems to work fine
> there.
> 2. I compiled for Linux with sources from the git.
> 3. I downloaded the last version compiled for Android (didn't compile
> it myself). Same for iOS, taken from the git at the same time. How
> can I check the version of the lib and of the sources? I can only
> find the version if SQLite. Is it different from the version of
> SQLCipher?
> 4. My Java class is loading explicitly the two libraries of SQLCipher,
> so I guess yes, it shouldn't load the system's SQLite.
> 5. I have two libraries (stlport_shared and sqlcipher_android). Also,
> consider that everything is working correctly if no password is
> specified. If I don't load those libs, I get an UnsatisfiedLinkError
> exception for my C library.
> 6. Yes sorry, that is the piece of code I'm testing, I commonly place
> the ' around, but I also tried without, escaped and not, just in case.
> 7. I tried this way: sqlite3_exec(db, "pragma KEY='mykey';", NULL,
--
Nick Parker