-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Radoslav,
It sounds as if the there may be an issue with packaging the proper
native libraries using Gradle. Could you try the SQLCipher for
Android test suite [1] using your current devices? Are you able to
run them properly on each platform? It is setup with both ARM and x86
native libraries, however uses a maven instead of Gradle.
[1]
https://github.com/sqlcipher/sqlcipher-android-tests
On 5/5/14, 1:26 AM, Radoslav Chovan wrote:
> Hello,I have strange problem with SQLcipher build for ARM/x86
> device.
>
>
>
>
> When I crypt database with version 2.1.1 and build it with Gradle
> for ARM and x86 (fat client), it run correctly on ARM device, but
> on x86 throws error
>
> *"No implementation found for native
> Lnet/sqlcipher/database/SQLiteDatabase;.native_key ([C)V"*
>
> When I repeat previous steps with version 2.2.2, it runs on x86,
> but on ARM it throws previous error.
>
> With version 3.1.0 is result same as version 2.2.2
>
> Can you help me solve it ?
>
> _This is content of built apk file (filtered res files):_
>
> |unzip -l SKG-fat-debug-unaligned.apk | grep -v res/ Archive:
> SKG-fat-debug-unaligned.apk Length Date Time Name --------
> ---- ---- ---- 113664 05-03-14 22:32 assets/enc.db 2305475
> 05-03-14 22:32 assets/icudt46l.zip 11937 05-04-14 21:17
> assets/postupy.json 7988 05-04-14 21:17 AndroidManifest.xml
> 228184 05-04-14 21:10 resources.arsc 4348908 05-03-14 22:32
> classes.dex 11358 05-04-14 21:17 META-INF/LICENSE.txt 301
> 05-04-14 21:17 META-INF/NOTICE.txt 38544 05-04-14 21:17
> lib/armeabi/libdatabase_sqlcipher.so 21624 05-04-14 21:17
> lib/armeabi/libgenerate.so 1176064 05-04-14 21:17
> lib/armeabi/libsqlcipher_android.so 402604 05-04-14 21:17
> lib/armeabi/libstlport_shared.so 1757156 05-04-14 21:17
> lib/x86/libdatabase_sqlcipher.so 17536 05-04-14 21:17
> lib/x86/libgenerate.so 3520252 05-04-14 21:17
> lib/x86/libsqlcipher_android.so 455740 05-04-14 21:17
> lib/x86/libstlport_shared.so 53292 05-04-14 21:17
> META-INF/MANIFEST.MF 53321 05-04-14 21:17 META-INF/CERT.SF 776
> 05-04-14 21:17 META-INF/CERT.RSA --------
> ------- 17178672 530 files|
>
>
> _This is the error on ARM device:_
> _And on x86 device it opens database correctly._
>
> |05-04 21:22:38.494 1849-1884/
com.my.app D/DeviceID.db﹕
> LastError 05-04 21:22:38.874 1849-1849/
com.my.app
> D/com.my.appfsListActivity$asyncOtvorDB﹕ onPostExecute 05-04
> 21:22:38.890 1849-1849/
com.my.app D/fsListActivity﹕
> DID.LastError: 05-04 21:22:38.890 1849-1849/
com.my.app
> D/com.my.app.skg﹕ ZoznamCS 05-04 21:22:38.902
> 1849-1849/
com.my.app D/cursor is﹕
> net.sqlcipher.CrossProcessCursorWrapper@52aa7f30|
>
>
> _This is my code to create encrypted db:_
>
> |~/Soft/sqlcipher-2.1.1/sqlite3 db.sqlite "ATTACH DATABASE
> 'enc_v211.db' AS encrypted KEY '$dbkey';SELECT
> sqlcipher_export('encrypted');DETACH DATABASE encrypted;"
> ~/Soft/sqlcipher-2.2.1/sqlcipher db.sqlite "ATTACH DATABASE
> 'enc_v221.db' AS encrypted KEY '$dbkey';SELECT
> sqlcipher_export('encrypted');DETACH DATABASE encrypted;"
> ~/Soft/sqlcipher-3.1.0/sqlcipher db.sqlite "ATTACH DATABASE
> 'enc_v310.db' AS encrypted KEY '$dbkey';SELECT
> sqlcipher_export('encrypted');DETACH DATABASE encrypted;"|
>
>
> _Then I copy encrypted db to assets, and this is my code to open
> db:_
>
> | public void OpenDB() {
> skg.logD(Thread.currentThread().getStackTrace()[2].getClassName() ,
> Thread.currentThread().getStackTrace()[2].getMethodName());
>
> String dbname = "enc.db"; String dbpath =
> "/data/data/
com.my.app/databases/"; try { InputStream myInput =
> context.getAssets().open(dbname); String outFileName = dbpath +
> dbname; OutputStream myOutput = new FileOutputStream(outFileName);
> byte[] buffer = new byte[1024]; int length; while ((length =
> myInput.read(buffer)) > 0) { myOutput.write(buffer, 0, length); }
> myOutput.flush(); myOutput.close(); myInput.close(); } catch
> (IOException e) { e.printStackTrace(); }
>
> try { SQLiteDatabase.loadLibs(context); File databaseFile =
> context.getDatabasePath(dbpath + dbname);
> skg.logD("OtvorDB","getDBpath=" + databaseFile.toString());
> DID.context = context; database =
> SQLiteDatabase.openOrCreateDatabase(databaseFile, DID.db(), null);
> //database =
> SQLiteDatabase.openDatabase(databaseFile.getAbsolutePath(),
> DID.db(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS); } catch
> (Exception e) { e.printStackTrace(); skg.logD("OtvorDB",
> e.getMessage() + e.toString() + e.getCause()); }|
>
> As you can see in code, I have tried with openDatabase, and with
> openOrCreateDatabase too.
>
> _This devices I use for test:_
>
> x86 - several devices in Genymotion VM
>
> ARM - 2x real devices, 2x android emulator
>
> _App is built without error:_
> --
>
> --- You received this message because you are subscribed to the
> Google Groups "SQLCipher Users" group. To unsubscribe from this
> group and stop receiving emails from it, send an email to
>
sqlcipher+...@googlegroups.com
> <mailto:
sqlcipher+...@googlegroups.com>. For more options,
> visit
https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQIcBAEBAgAGBQJTZ5JmAAoJEC+HMEgI1AzswLAQAIwj/9dEDewkrETgxEzqsROm
Gyr7wPNNXll1sLBs2oX87mxWJKznuLL/WX/VHEFNMYqE63P0U2eZcaCs2vP78lbt
1UJxEm1BdPbxDZPpVLcwQc7B1j8YWtWGc+ce5SyitWZjbnp2bjpNrw/ShF931Hhf
EjA/qEyoWhJaXuKwOPybzE1eNAWG9+ZmPvHHwvbgU3Lr5D3OCCKFHFwBcb0JMuGU
29zbF0SzF1QPdR1aSR4LR3R0z3cUFJBhSnRz4LU2+RnLymnALeGEHJn1bZTURAFp
PoKZDQtdVzwRf7ibGlBjv9jAyH8QrEEk+RWzv5Ez/RboPC+GTnLeLQKu4horjaQr
rxK0edff0gz7ojqKIUHZv0EHVPDGOyIMeg4Y4QVUGWizUBUEZPQxSO1OHq8fW1At
djGTCRMn1wwyZqpRQlwWToEKpr6x9wfqCuOwej8Z86zwhHfztKDZO6wGabbuirx+
+BgfcoTvxIEdrlc6ll9gNDjbysKUI0yr3wbypfymc1ThtOvta7fvXmFALyKXuU41
ktEpbThjNVUFb66Pz0rqmf4TL0g6U2bWFmKUoziLjralMvb2L7qDnZ71mp68Izds
RmOGfoGZnSrHRYb1PxKhc3hbS/s0+xFWoDnWMNJUSgeNXbLg9GAN2snjaZ9Bae8f
NehPiIU6PUiRP53odDuT
=wW57
-----END PGP SIGNATURE-----