Rusty Well-Known Member Licensed User Longtime User Nov 15, 2015 #1 I'm using an sqlcipher database v1.2 which is readable with an older program, but I'm trying to read the database with the test program from here . Each time I try to open the database, it gives an error "Not an error" and the database won't open. Any suggestions are greatly appreciated. I've included the file icudt46l.zip in my assets; I've supplied the correct password (verified); I've included both libraries SQL and SQLCipher; when I try to open the file with: Code: Copy Dim SQL1 as SQLCipher ... If SQL1.IsInitialized = False Then Try SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, SQLiteKey, File.DirAssets ) Catch SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, "", File.DirAssets ) End Try End If I get the error message: Not an error ** Activity (main) Create, isFirst = true ** Error occurred on line: 129 (Main) net.sqlcipher.database.SQLiteException: not an error at net.sqlcipher.database.SQLiteDatabase.dbopen(Native Method) at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1951) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:901) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:948) at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:742) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134) at b4a.sqlitelight3.main.afterFirstLayout(main.java:102) at b4a.sqlitelight3.main.access$000(main.java:17) at b4a.sqlitelight3.main$WaitForLayout.run(main.java:80) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method) Click to expand...
I'm using an sqlcipher database v1.2 which is readable with an older program, but I'm trying to read the database with the test program from here . Each time I try to open the database, it gives an error "Not an error" and the database won't open. Any suggestions are greatly appreciated. I've included the file icudt46l.zip in my assets; I've supplied the correct password (verified); I've included both libraries SQL and SQLCipher; when I try to open the file with: Code: Copy Dim SQL1 as SQLCipher ... If SQL1.IsInitialized = False Then Try SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, SQLiteKey, File.DirAssets ) Catch SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, "", File.DirAssets ) End Try End If I get the error message: Not an error ** Activity (main) Create, isFirst = true ** Error occurred on line: 129 (Main) net.sqlcipher.database.SQLiteException: not an error at net.sqlcipher.database.SQLiteDatabase.dbopen(Native Method) at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1951) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:901) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:948) at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:742) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134) at b4a.sqlitelight3.main.afterFirstLayout(main.java:102) at b4a.sqlitelight3.main.access$000(main.java:17) at b4a.sqlitelight3.main$WaitForLayout.run(main.java:80) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method) Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2015 #2 How did you create the database? Upvote 0
Rusty Well-Known Member Licensed User Longtime User Nov 15, 2015 #3 I have a "base" file in my assets folder that is an Encrypted SQLite database with no tables. I copy it to the final location and then create the tables. In this program, I have copied the database with tables and data within to the final location. (currently this database is working in my main application). I'm sure it is something I'm failing to do. Included libs SQL and SQLCipher assets contains the file icudt46l.zip Declared: Dim SQL1 as SQlCipher opened as above.. Is there something I'm forgetting? I've re-tested the database with an existing (production) program and it works fine. Thanks Erel Upvote 0
I have a "base" file in my assets folder that is an Encrypted SQLite database with no tables. I copy it to the final location and then create the tables. In this program, I have copied the database with tables and data within to the final location. (currently this database is working in my main application). I'm sure it is something I'm failing to do. Included libs SQL and SQLCipher assets contains the file icudt46l.zip Declared: Dim SQL1 as SQlCipher opened as above.. Is there something I'm forgetting? I've re-tested the database with an existing (production) program and it works fine. Thanks Erel
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2015 #4 Make sure to go over the steps from the tutorial: https://www.b4x.com/android/forum/threads/android-database-encryption-with-sqlcipher-library.14965/ Maybe you didn't add the required attribute. Upvote 0
Make sure to go over the steps from the tutorial: https://www.b4x.com/android/forum/threads/android-database-encryption-with-sqlcipher-library.14965/ Maybe you didn't add the required attribute.