From de7e394844dddf34557c93ded75bb150e7c16a46 Mon Sep 17 00:00:00 2001 From: Roshan Varughese <40583749+Animeboynz@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:28:19 +1200 Subject: [PATCH] Antsy's Patch Co-Authored-By: AntsyLich <59261191+AntsyLich@users.noreply.github.com> --- app/src/dev/java/mihon/core/firebase/Firebase.kt | 7 +++++++ app/src/main/java/eu/kanade/tachiyomi/App.kt | 6 ++---- app/src/standard/AndroidManifest.xml | 9 +++++++++ .../standard/java/mihon/core/firebase/Firebase.kt | 13 +++++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 app/src/dev/java/mihon/core/firebase/Firebase.kt create mode 100644 app/src/standard/java/mihon/core/firebase/Firebase.kt diff --git a/app/src/dev/java/mihon/core/firebase/Firebase.kt b/app/src/dev/java/mihon/core/firebase/Firebase.kt new file mode 100644 index 0000000000..264083fe31 --- /dev/null +++ b/app/src/dev/java/mihon/core/firebase/Firebase.kt @@ -0,0 +1,7 @@ + +import android.content.Context +import eu.kanade.domain.base.BasePreferences + +object Firebase { + fun setup(context: Context, preference: BasePreferences) = Unit +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index c9af1e4106..70a7317a6a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi +import Firebase import android.annotation.SuppressLint import android.app.Application import android.app.PendingIntent @@ -21,13 +22,11 @@ import coil3.network.okhttp.OkHttpNetworkFetcherFactory import coil3.request.allowRgb565 import coil3.request.crossfade import coil3.util.DebugLogger -//import com.google.firebase.crashlytics.FirebaseCrashlytics import dev.mihon.injekt.patchInjekt import eu.kanade.domain.DomainModule import eu.kanade.domain.base.BasePreferences import eu.kanade.domain.ui.UiPreferences import eu.kanade.domain.ui.model.setAppCompatDelegateThemeMode -import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.crash.CrashActivity import eu.kanade.tachiyomi.crash.GlobalExceptionHandler import eu.kanade.tachiyomi.data.coil.BufferedSourceFetcher @@ -69,7 +68,6 @@ import java.security.Security class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factory { private val basePreferences: BasePreferences by injectLazy() - private val securityPreferences: SecurityPreferences by injectLazy() private val networkPreferences: NetworkPreferences by injectLazy() private val disableIncognitoReceiver = DisableIncognitoReceiver() @@ -78,7 +76,7 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor override fun onCreate() { super.onCreate() patchInjekt() - //FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(securityPreferences.crashlytics().get()) + Firebase.setup(applicationContext, basePreferences) GlobalExceptionHandler.initialize(applicationContext, CrashActivity::class.java) diff --git a/app/src/standard/AndroidManifest.xml b/app/src/standard/AndroidManifest.xml index f6a02077a4..9d0be9170f 100644 --- a/app/src/standard/AndroidManifest.xml +++ b/app/src/standard/AndroidManifest.xml @@ -20,6 +20,15 @@ tools:node="remove" /> + + + + + + FirebaseAnalytics.getInstance(context).setAnalyticsCollectionEnabled(enabled) + } + } +}