Skip to content

Commit d20a70a

Browse files
authored
RMET-2843 ::: SQLite 3.40.1 Update (#13)
* feat: updated sqlite to 3.40.1 * feat: added mising AAR * updated versions * test: bump plugin version * fix: fixed aar name * feat: updated android-database-sqlcipher to 4.5.4 custom build * feat: updated android-database-sqlcipher to 4.5.4 custom build * fix: added missing build.gradle * fix: updated iOS sqlite3 amalgamation
1 parent b037892 commit d20a70a

11 files changed

Lines changed: 95088 additions & 80753 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-sqlcipher-adapter",
3-
"version": "0.1.7-OS7",
3+
"version": "0.1.7-OS8",
44
"description": "SQLCipher database adapter for PhoneGap/Cordova, based on cordova-sqlite-storage",
55
"cordova": {
66
"id": "cordova-sqlcipher-adapter",

plugin.xml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
id="cordova-sqlcipher-adapter"
5-
version="0.1.7-OS7">
5+
version="0.1.7-OS8">
66

77
<name>Cordova sqlcipher adapter</name>
88

@@ -27,6 +27,7 @@
2727
<!-- android -->
2828
<platform name="android">
2929
<!-- Cordova >= 3.0.0 -->
30+
3031
<config-file target="res/xml/config.xml" parent="/*">
3132
<feature name="SQLitePlugin">
3233
<param name="android-package" value="io.sqlc.SQLitePlugin"/>
@@ -36,20 +37,11 @@
3637
<source-file src="src/android/io/sqlc/SQLitePlugin.java" target-dir="src/io/sqlc"/>
3738
<source-file src="src/android/io/sqlc/SQLiteAndroidDatabase.java" target-dir="src/io/sqlc"/>
3839

39-
<lib-file src="src/android/libs/android-database-sqlcipher-classes.jar" />
40-
<lib-file src="src/android/libs/android-database-sqlcipher-ndk.jar" />
40+
<lib-file src="src/android/libs/android-database-sqlcipher-4.5.4-custom.aar" />
4141
<!-- androidx.sqlite now required -->
4242
<framework src="androidx.sqlite:sqlite:2.1.0" />
43+
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />
4344

44-
<!-- [FUTURE TBD] consider using external aar again -->
45-
<!-- THANKS to @jcesarmobile for GUIDANCE in accepted answer:
46-
https://stackoverflow.com/questions/34115571/add-external-jar-library-to-build-cordova-plugin-ionic-framework/34129929#34129929
47-
-->
48-
<!-- SQLCipher distribution for Android
49-
[sqlcipher.jar & ndk objects in aar (modified reference for Buildr)] from:
50-
https://mvnrepository.com/artifact/net.zetetic/android-database-sqlcipher/4.3.0
51-
<framework src="net.zetetic:android-database-sqlcipher:4.3.0" />
52-
- -->
5345
</platform>
5446

5547
<!-- iOS -->

spec/www/spec/sqlite-version-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ var mytests = function() {
107107

108108
// Check specific SQLCipher version on plugin
109109
if (isAndroid) // (android-database-sqlcipher)
110-
expect(rs.rows.item(0).myResult).toBe('3.33.0');
110+
expect(rs.rows.item(0).myResult).toBe('3.40.1');
111111
else // SQLCipher for iOS/macOS/...
112-
expect(rs.rows.item(0).myResult).toBe('3.33.0');
112+
expect(rs.rows.item(0).myResult).toBe('3.40.1');
113113

114114
// Close (plugin only) & finish:
115115
(isWebSql) ? done() : db.close(done, done);
@@ -138,9 +138,9 @@ var mytests = function() {
138138

139139
// Check specific SQLCipher version on plugin
140140
if (isAndroid) // (android-database-sqlcipher)
141-
expect(rs.rows.item(0).cipher_version).toBe('4.4.2 community');
141+
expect(rs.rows.item(0).cipher_version).toBe('4.5.4 community');
142142
else // SQLCipher for iOS/macOS/...
143-
expect(rs.rows.item(0).cipher_version).toBe('4.4.2 community');
143+
expect(rs.rows.item(0).cipher_version).toBe('4.5.4 community');
144144

145145
// Close (plugin only) & finish:
146146
(isWebSql) ? done() : db.close(done, done);

src/android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies{
2+
implementation files("libs/android-database-sqlcipher-4.5.4-custom.aar")
3+
}

src/android/io/sqlc/SQLiteAndroidDatabase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import android.database.sqlite.SQLiteStatement;
2121
// */
2222

23+
import android.database.sqlite.SQLiteConstraintException;
24+
import android.database.sqlite.SQLiteException;
2325
import android.util.Log;
2426

2527
import java.io.File;

src/android/io/sqlc/SQLitePlugin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
package io.sqlc;
88

9+
import android.database.sqlite.SQLiteException;
910
import android.util.Log;
1011

1112
import com.outsystems.plugins.oslogger.OSLogger;
1213
import com.outsystems.plugins.oslogger.interfaces.Logger;
1314

14-
import net.sqlcipher.database.SQLiteException;
15-
1615
import java.io.File;
1716

1817
import java.lang.IllegalArgumentException;
6.37 MB
Binary file not shown.
-121 KB
Binary file not shown.
-5.49 MB
Binary file not shown.

0 commit comments

Comments
 (0)