Update firebase
This commit is contained in:
@@ -23,6 +23,9 @@ import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
|
||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
||||
import com.google.android.gms.common.GooglePlayServicesRepairableException
|
||||
import com.google.android.gms.security.ProviderInstaller
|
||||
import com.google.firebase.analytics.FirebaseAnalytics
|
||||
import com.google.firebase.analytics.ktx.analytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import com.kizitonwose.time.days
|
||||
import com.ms_square.debugoverlay.DebugOverlay
|
||||
import com.ms_square.debugoverlay.modules.FpsModule
|
||||
@@ -53,10 +56,13 @@ import uy.kohesive.injekt.registry.default.DefaultRegistrar
|
||||
|
||||
open class App : Application(), LifecycleObserver {
|
||||
|
||||
private lateinit var firebaseAnalytics: FirebaseAnalytics
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
||||
setupExhLogging() // EXH logging
|
||||
if (!BuildConfig.DEBUG) addAnalytics()
|
||||
|
||||
workaroundAndroid7BrokenSSL()
|
||||
|
||||
@@ -119,6 +125,13 @@ open class App : Application(), LifecycleObserver {
|
||||
}
|
||||
}
|
||||
|
||||
private fun addAnalytics() {
|
||||
firebaseAnalytics = Firebase.analytics
|
||||
if (syDebugVersion != "0") {
|
||||
firebaseAnalytics.setUserProperty("preview_version", syDebugVersion)
|
||||
}
|
||||
}
|
||||
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
||||
@Suppress("unused")
|
||||
fun onAppBackgrounded() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package exh.log
|
||||
|
||||
import com.crashlytics.android.Crashlytics
|
||||
import com.elvishew.xlog.printer.Printer
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
|
||||
class CrashlyticsPrinter(private val logLevel: Int) : Printer {
|
||||
@@ -15,7 +15,7 @@ class CrashlyticsPrinter(private val logLevel: Int) : Printer {
|
||||
override fun println(logLevel: Int, tag: String?, msg: String?) {
|
||||
if (logLevel >= this.logLevel) {
|
||||
try {
|
||||
Crashlytics.log(logLevel, tag, msg)
|
||||
FirebaseCrashlytics.getInstance().log("$logLevel/$tag: $msg")
|
||||
} catch (t: Throwable) {
|
||||
// Crash in debug if shit like this happens
|
||||
if (BuildConfig.DEBUG) throw t
|
||||
|
||||
Reference in New Issue
Block a user