Browse Source

Removed acra crash reporting

sirekanian 2 năm trước cách đây
mục cha
commit
f99a5b688d

+ 2 - 2
app/build.gradle.kts

@@ -72,8 +72,8 @@ dependencies {
     implementation("com.google.android.material:material:1.8.0")
     implementation("com.github.bumptech.glide:glide:4.15.1")
 
-    // crash reporting
-    implementation("ch.acra:acra-http:5.9.7")
+    // todo: crash reporting
+    // implementation("ch.acra:acra-http:5.9.7")
 }
 
 task("updateReadme") {

+ 2 - 4
app/src/main/java/org/sirekanyan/knigopis/App.kt

@@ -3,10 +3,6 @@ package org.sirekanyan.knigopis
 import android.app.Application
 import android.content.Context
 import org.sirekanyan.knigopis.dependency.*
-import org.acra.ACRA
-import org.acra.config.CoreConfigurationBuilder
-import org.acra.config.HttpSenderConfigurationBuilder
-import org.acra.sender.HttpSender
 
 class App : Application() {
 
@@ -30,6 +26,7 @@ class App : Application() {
     }
 
     private fun initCrashReporting() {
+        /* todo: crash reporting
         val httpSenderConfig = HttpSenderConfigurationBuilder()
             .withUri("https://collector.tracepot.com/93c9aa62")
             .withHttpMethod(HttpSender.Method.POST)
@@ -40,6 +37,7 @@ class App : Application() {
             .withPluginConfigurations(httpSenderConfig)
             .build()
         ACRA.init(this, config)
+        */
     }
 
     override fun onCreate() {

+ 2 - 2
app/src/main/java/org/sirekanyan/knigopis/common/functions/LogFactory.kt

@@ -1,7 +1,6 @@
 package org.sirekanyan.knigopis.common.functions
 
 import android.util.Log
-import org.acra.ACRA
 
 private const val TAG = "Knigopis"
 
@@ -9,6 +8,7 @@ private const val TAG = "Knigopis"
 fun logWarn(message: String) = Log.w(TAG, message)
 
 fun logError(message: String, throwable: Throwable?): Int {
-    ACRA.errorReporter.handleException(throwable)
+    // todo: crash reporting
+    // ACRA.errorReporter.handleException(throwable)
     return Log.e(TAG, message, throwable)
 }

+ 0 - 4
app/src/main/java/org/sirekanyan/knigopis/feature/MainPresenter.kt

@@ -7,7 +7,6 @@ import org.sirekanyan.knigopis.feature.users.MainPresenterState
 import org.sirekanyan.knigopis.model.CurrentTab
 import org.sirekanyan.knigopis.model.CurrentTab.*
 import org.sirekanyan.knigopis.repository.*
-import org.acra.ACRA
 
 interface MainPresenter : Presenter {
 
@@ -143,9 +142,6 @@ class MainPresenterImpl(
 
     override fun onCrashReportOptionClicked(isChecked: Boolean) {
         config.crashReportEnabled = isChecked
-        if (!isChecked) {
-            ACRA.errorReporter.handleException(Exception("Crash reporting was disabled"))
-        }
     }
 
     override fun onThemeOptionClicked(theme: Theme) {

+ 2 - 0
app/src/main/res/menu/options.xml

@@ -59,10 +59,12 @@
         android:title="@string/main.option.about"
         app:showAsAction="never" />
 
+    <!-- todo: crash reporting -->
     <item
         android:id="@+id/option_crash_report"
         android:checkable="true"
         android:title="@string/main.option.crash_report"
+        android:visible="false"
         app:showAsAction="never" />
 
     <!-- for debug only -->