storesafe / cordova-sqlcipher-adapter

A Cordova/PhoneGap plugin to create and access encrypted databases on Android, iOS, and Windows with API similar to HTML5/Web SQL API
Other
89 stars 55 forks source link

SQLITE_OMIT_DEPRECATED build flag on Android #82

Open brodycj opened 5 years ago

brodycj commented 5 years ago

When I tried this flag on sqlcipher / android-database-sqlcipher I got the following errors:

/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/obj/local/armeabi/objs/sqlcipher/net_sqlcipher_database_SQLiteDatabase.o: In function `sqlcipher::dbclose(_JNIEnv*, _jobject*)':
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp:303: undefined reference to `sqlite3_trace'
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp:308: undefined reference to `sqlite3_profile'
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/obj/local/armeabi/objs/sqlcipher/net_sqlcipher_database_SQLiteDatabase.o: In function `sqlcipher::enableSqlTracing(_JNIEnv*, _jobject*, _jstring*)':
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp:280: undefined reference to `sqlite3_trace'
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/obj/local/armeabi/objs/sqlcipher/net_sqlcipher_database_SQLiteDatabase.o: In function `sqlcipher::enableSqlProfiling(_JNIEnv*, _jobject*, _jstring*)':
/Users/brodybits/Documents/cbwork/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp:292: undefined reference to `sqlite3_profile'

As described in https://www.sqlite.org/c3ref/profile.html the solution is for sqlcipher / android-database-sqlcipher to use sqlite3_trace_v2 with SQLITETRACE constants (https://www.sqlite.org/c3ref/c_trace.html) instead of sqlite3_trace and sqlite3_profile in android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp.