From 2a4840d7946940ab2bd12d57588c4730496e2d9f Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Tue, 2 Apr 2024 13:03:48 -0500 Subject: [PATCH] Switch to email crash reporting --- build.gradle | 2 +- java/res/values/strings-crash-reporting.xml | 3 +- .../latin/CrashLoggingApplication.kt | 34 +++++++++---------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 068a7c9a7..2d49ae7bd 100644 --- a/build.gradle +++ b/build.gradle @@ -192,7 +192,7 @@ dependencies { implementation 'androidx.datastore:datastore-preferences:1.0.0' implementation 'androidx.autofill:autofill:1.1.0' - implementation 'ch.acra:acra-http:5.11.1' + implementation 'ch.acra:acra-mail:5.11.1' implementation 'ch.acra:acra-dialog:5.11.1' implementation 'com.squareup.okhttp3:okhttp:4.11.0' diff --git a/java/res/values/strings-crash-reporting.xml b/java/res/values/strings-crash-reporting.xml index 7b7d61b3a..5aa3e9c0d 100644 --- a/java/res/values/strings-crash-reporting.xml +++ b/java/res/values/strings-crash-reporting.xml @@ -1,7 +1,6 @@ - FUTO Keyboard has crashed! Please send a report to help us fix this. - Note: If you are experiencing repeated crashes, please update the app or contact us. + FUTO Keyboard has crashed! Please email us a report to help us fix this (voiceinput@futo.org) Crash Reporter Send Report diff --git a/java/src/org/futo/inputmethod/latin/CrashLoggingApplication.kt b/java/src/org/futo/inputmethod/latin/CrashLoggingApplication.kt index b2cc7db05..86d081399 100644 --- a/java/src/org/futo/inputmethod/latin/CrashLoggingApplication.kt +++ b/java/src/org/futo/inputmethod/latin/CrashLoggingApplication.kt @@ -3,33 +3,31 @@ package org.futo.inputmethod.latin import android.app.Application import android.content.Context import org.acra.config.dialog -import org.acra.config.httpSender +import org.acra.config.mailSender import org.acra.data.StringFormat import org.acra.ktx.initAcra -import org.acra.sender.HttpSender class CrashLoggingApplication : Application() { override fun attachBaseContext(base: Context?) { super.attachBaseContext(base) - if(BuildConfig.ENABLE_ACRA) { - initAcra { - reportFormat = StringFormat.JSON + initAcra { + reportFormat = StringFormat.JSON - dialog { - text = getString(R.string.crashed_text) - title = getString(R.string.crashed_title) - positiveButtonText = getString(R.string.crash_report_accept) - negativeButtonText = getString(R.string.crash_report_reject) - resTheme = android.R.style.Theme_DeviceDefault_Dialog - } + dialog { + text = getString(R.string.crashed_text) + title = getString(R.string.crashed_title) + positiveButtonText = getString(R.string.crash_report_accept) + negativeButtonText = getString(R.string.crash_report_reject) + resTheme = android.R.style.Theme_DeviceDefault_Dialog + } - httpSender { - uri = BuildConfig.ACRA_URL - basicAuthLogin = BuildConfig.ACRA_USER - basicAuthPassword = BuildConfig.ACRA_PASSWORD - httpMethod = HttpSender.Method.POST - } + mailSender { + mailTo = "keyboard@futo.org" + reportAsFile = true + reportFileName = "Crash.txt" + subject = "Keyboard Crash Report" + body = "I experienced this crash. My version: ${BuildConfig.VERSION_NAME}.\n\n(Enter details here if necessary)" } } }