Skip to content

Commit

Permalink
[feat] Replace Acra with Firebase Crashlytics for crash monitoring: h…
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Sep 22, 2024
1 parent 8e8789a commit 6366e44
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 33 deletions.
9 changes: 6 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'kotlin-parcelize'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

android {
Expand Down Expand Up @@ -100,11 +102,12 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'ch.acra:acra-http:5.9.6'
implementation 'ch.acra:acra-dialog:5.9.6'

implementation 'com.airbnb.android:lottie:6.4.0'
implementation 'com.github.androidmads:QRGenerator:1.0.1'
implementation("io.coil-kt:coil:2.6.0")
implementation("com.github.skydoves:balloon:1.6.4")

implementation platform('com.google.firebase:firebase-bom:33.3.0')
implementation "com.google.firebase:firebase-crashlytics"
implementation "com.google.firebase:firebase-analytics"
}
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "427728790868",
"project_id": "ark-builders-dev",
"storage_bucket": "ark-builders-dev.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:427728790868:android:4451fa5dfb4b4b8c3cd4c1",
"android_client_info": {
"package_name": "dev.arkbuilders.arkmemo"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBb6Dgf2yzFgbGIRqYlsrcor8g2hetF_jk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:427728790868:android:fdf7d8f94023954e3cd4c1",
"android_client_info": {
"package_name": "dev.arkbuilders.rate"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBb6Dgf2yzFgbGIRqYlsrcor8g2hetF_jk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
30 changes: 0 additions & 30 deletions app/src/main/java/dev/arkbuilders/arkmemo/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ package dev.arkbuilders.arkmemo
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import dev.arkbuilders.arklib.initArkLib
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.acra.config.dialog
import org.acra.config.httpSender
import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.acra.sender.HttpSender
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import javax.inject.Inject
Expand All @@ -26,27 +18,5 @@ class App: Application() {
System.loadLibrary("arklib")
initArkLib()
FoldersRepo.init(this)
initAcra()
}

private fun initAcra() = CoroutineScope(Dispatchers.IO).launch {
val enabled = memoPreferences.getCrashReportEnabled()
if (!enabled) return@launch

initAcra {
buildConfigClass = BuildConfig::class.java
reportFormat = StringFormat.JSON
dialog {
text = getString(R.string.crash_dialog_desc)
title = getString(R.string.crash_dialog_title)
commentPrompt = getString(R.string.crash_dialog_comment)
}
httpSender {
uri = BuildConfig.ACRA_URI
basicAuthLogin = BuildConfig.ACRA_LOGIN
basicAuthPassword = BuildConfig.ACRA_PASS
httpMethod = HttpSender.Method.POST
}
}
}
}
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ plugins {
id 'com.android.application' version '8.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
id 'com.google.dagger.hilt.android' version '2.48' apply false
id 'com.google.gms.google-services' version '4.4.2' apply false
id 'com.google.firebase.crashlytics' version '3.0.2' apply false
}


Expand Down

0 comments on commit 6366e44

Please sign in to comment.