Panagiotis Triantafyllou

db fixes, new version

......@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4p10'
PUBLISH_VERSION = '4.5.5.4p11'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -107,9 +107,9 @@ dependencies {
implementation 'com.huawei.hms:maps-basic:6.9.0.300'
//------------------------------ SQLCipher -----------------------------//
api "net.zetetic:android-database-sqlcipher:4.5.2"
api "androidx.sqlite:sqlite:2.2.0"
api 'com.getkeepsafe.relinker:relinker:1.4.4'
api "net.zetetic:android-database-sqlcipher:4.5.4"
api "androidx.sqlite:sqlite:2.5.1"
api 'com.getkeepsafe.relinker:relinker:1.4.5'
//------------------------------ Calligraphy -----------------------------//
// api 'io.github.inflationx:calligraphy3:3.1.1'
......
......@@ -258,8 +258,8 @@
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- <provider-->
<!-- android:name=".utils.WarplyProvider"-->
<!-- android:authorities="ly.warp.sdk.utils.WarplyProvider" />-->
<provider
android:name=".utils.WarplyProvider"
android:authorities="ly.warp.sdk.utils.WarplyProvider" />
</application>
</manifest>
\ No newline at end of file
......
......@@ -2,6 +2,7 @@ package ly.warp.sdk.utils;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
......@@ -9,6 +10,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import ly.warp.sdk.db.WarplyDBHelper;
/**
* Created by Panagiotis Triantafyllou on 05/Αυγ/2022.
*/
......@@ -16,7 +19,14 @@ public class WarplyProvider extends ContentProvider {
@Override
public boolean onCreate() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
// AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
// Initialize the database helper
Context context = getContext();
if (context != null) {
WarplyDBHelper dbHelper = WarplyDBHelper.getInstance(context);
dbHelper.initialize(); // This will initialize the database connection on a background thread
}
// ViewPump.init(ViewPump.builder()
// .addInterceptor(new CalligraphyInterceptor(
// new CalligraphyConfig.Builder()
......@@ -34,6 +44,18 @@ public class WarplyProvider extends ContentProvider {
return true;
}
@Override
public void shutdown() {
// Get the database helper instance and shut it down
Context context = getContext();
if (context != null) {
WarplyDBHelper dbHelper = WarplyDBHelper.getInstance(context);
dbHelper.shutdown();
}
super.shutdown();
}
@Nullable
@Override
public Cursor query(@NonNull Uri uri, @Nullable String[] strings, @Nullable String s, @Nullable String[] strings1, @Nullable String s1) {
......