Yes. The database created by the android the android can read, but our windows app cannot.
Basically each side (windows and android) can create an sqlcipher database with the same password and can read it's own creation, but cannot read the database created by the other side.
Here is the android code I'm using...
Dim dir As String = "/mnt/sdcard/survey/data"
Dim filename As String = "sqlcipher.db3"
SQL.Initialize(dir, filename, True, "test123", File.DirAssets )
SQL.ExecNonQuery ("CREATE TABLE t1(a,b);")
SQL.ExecNonQuery ("INSERT INTO t1(a,b) VALUES ('test0', 'test1');" )
SQL.Close
SQL.Initialize(dir, filename, True, "test123", File.DirAssets )
Dim cursor1 As Cursor = SQL.ExecQuery("SELECT * FROM t1;" )
If cursor1.RowCount > 0 Then
cursor1.Position = 0
Msgbox(cursor1.GetString("a"),"title")
End If
On the PC side we're using the following code:
Private Shared _connectionString As String = "Data Source=c:\share\sqlcipher.db3;Pooling=false;Synchronous=Full;"
Private Shared _password As String = "test123"
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Using conn = New SQLiteConnection(_connectionString)
conn.SetPassword(_password)
conn.Open()
Using cmd = conn.CreateCommand()
cmd.CommandText = "CREATE TABLE t1(a,b);"
cmd.ExecuteNonQuery()
cmd.CommandText = "INSERT INTO t1(a,b) VALUES ('test0', 'test1');"
cmd.ExecuteNonQuery()
End Using
conn.Close()
End Using
Using conn = New SQLiteConnection(_connectionString)
conn.SetPassword(_password)
conn.Open()
Using cmd = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM t1;"
Try
Dim reader = cmd.ExecuteReader()
While reader.Read()
Debug.Print(String.Format("{0} | {1}", reader.GetString(0), reader.GetString(1)))
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Using
conn.Close()
End Using
End Sub
The windows side is using version 91.0.80.0 of sqlcipher library.
It looks like both sides work, but are not compatible with each other. Is there a certain version of the sqlcipher libs that we should be using to be compatible with the android version?