Skip to content

Commit 1c6d220

Browse files
RMET-3602 ::: Update sqlcipher for 16KB page alignment (#14)
* fix: Update sqlcypher to new location and latest version References: - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * fix: Add missing sqlite DB version References: - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * Revert "fix: Add missing sqlite DB version" This reverts commit 849e78d. * fix: Changes related to migrating sqlcipher library References: - https://www.zetetic.net/sqlcipher/sqlcipher-for-android-migration/ - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * chore: Remove unused custom aar References: - https://www.zetetic.net/sqlcipher/sqlcipher-for-android-migration/ - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * chore: Update CHANGES.md References: - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * fix: Add missing mavencentral repo for sqlcipher dependency References: - https://outsystemsrd.atlassian.net/browse/RMET-3602 - https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment * chore(release): raise to version 0.1.7-OS9 References: https://outsystemsrd.atlassian.net/browse/RMET-3844 --------- Co-authored-by: Alexandre Jacinto <alexandre.jacinto@outsystems.com>
1 parent d20a70a commit 1c6d220

7 files changed

Lines changed: 21 additions & 14 deletions

File tree

CHANGES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changes
22

3-
## unreleased
3+
## cordova-sqlcipher-adapter 0.1.7-OS9
4+
5+
- Update SQLCipher to 4.6.1, with support for 16KB page size devices (https://outsystemsrd.atlassian.net/browse/RMET-3602)
6+
7+
## cordova-sqlcipher-adapter 0.1.7-OS8
48

59
- Update for SQLCipher 4.4.2 and SQLite 3.33.0
610

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-OS8",
3+
"version": "0.1.7-OS9",
44
"description": "SQLCipher database adapter for PhoneGap/Cordova, based on cordova-sqlite-storage",
55
"cordova": {
66
"id": "cordova-sqlcipher-adapter",

plugin.xml

Lines changed: 2 additions & 2 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-OS8">
5+
version="0.1.7-OS9">
66

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

@@ -37,7 +37,7 @@
3737
<source-file src="src/android/io/sqlc/SQLitePlugin.java" target-dir="src/io/sqlc"/>
3838
<source-file src="src/android/io/sqlc/SQLiteAndroidDatabase.java" target-dir="src/io/sqlc"/>
3939

40-
<lib-file src="src/android/libs/android-database-sqlcipher-4.5.4-custom.aar" />
40+
<framework src="net.zetetic:sqlcipher-android:4.6.1" />
4141
<!-- androidx.sqlite now required -->
4242
<framework src="androidx.sqlite:sqlite:2.1.0" />
4343
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />

src/android/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
repositories {
2+
mavenCentral()
3+
}
4+
15
dependencies{
2-
implementation files("libs/android-database-sqlcipher-4.5.4-custom.aar")
6+
implementation "net.zetetic:sqlcipher-android:4.6.1@aar"
37
}

src/android/io/sqlc/SQLiteAndroidDatabase.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
package io.sqlc;
88

99
// SQLCipher version of database classes:
10-
import net.sqlcipher.*;
11-
import net.sqlcipher.database.*;
10+
import net.zetetic.database.sqlcipher.*;
1211

1312
/* ** NOT USED in this plugin version:
1413
import android.database.Cursor;
@@ -20,6 +19,7 @@
2019
import android.database.sqlite.SQLiteStatement;
2120
// */
2221

22+
import android.database.Cursor;
2323
import android.database.sqlite.SQLiteConstraintException;
2424
import android.database.sqlite.SQLiteException;
2525
import android.util.Log;
@@ -70,10 +70,9 @@ class SQLiteAndroidDatabase
7070
/**
7171
* to load native lib(s)
7272
*/
73-
//@Override
7473
static
75-
public void initialize(CordovaInterface cordova) {
76-
SQLiteDatabase.loadLibs(cordova.getActivity());
74+
public void initialize() {
75+
System.loadLibrary("sqlcipher");
7776
}
7877

7978
/**
@@ -87,9 +86,9 @@ void open(File dbfile, String key, boolean migrateCipher) throws Exception {
8786
SQLiteDatabaseHook hook = null;
8887
if(migrateCipher) {
8988
hook = new SQLiteDatabaseHook() {
90-
public void preKey(SQLiteDatabase database) {}
91-
public void postKey(SQLiteDatabase database) {
92-
database.rawExecSQL("PRAGMA cipher_migrate");
89+
public void preKey(SQLiteConnection connection) {}
90+
public void postKey(SQLiteConnection connection) {
91+
connection.executeRaw("PRAGMA cipher_migrate", null, null);
9392
}
9493
};
9594
}

src/android/io/sqlc/SQLitePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
7676
super.initialize(cordova, webView);
7777
logger = OSLogger.getInstance();
7878
selfHealingEnabled = preferences.getBoolean("EnableSQLCipherSelfHealing", false);
79-
SQLiteAndroidDatabase.initialize(cordova);
79+
SQLiteAndroidDatabase.initialize();
8080
}
8181

8282

-6.37 MB
Binary file not shown.

0 commit comments

Comments
 (0)