-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compile for Android use? #18
Comments
Unfortunately, I have no experience with developing for Android, so I can't give you much advice how to solve your issue. However, the SQLite Android documentation might give you some hints. Especially, read the section about SEE - SQlite Encryption Extension, since the encryption extension coming with Good luck! |
Hi @lshAndroid ! I have not yet updated the repo with the lastest version. The version for the moment is 3.18.0. Good luck ! |
Hi @lshAndroid ! Below is the process about how to use wxSqlite on android. 0x01. compiling sqlite3.c
0x02. write your jni code use wxsqlite
the wxSqlite interface same with sqlite3.
|
Since @iamcxl369 described in detail, how to use the wxSQLite3 encryption extension in Android applications, I'm going to close this issue. |
Download SQLite3MultipleCiphers, Open /build/sqlite3mc_vc17.sln by visual studio 2022, then build sql3mc_dll. Create a jni folder, create Android.mk , paste the content LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= sqlite3
LOCAL_MODULE_FILENAME := sqlite3
LOCAL_SRC_FILES:= sqlite3mc.c
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_C_INCLUDES := $(LOCAL_PATH)
include $(BUILD_SHARED_LIBRARY) COPY and paste all source file into jni folder. (copy from SQLite3MultipleCiphers/src) No need to cd jni , just keep current directory. Run "ndk-build" (before this , you must have downloaded the ndk and added it to your environment PATH) Put /libs/arm64-v8a and /libs/armeabi-v7a into /Assets/Plugins/Android (For Unity3d) Change the method name : //[DllImport( "sqlite3", EntryPoint = "wxsqlite3_config" )]
//internal static extern int wxsqlite3_config( IntPtr db, string param, int newValue ); To this [DllImport( "sqlite3", EntryPoint = "sqlite3mc_config" )]
internal static extern int sqlite3mc_config( IntPtr db, string param, int newValue ); //[DllImport( "sqlite3", EntryPoint = "wxsqlite3_config_cipher" )]
//internal static extern int wxsqlite3_config_cipher( IntPtr db, string cipherName, string paramName, int newValue ); To this [DllImport( "sqlite3", EntryPoint = "sqlite3mc_config_cipher" )]
internal static extern int sqlite3mc_config_cipher( IntPtr db, string cipherName, string paramName, int newValue ); Everything works now! |
My project SQLite3 Multiple Ciphers started with version 1.3.7 to provide pre-compiled binaries for Android (see latest release). These binaries are built following the installation guide that can be found on the official SQLite Android Bindings web page. Detailed instructions how to build the Android bindings on your own can be found here. |
How to compile for Android use? Not through Cocos2dx framework to use, direct jni call method to make the encrypted database into a decrypted database? Ask for help, Thanks.
The text was updated successfully, but these errors were encountered: