Commit 14633fd7 authored by Amit Kumar's avatar Amit Kumar 💻

Merge branch 'bugsnag_removal' into 'master'

Bugsnag removal

See merge request !9
parents b4a0ee0b baae556e
Pipeline #26504 passed with stage
in 9 minutes and 38 seconds
......@@ -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"
......
......@@ -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<Activity>
@Inject lateinit var dispatchingBroadcastReceiverInjector: DispatchingAndroidInjector<BroadcastReceiver>
@Inject lateinit var dispatchingServiceInjector: DispatchingAndroidInjector<Service>
@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<Activity> {
......
/*
* 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) }
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment