diff options
author | Allan Wang <me@allanwang.ca> | 2020-09-27 20:28:25 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-09-27 20:28:25 -0700 |
commit | 3570a4e40b499020d3a32e5804fd5c801fb71bec (patch) | |
tree | 417ec0ff3af9974bef1ff2dd0021693bb3ee67f5 /app/src | |
parent | 1bf61890ff207e3a1e0b8177d13256e208e1e38c (diff) | |
download | frost-3570a4e40b499020d3a32e5804fd5c801fb71bec.tar.gz frost-3570a4e40b499020d3a32e5804fd5c801fb71bec.tar.bz2 frost-3570a4e40b499020d3a32e5804fd5c801fb71bec.zip |
Update bugsnag
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | 18 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/BuildUtils.kt | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 758f719f..38d0dd5c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -135,19 +135,19 @@ class FrostApp : Application(), KoinComponent { val config = Configuration("83cf680ed01a6fda10fe497d1c0962bb").apply { appVersion = version.versionName releaseStage = BuildUtils.getStage(BuildConfig.BUILD_TYPE) - notifyReleaseStages = BuildUtils.getAllStages() - autoCaptureSessions = prefs.analytics - enableExceptionHandler = prefs.analytics + enabledReleaseStages = BuildUtils.getAllStages() + autoTrackSessions = prefs.analytics + autoDetectErrors = prefs.analytics } - Bugsnag.init(this, config) + Bugsnag.start(this, config) L.hasAnalytics = { prefs.analytics } - Bugsnag.setUserId(prefs.frostId) - Bugsnag.addToTab("Build", "Application", BuildConfig.APPLICATION_ID) - Bugsnag.addToTab("Build", "Version", BuildConfig.VERSION_NAME) + Bugsnag.setUser(prefs.frostId, null, null) + Bugsnag.addMetadata("Build", "Application", BuildConfig.APPLICATION_ID) + Bugsnag.addMetadata("Build", "Version", BuildConfig.VERSION_NAME) - Bugsnag.beforeNotify { error -> + Bugsnag.addOnError { event -> when { - error.exception.stackTrace.any { it.className.contains("XposedBridge") } -> false + event.originalError?.stackTrace?.any { it.className.contains("XposedBridge") } == true -> false else -> true } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/BuildUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/BuildUtils.kt index 65ef3056..d922ff54 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/BuildUtils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/BuildUtils.kt @@ -33,8 +33,8 @@ object BuildUtils { return Data("v${result[1]}", result[2]) } - fun getAllStages(): Array<String> = - arrayOf(BUILD_PRODUCTION, BUILD_TEST, BUILD_GITHUB, BUILD_RELEASE, BUILD_UNNAMED) + fun getAllStages(): Set<String> = + setOf(BUILD_PRODUCTION, BUILD_TEST, BUILD_GITHUB, BUILD_RELEASE, BUILD_UNNAMED) fun getStage(build: String): String = build.takeIf { it in getAllStages() } ?: BUILD_UNNAMED } |