From d0dda2b1a4d2e9f0cb74f9fab0ff71b580efe6a4 Mon Sep 17 00:00:00 2001 From: moezbhatti Date: Sun, 8 Sep 2019 21:39:32 -0400 Subject: [PATCH] Remove bugsnag --- presentation/build.gradle | 3 -- .../com/moez/QKSMS/common/QKApplication.kt | 13 +----- .../com/moez/QKSMS/common/util/BugsnagTree.kt | 41 ------------------- 3 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 presentation/src/main/java/com/moez/QKSMS/common/util/BugsnagTree.kt diff --git a/presentation/build.gradle b/presentation/build.gradle index d2a987e7..9d36e7ca 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -34,8 +34,6 @@ android { versionCode 2198 versionName "3.6.8" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - - buildConfigField "String", "BUGSNAG_API_KEY", "\"${System.getenv("BUGSNAG_API_KEY")}\"" } signingConfigs { @@ -163,7 +161,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 cc9f4f97..8e35c697 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/QKApplication.kt @@ -25,11 +25,7 @@ import android.content.BroadcastReceiver import androidx.core.provider.FontRequest import androidx.emoji.text.EmojiCompat import androidx.emoji.text.FontRequestEmojiCompatConfig -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.CrashlyticsTree import com.moez.QKSMS.common.util.FileLoggingTree import com.moez.QKSMS.injection.AppComponentManager @@ -63,16 +59,9 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn @Inject lateinit var fileLoggingTree: FileLoggingTree @Inject lateinit var nightModeManager: NightModeManager - private val packages = arrayOf("com.moez.QKSMS") - override fun onCreate() { super.onCreate() - Bugsnag.init(this, Configuration(BuildConfig.BUGSNAG_API_KEY).apply { - appVersion = BuildConfig.VERSION_NAME - projectPackages = packages - }) - Realm.init(this) Realm.setDefaultConfiguration(RealmConfiguration.Builder() .compactOnLaunch() @@ -97,7 +86,7 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn EmojiCompat.init(FontRequestEmojiCompatConfig(this, fontRequest)) - Timber.plant(Timber.DebugTree(), BugsnagTree(), CrashlyticsTree(), fileLoggingTree) + Timber.plant(Timber.DebugTree(), CrashlyticsTree(), fileLoggingTree) RxDogTag.builder() .configureWith(AutoDisposeConfigurer::configure) 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 f7d565c5..00000000 --- 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