Hi I am using net.sqlcipher to encrypt my app data...
# android
h
Hi I am using net.sqlcipher to encrypt my app database, we are getting device specific crashes logged in firebase in field, logs are pasted below, suggestions will be appreciated Fatal Exception: java.lang.IllegalStateException database not open  (SQLiteDatabase.java:109)  (AndroidSqliteDriver.java:6)  (Transacter.java:6)  (TransacterImpl.java:25)  (TransacterImpl.java:5)  (TransactionExternsionsKt.java:16) Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.philips.phsleep-reJnoXvYSDyN5sVbGFw0mQ==/base.apk”],nativeLibraryDirectories=[/data/app/com.philips.phsleep-reJnoXvYSDyN5sVbGFw0mQ==/lib/x86, /system/lib, /vendor/lib]]] couldn’t find “libsqlcipher.so” at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at net.sqlcipher.database.SQLiteDatabase$1.loadLibraries(SQLiteDatabase.java:6) at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:9) at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:8) at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:7) at net.sqlcipher.database.SupportHelper.<init>(SupportHelper.java:5) at net.sqlcipher.database.SupportFactory.create(SupportFactory.java:8) at com.squareup.sqldelight.android.AndroidSqliteDriver.<init>(AndroidSqliteDriver.java:2) at com.squareup.sqldelight.android.AndroidSqliteDriver.<init>(AndroidSqliteDriver.java:55) at com.hp.sleep.shared.datasource.DataSourceProvider.open(DataSourceProvider.java:76) at com.philips.phsleep.SleepApplication.openDB(SleepApplication.java:9)
😶 7
😂 2
m
This feels like this is tied to SQLCipher for Android, and you can get support for that at https://discuss.zetetic.net/c/sqlcipher/5. Off the cuff, it seems like perhaps you're shipping SQLCipher for Android without x86 binaries, and it is being used on an x86 machine.
d
I've had similar issues. I had always assumed the App was downloaded from the Play Store. We provide a bundle, so Google filters out the libraries that aren't necessary for the target device. The resulting APK is uploading to various mirror sites. That APK is then completely useless for any device except the one that runs the same original target architecture.
h
Thanks @David Edwards and @Mark Murphy, finally i found the solution, issue was with proguard scripts, # These rules instruct ProGuard to omit the renaming of the internal SQLCipher classes # which are used via lookup from the JNI layer -keep,includedescriptorclasses class net.sqlcipher.** { ; } -keep,includedescriptorclasses interface net.sqlcipher.* { *; }