Skip to content

Commit 3e568e7

Browse files
fix(logging): CloudWatch Plugin 16KB page size support (#2919)
Co-authored-by: Vincent Tran <[email protected]>
1 parent fe0c468 commit 3e568e7

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

aws-logging-cloudwatch/src/main/java/com/amplifyframework/logging/cloudwatch/db/CloudWatchDatabaseHelper.kt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@
1515
package com.amplifyframework.logging.cloudwatch.db
1616

1717
import android.content.Context
18-
import net.sqlcipher.database.SQLiteDatabase
19-
import net.sqlcipher.database.SQLiteOpenHelper
18+
import net.zetetic.database.sqlcipher.SQLiteDatabase
19+
import net.zetetic.database.sqlcipher.SQLiteOpenHelper
2020

21-
internal class CloudWatchDatabaseHelper(context: Context) :
22-
SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {
21+
internal class CloudWatchDatabaseHelper(context: Context, databasePassphrase: String) :
22+
SQLiteOpenHelper(
23+
context,
24+
DATABASE_NAME,
25+
databasePassphrase,
26+
null,
27+
DATABASE_VERSION,
28+
0,
29+
null,
30+
null,
31+
false
32+
) {
2333

2434
companion object {
2535
internal const val DATABASE_NAME = "amplify.logging.cloudwatch.db"

aws-logging-cloudwatch/src/main/java/com/amplifyframework/logging/cloudwatch/db/CloudWatchLoggingDatabase.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import java.util.UUID
2626
import kotlinx.coroutines.CoroutineDispatcher
2727
import kotlinx.coroutines.Dispatchers
2828
import kotlinx.coroutines.withContext
29-
import net.sqlcipher.database.SQLiteQueryBuilder
29+
import net.zetetic.database.sqlcipher.SQLiteQueryBuilder
3030

3131
internal class CloudWatchLoggingDatabase(
3232
private val context: Context,
@@ -44,7 +44,7 @@ internal class CloudWatchLoggingDatabase(
4444
}
4545
private val database by lazy {
4646
System.loadLibrary("sqlcipher")
47-
CloudWatchDatabaseHelper(context).getWritableDatabase(getDatabasePassphrase())
47+
CloudWatchDatabaseHelper(context, getDatabasePassphrase()).writableDatabase
4848
}
4949
private val basePath = "cloudwatchlogevents"
5050
private val contentUri: Uri

aws-logging-cloudwatch/src/main/java/com/amplifyframework/logging/cloudwatch/db/LogEventTable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
package com.amplifyframework.logging.cloudwatch.db
1616

17-
import net.sqlcipher.database.SQLiteDatabase
17+
import net.zetetic.database.sqlcipher.SQLiteDatabase
1818

1919
internal class LogEventTable {
2020
companion object {

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ subprojects {
8383
allow("BSD-2-Clause")
8484
allow("CC0-1.0")
8585
allowUrl("https://developer.android.com/studio/terms.html")
86-
allowDependency("net.zetetic", "android-database-sqlcipher", "4.5.4") {
86+
allowDependency("net.zetetic", "sqlcipher-android", "4.6.1") {
8787
because("BSD style License")
8888
}
8989
allowDependency("org.jetbrains", "annotations", "16.0.1") {

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ okhttp = "5.0.0-alpha.11"
4747
robolectric = "4.7"
4848
rxjava = "3.0.6"
4949
slf4j = "2.0.6"
50-
sqlcipher = "4.5.4"
50+
sqlcipher = "4.6.1"
5151
tensorflow = "2.0.0"
5252
uuid = "4.0.1"
5353
totp = "1.0.1"
@@ -102,7 +102,7 @@ oauth2 = { module = "com.google.auth:google-auth-library-oauth2-http", version.r
102102
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
103103
rxjava = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava" }
104104
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j"}
105-
sqlcipher= { module = "net.zetetic:android-database-sqlcipher", version.ref = "sqlcipher" }
105+
sqlcipher= { module = "net.zetetic:sqlcipher-android", version.ref = "sqlcipher" }
106106
tensorflow = { module = "org.tensorflow:tensorflow-lite", version.ref="tensorflow" }
107107
uuidgen = { module = "com.fasterxml.uuid:java-uuid-generator", version.ref="uuid" }
108108

0 commit comments

Comments
 (0)