diff --git a/presentation/build.gradle b/presentation/build.gradle index 1c958fabd867ed7690dabf5f8b63a0c40e1be1d8..9c68528d6588a9433cb97e7f65bec8b0028ba591 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -34,8 +34,6 @@ android { versionCode 194 versionName "3.6.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - - buildConfigField "String", "BUGSNAG_API_KEY", "\"${System.getenv("BUGSNAG_API_KEY")}\"" } buildTypes { @@ -164,7 +162,6 @@ dependencies { testImplementation "org.mockito:mockito-core:$mockito_version" implementation "com.android.billingclient:billing:1.0" - implementation "com.bugsnag:bugsnag-android:4.1.1" implementation "com.github.chrisbanes:PhotoView:2.0.0" implementation "com.f2prateek.rx.preferences2:rx-preferences:$rx_preferences_version" implementation "com.google.android:flexbox:0.3.1" diff --git a/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt b/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt index e6a2bdb78273784ce536eb8450d475c997e5b5f0..359daededc5dd033e797c5abb10af1c16b8713c3 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt @@ -26,22 +26,14 @@ import androidx.core.provider.FontRequest import androidx.emoji.text.EmojiCompat import androidx.emoji.text.FontRequestEmojiCompatConfig import com.akaita.java.rxjava2debug.RxJava2Debug -import com.bugsnag.android.Bugsnag -import com.bugsnag.android.Configuration -import com.moez.QKSMS.BuildConfig import com.moez.QKSMS.R -import com.moez.QKSMS.common.util.BugsnagTree import com.moez.QKSMS.common.util.FileLoggingTree import com.moez.QKSMS.injection.AppComponentManager import com.moez.QKSMS.injection.appComponent import com.moez.QKSMS.manager.AnalyticsManager import com.moez.QKSMS.migration.QkRealmMigration import com.moez.QKSMS.util.NightModeManager -import dagger.android.AndroidInjector -import dagger.android.DispatchingAndroidInjector -import dagger.android.HasActivityInjector -import dagger.android.HasBroadcastReceiverInjector -import dagger.android.HasServiceInjector +import dagger.android.* import io.realm.Realm import io.realm.RealmConfiguration import timber.log.Timber @@ -58,7 +50,8 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn @Inject lateinit var dispatchingActivityInjector: DispatchingAndroidInjector @Inject lateinit var dispatchingBroadcastReceiverInjector: DispatchingAndroidInjector @Inject lateinit var dispatchingServiceInjector: DispatchingAndroidInjector - @Inject lateinit var fileLoggingTree: FileLoggingTree + @Inject + lateinit var fileLoggingTree: FileLoggingTree @Inject lateinit var nightModeManager: NightModeManager private val packages = arrayOf("com.moez.QKSMS") @@ -66,11 +59,6 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn override fun onCreate() { super.onCreate() - Bugsnag.init(this, Configuration(BuildConfig.BUGSNAG_API_KEY).apply { - appVersion = BuildConfig.VERSION_NAME - projectPackages = packages - }) - RxJava2Debug.enableRxJava2AssemblyTracking() Realm.init(this) @@ -88,7 +76,6 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn } nightModeManager.updateCurrentTheme() - val fontRequest = FontRequest( "com.google.android.gms.fonts", "com.google.android.gms", @@ -96,8 +83,8 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn R.array.com_google_android_gms_fonts_certs) EmojiCompat.init(FontRequestEmojiCompatConfig(this, fontRequest)) + Timber.plant(Timber.DebugTree(), fileLoggingTree) - Timber.plant(Timber.DebugTree(), BugsnagTree(), fileLoggingTree) } override fun activityInjector(): AndroidInjector { diff --git a/presentation/src/main/java/com/moez/QKSMS/common/util/BugsnagTree.kt b/presentation/src/main/java/com/moez/QKSMS/common/util/BugsnagTree.kt deleted file mode 100644 index f7d565c52aa5e3974a9df346bc2bf77a0b4df23b..0000000000000000000000000000000000000000 --- a/presentation/src/main/java/com/moez/QKSMS/common/util/BugsnagTree.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2017 Moez Bhatti - * - * This file is part of QKSMS. - * - * QKSMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * QKSMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with QKSMS. If not, see . - */ -package com.moez.QKSMS.common.util - -import android.util.Log -import com.bugsnag.android.Bugsnag -import com.bugsnag.android.Severity -import timber.log.Timber - -/** - * If an exception is logged with the [Log.WARN] or [Log.ERROR] priority, the exception will be - * sent to Bugsnag - */ -class BugsnagTree : Timber.Tree() { - - override fun isLoggable(tag: String?, priority: Int): Boolean { - return priority == Log.WARN || priority == Log.ERROR - } - - override fun log(priority: Int, tag: String?, message: String?, throwable: Throwable?) { - val severity = if (priority == Log.ERROR) Severity.ERROR else Severity.WARNING - throwable?.run { Bugsnag.notify(this, severity) } - } - -} \ No newline at end of file