Android Question SQLCipher library 2.30 issue Android 6.0

tucano2000

Active Member
Licensed User
Longtime User
My application was running smoothly in previous versions of Android , but after receiving messages from users who have upgraded to Android 6 and I take the test in the emulator that android version of the log returned in B4A is shown below :


B4X:
main_activity_create (B4A line: 517)
SQL1.Initialize(File.DirInternal, "config_geral
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "EVP_CipherFinal" referenced by "/data/app/com.infranote-1/lib/arm/libsqlcipher_android.so"...
    at java.lang.Runtime.loadLibrary(Runtime.java:372)
    at java.lang.System.loadLibrary(System.java:1076)
    at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:143)
    at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:137)
    at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:50)
    at com.infranote.main._activity_create(main.java:906)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at com.infranote.main.afterFirstLayout(main.java:102)
    at com.infranote.main.access$000(main.java:17)
    at com.infranote.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

My B4A IDE is v5.20 and SQLCipher library is v 1.20.

Related issues:

https://discuss.zetetic.net/t/sqlcipher-at-android-marshmallow/796
https://discuss.zetetic.net/t/sqlcipher-for-android-3-3-1-1-release/806

https://www.zetetic.net/sqlcipher/open-source/

I think that this library 1.20 in B4A needs update. (https://www.b4x.com/android/forum/threads/android-database-encryption-with-sqlcipher-library.14965/)
 
Last edited:

tucano2000

Active Member
Licensed User
Longtime User
This library 1.30 here in Android device and emulator does my test app close when initialize SQL in Android 4, 5 or 6.

i do all the steps:




What am I doing wrong? The library is ok ?

my source code.

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
    #DebuggerForceStandardAssets: true
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim SQL1 As SQL
    Dim SQL2 As SQLCipher
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    SQL2.Initialize(File.DirInternal,"Test.db",True,"1234","")   '**** HERE APPLICATION CLOSE *****
    SQL2.ExecNonQuery("CREATE TABLE IF NOT EXISTS test (test123 TEXT null)")
    SQL2.Close
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Last edited:
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
Don't test it on the emulator. It will not work.

Which error do you get on the real device?

App close but no log error on real device Android 5. if i go back old libraries this application works. it occurs when initialize sql in debug mode is possible to see.
 
Last edited:
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
Is possible to see application close in debug mode in this line

SQL2.Initialize(File.DirInternal,"Test.db",True,"1234","")

and not continue to the next line.
 
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
My log:

LogCat connected to: xxxxxxxxxx
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **


Only this
 
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
i change the code:

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Log("First Line OK")
SQL2.Initialize(File.DirInternal,"Test.db",True,"1234","")
Log("Second line OK")
SQL2.ExecNonQuery("CREATE TABLE IF NOT EXISTS test (test123 TEXT null)")
Log("Create database OK")
SQL2.Close
Log("Works!!!")
End Sub


Log (b4A IDE don't show error message in log):

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
First Line OK

I forgot to comment this warning message:

file icudt46l.zip is not used. (warning #15)
 
Last edited:
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
unchecking filter log


 
Last edited:
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
Thank Erel, my little code works now in Android 5.

I will be testing Android 6 and later will bring the results.
 
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
Confirmed the library's operation in Android 5. I still can not get my android 6.0 emulator working again. I'm having trouble with this emulator 6.0 on my pc.

I have other questions:

1) The database V3 SQLCipher 130 is slower than 1.20 using SELECT or others commands. About 3 times or more. it was the tests I ran here with another application. Is there any way to speed this up using in memory: memory: or other resource?

2) The version v2 or SQLCipher 1.20 will never be done support for Android 6.0? Why it was abandoned?
 
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
Ok Erel. I solved the problem of performance creating indexes in database tables and avoiding excessive opening and closing of the database because I realized that this process is also slower in version 3. Basic, but to me it was not necessary before. Stay there as a tip for those interested.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…