Skip to content
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

fix(logging): CloudWatch Plugin 16KB page size support #2919

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@
package com.amplifyframework.logging.cloudwatch.db

import android.content.Context
import net.sqlcipher.database.SQLiteDatabase
import net.sqlcipher.database.SQLiteOpenHelper
import net.zetetic.database.sqlcipher.SQLiteDatabase
import net.zetetic.database.sqlcipher.SQLiteOpenHelper

internal class CloudWatchDatabaseHelper(context: Context) :
SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {
internal class CloudWatchDatabaseHelper(context: Context, databasePassphrase: String) :
SQLiteOpenHelper(
context,
DATABASE_NAME,
databasePassphrase,
null,
DATABASE_VERSION,
0,
null,
null,
false
) {

companion object {
internal const val DATABASE_NAME = "amplify.logging.cloudwatch.db"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.util.UUID
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import net.sqlcipher.database.SQLiteQueryBuilder
import net.zetetic.database.sqlcipher.SQLiteQueryBuilder

internal class CloudWatchLoggingDatabase(
private val context: Context,
Expand All @@ -44,7 +44,7 @@ internal class CloudWatchLoggingDatabase(
}
private val database by lazy {
System.loadLibrary("sqlcipher")
CloudWatchDatabaseHelper(context).getWritableDatabase(getDatabasePassphrase())
CloudWatchDatabaseHelper(context, getDatabasePassphrase()).writableDatabase
}
private val basePath = "cloudwatchlogevents"
private val contentUri: Uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package com.amplifyframework.logging.cloudwatch.db

import net.sqlcipher.database.SQLiteDatabase
import net.zetetic.database.sqlcipher.SQLiteDatabase

internal class LogEventTable {
companion object {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ okhttp = "5.0.0-alpha.11"
robolectric = "4.7"
rxjava = "3.0.6"
slf4j = "2.0.6"
sqlcipher = "4.5.4"
sqlcipher = "4.6.1"
tensorflow = "2.0.0"
uuid = "4.0.1"
totp = "1.0.1"
Expand Down Expand Up @@ -98,7 +98,7 @@ oauth2 = { module = "com.google.auth:google-auth-library-oauth2-http", version.r
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
rxjava = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava" }
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j"}
sqlcipher= { module = "net.zetetic:android-database-sqlcipher", version.ref = "sqlcipher" }
sqlcipher= { module = "net.zetetic:sqlcipher-android", version.ref = "sqlcipher" }
tensorflow = { module = "org.tensorflow:tensorflow-lite", version.ref="tensorflow" }
uuidgen = { module = "com.fasterxml.uuid:java-uuid-generator", version.ref="uuid" }

Expand Down
Loading