feat: ACRA

This commit is contained in:
sweetbread 2024-03-20 20:29:10 +03:00
parent 284e841e6c
commit 6efb5998ae
4 changed files with 35 additions and 0 deletions

View File

@ -83,4 +83,7 @@ dependencies {
implementation(libs.compose) implementation(libs.compose)
implementation(libs.commons.text)
implementation(libs.acra.http)
} }

View File

@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:name=".ui.UNNApp"
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

View File

@ -0,0 +1,27 @@
package ru.sweetbread.unn.ui
import android.app.Application
import android.content.Context
import org.acra.BuildConfig
import org.acra.config.httpSender
import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.acra.sender.HttpSender
class UNNApp : Application() {
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
initAcra {
//core configuration:
buildConfigClass = BuildConfig::class.java
reportFormat = StringFormat.JSON
httpSender {
uri = "/report"
basicAuthLogin = "5Fh9roh02J2BUyNl"
basicAuthPassword = "tTWalio7NVosHohT"
httpMethod = HttpSender.Method.POST
}
}
}
}

View File

@ -1,4 +1,5 @@
[versions] [versions]
acraHttp = "5.11.3"
agp = "8.3.1" agp = "8.3.1"
compose = "2.5.0" compose = "2.5.0"
coreSplashscreen = "1.0.1" coreSplashscreen = "1.0.1"
@ -23,8 +24,10 @@ lifecycleViewmodelKtx = "2.7.0"
activity = "1.8.2" activity = "1.8.2"
navigationCompose = "2.7.7" navigationCompose = "2.7.7"
splittiesFunPackAndroidBaseWithViewsDsl = "3.0.0" splittiesFunPackAndroidBaseWithViewsDsl = "3.0.0"
commonsText = "1.11.0"
[libraries] [libraries]
acra-http = { module = "ch.acra:acra-http", version.ref = "acraHttp" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" } androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
@ -54,6 +57,7 @@ androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecy
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
splitties-funpack-android-base-with-views-dsl = { module = "com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl", version.ref = "splittiesFunPackAndroidBaseWithViewsDsl" } splitties-funpack-android-base-with-views-dsl = { module = "com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl", version.ref = "splittiesFunPackAndroidBaseWithViewsDsl" }
commons-text = { group = "org.apache.commons", name = "commons-text", version.ref = "commonsText" }
[plugins] [plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" } androidApplication = { id = "com.android.application", version.ref = "agp" }