Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add ACRA for crash reports" #185

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
MEALIENT_KEY_PASSWORD: ${{ secrets.MEALIENT_KEY_PASSWORD }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
APPSWEEP_API_KEY: ${{ secrets.APPSWEEP_API_KEY }}
ACRA_HOST: ${{ secrets.ACRA_HOST }}
ACRA_LOGIN: ${{ secrets.ACRA_LOGIN }}
ACRA_PASSWORD: ${{ secrets.ACRA_PASSWORD }}
run: |
echo "$MEALIENT_KEY_STORE" | base64 -d > app/keystore.jks
echo "storeFile=keystore.jks" > keystore.properties
Expand Down
16 changes: 0 additions & 16 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ android {
testInstrumentationRunner = "gq.kirmanak.mealient.MealientTestRunner"
testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true")
resourceConfigurations += listOf("en", "es", "ru", "fr", "nl", "pt", "de")

buildConfigField(
"String",
"ACRA_HOST",
System.getenv("ACRA_HOST")?.let { "\"$it\"" } ?: "\"\"")
buildConfigField(
"String",
"ACRA_LOGIN",
System.getenv("ACRA_LOGIN")?.let { "\"$it\"" } ?: "\"\"")
buildConfigField(
"String",
"ACRA_PASSWORD",
System.getenv("ACRA_PASSWORD")?.let { "\"$it\"" } ?: "\"\"")
}

signingConfigs {
Expand Down Expand Up @@ -152,9 +139,6 @@ dependencies {
implementation(libs.coil)
implementation(libs.coil.compose)

implementation(libs.acra.http)
implementation(libs.acra.scheduler)

testImplementation(libs.junit)

implementation(libs.jetbrains.kotlinx.coroutinesAndroid)
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/java/gq/kirmanak/mealient/App.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package gq.kirmanak.mealient

import android.app.Application
import android.content.Context
import coil.Coil
import coil.ImageLoader
import com.google.android.material.color.DynamicColors
import dagger.hilt.android.HiltAndroidApp
import gq.kirmanak.mealient.architecture.configuration.BuildConfiguration
import gq.kirmanak.mealient.data.migration.MigrationDetector
import gq.kirmanak.mealient.extensions.setupCrashReporting
import gq.kirmanak.mealient.logging.Logger
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand All @@ -33,11 +31,6 @@ class App : Application() {

private val appCoroutineScope = CoroutineScope(Dispatchers.Main + Job())

override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
setupCrashReporting()
}

override fun onCreate() {
super.onCreate()
logger.v { "onCreate() called" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package gq.kirmanak.mealient.extensions

import android.app.Activity
import android.app.Application
import android.app.job.JobInfo
import android.content.Context
import android.content.ContextWrapper
import gq.kirmanak.mealient.BuildConfig
import org.acra.config.httpSender
import org.acra.config.scheduler
import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.acra.sender.HttpSender

fun Context.findActivity(): Activity? {
var context = this
Expand All @@ -20,27 +12,3 @@ fun Context.findActivity(): Activity? {
}
return null
}

internal fun Application.setupCrashReporting() {
val acraHost = BuildConfig.ACRA_HOST.takeUnless { it.isBlank() } ?: return
val acraLogin = BuildConfig.ACRA_LOGIN.takeUnless { it.isBlank() } ?: return
val acraPassword = BuildConfig.ACRA_PASSWORD.takeUnless { it.isBlank() } ?: return
initAcra {
reportFormat = StringFormat.JSON
alsoReportToAndroidFramework = true

httpSender {
uri = "$acraHost/report"
basicAuthLogin = acraLogin
basicAuthPassword = acraPassword
httpMethod = HttpSender.Method.POST
// TODO compressed reports are failing due to https://github.com/F43nd1r/Acrarium/issues/458
compress = false
}

scheduler {
requiresNetworkType = JobInfo.NETWORK_TYPE_UNMETERED
requiresBatteryNotLow = true
}
}
}
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ hiltNavigationCompose = "1.0.0"
ktor = "2.3.5"
# https://github.com/coil-kt/coil/releases
coil = "2.5.0"
# https://github.com/ACRA/acra/releases
acra = "5.11.3"

[libraries]
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
Expand Down Expand Up @@ -209,9 +207,6 @@ ktor-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", versi
coil = { group = "io.coil-kt", name = "coil", version.ref = "coil" }
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }

acra-http = { group = "ch.acra", name = "acra-http", version.ref = "acra" }
acra-scheduler = { group = "ch.acra", name = "acra-advanced-scheduler", version.ref = "acra" }

[plugins]
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
appsweep = { id = "com.guardsquare.appsweep", version.ref = "appsweep" }
Expand Down