forked from upstream-mirrors/quik
Remove bugsnag
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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) }
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user