fix: change ACRA to Sentry

This commit is contained in:
Sweetbread 2025-05-14 21:21:39 +03:00
parent 82d62132c0
commit 31c81021ce
Signed by: Sweetbread
GPG Key ID: 17A5CB9A7DD85319
7 changed files with 56 additions and 29 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
secrets.properties

View File

@ -8,12 +8,6 @@ This project incorporates components from the following third-party libraries:
Licensed under Apache License 2.0
[https://developer.android.com](https://developer.android.com)
## ACRA
- **ch.acra:acra-http**
Copyright ACRA
Licensed under Apache License 2.0
[https://github.com/ACRA/acra](https://github.com/ACRA/acra)
## Coil
- **io.coil-kt:coil-compose**
Copyright Coil Contributors
@ -53,6 +47,12 @@ This project incorporates components from the following third-party libraries:
Copyright Google LLC
Licensed under Apache License 2.0
## Sentry Android
- **io.sentry:sentry-android**
Copyright Sentry and contributors
Licensed under MIT License
[https://github.com/getsentry/sentry-java](https://github.com/getsentry/sentry-java)
## Build Tools
- **Gradle Plugins** (Android, Kotlin)
Copyright Google LLC / JetBrains s.r.o.
@ -67,4 +67,4 @@ This product includes software developed by:
- Google LLC
- And other contributors listed above
Full license texts are available in the [LICENSE](LICENSE) file and respective library repositories.
Full license texts are available in the [LICENSE](LICENSE) file and respective library repositories.

View File

@ -2,6 +2,7 @@
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Properties
plugins {
alias(libs.plugins.androidApplication)
@ -9,6 +10,7 @@ plugins {
alias(libs.plugins.kotlin.compose)
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
id("com.google.devtools.ksp")
id("io.sentry.android.gradle") version "5.5.0"
}
secrets {
@ -32,6 +34,15 @@ android {
useSupportLibrary = true
}
val secretProperties = Properties().apply {
val secretFile = rootProject.file("secrets.properties")
if (secretFile.exists())
secretFile.inputStream().use { load(it) }
else
println("Warning: secrets.properties not found!")
}
manifestPlaceholders["sentry_url"] = secretProperties.getProperty("SENTRY_URL")!!
// javaCompileOptions {
// annotationProcessorOptions {
// arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
@ -44,18 +55,21 @@ android {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
resValue("string", "app_name", "@string/app_name_reg")
manifestPlaceholders["sentry_env"] = "production"
}
debug {
applicationIdSuffix = ".debug"
versionNameSuffix =
"-debug+${LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)}"
resValue("string", "app_name", "@string/app_name_dev")
manifestPlaceholders["sentry_env"] = "debug"
}
create("beta") {
versionNameSuffix =
"-beta+${LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)}"
resValue("string", "app_name", "@string/app_name_beta")
signingConfig = signingConfigs.getByName("debug")
manifestPlaceholders["sentry_env"] = "beta"
}
}
compileOptions {
@ -120,9 +134,9 @@ dependencies {
implementation(libs.compose)
implementation(libs.acra.http)
implementation(libs.sentry)
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
}
}

View File

@ -15,6 +15,35 @@
android:supportsRtl="true"
android:theme="@style/Theme.UNN"
tools:targetApi="31">
<meta-data
android:name="io.sentry.dsn"
android:value="${sentry_url}" />
<meta-data
android:name="io.sentry.environment"
android:value="${sentry_env}" />
<meta-data
android:name="io.sentry.send-default-pii"
android:value="true" />
<meta-data
android:name="io.sentry.traces.sample-rate"
android:value="1.0" />
<meta-data
android:name="io.sentry.traces.user-interaction.enable"
android:value="true" />
<meta-data
android:name="io.sentry.attach-screenshot"
android:value="true" />
<meta-data
android:name="io.sentry.attach-view-hierarchy"
android:value="true" />
<meta-data
android:name="io.sentry.session-replay.on-error-sample-rate"
android:value="1.0" />
<meta-data
android:name="io.sentry.session-replay.session-sample-rate"
android:value="0.1" />
<activity
android:name=".ui.layout.MainActivity"
android:exported="true"
@ -31,4 +60,4 @@
</activity>
</application>
</manifest>
</manifest>

View File

@ -8,16 +8,5 @@ import android.content.Context
class UNNApp : Application() {
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
// initAcra {
// buildConfigClass = BuildConfig::class.java
// reportFormat = StringFormat.JSON
// httpSender {
// uri = BuildConfig.ACRA_URL
// basicAuthLogin = BuildConfig.ACRA_LOGIN
// basicAuthPassword = BuildConfig.ACRA_PASS
// httpMethod = HttpSender.Method.POST
// }
// }
}
}

View File

@ -1,5 +1,4 @@
[versions]
acraHttp = "5.11.3"
agp = "8.7.3"
calendar = "2.6.2"
coilCompose = "2.7.0"
@ -23,11 +22,11 @@ activity = "1.10.1"
navigationCompose = "2.8.9"
roomRuntime = "2.7.1"
secretsGradlePlugin = "2.0.1"
sentryAndroid = "8.12.0"
splitties = "3.0.0"
materialIconsCoreAndroid = "1.7.8"
[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-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
@ -62,6 +61,7 @@ androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecy
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
secrets-gradle-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
sentry = { module = "io.sentry:sentry-android", version.ref = "sentryAndroid" }
splitties-base = { module = "com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl", version.ref = "splitties" }
splitties-room = { module = "com.louiscad.splitties:splitties-arch-room", version.ref = "splitties" }
androidx-material-icons-core-android = { group = "androidx.compose.material", name = "material-icons-core-android", version.ref = "materialIconsCoreAndroid" }
@ -70,4 +70,3 @@ androidx-material-icons-core-android = { group = "androidx.compose.material", na
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

View File

@ -1,5 +0,0 @@
# Copyright (c) 2025 Gleb Zaharov. License: GPLv3 (see LICENSE).
ACRA_URL=https://bugs.coders-squad.com/report
ACRA_LOGIN=pMJkqPlNLX4kQ3kK
ACRA_PASS=HYY72oV4ybmpCggC