This commit is contained in:
Misofist 2026-05-02 21:21:40 +00:00 committed by GitHub
commit af27ffc23a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 12 deletions

View File

@ -1,5 +1,7 @@
import com.mikepenz.aboutlibraries.plugin.StrictMode
import io.sentry.android.gradle.instrumentation.logcat.LogcatLevel
import io.sentry.android.gradle.SentryPlugin
import io.sentry.android.gradle.extensions.SentryPluginExtension
import java.io.FileInputStream
import java.util.Properties
@ -11,13 +13,18 @@ plugins {
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
alias(libs.plugins.sentry.android)
alias(libs.plugins.sentry.android) apply false
alias(libs.plugins.sqldelight)
alias(libs.plugins.google.services)
id("kotlin-kapt")
id("kotlin-parcelize")
}
val sentryEnabled = buildproperty("sentry.dsn", "RVX_SENTRY_DSN") != "";
if(sentryEnabled) {
apply<SentryPlugin>();
}
fun property(fileName: String, propertyName: String, fallbackEnv: String? = null): String? {
val propsFile = rootProject.file(fileName)
if (propsFile.exists()) {
@ -156,16 +163,18 @@ android {
}
}
sentry {
autoUploadProguardMapping =
buildproperty("sentry.upload_mappings", "RVX_SENTRY_UPLOAD_MAPPINGS") == "true"
if(sentryEnabled) {
configure<SentryPluginExtension> {
autoUploadProguardMapping =
buildproperty("sentry.upload_mappings", "RVX_SENTRY_UPLOAD_MAPPINGS") == "true"
tracingInstrumentation {
enabled = true
logcat {
tracingInstrumentation {
enabled = true
minLevel = LogcatLevel.WARNING
logcat {
enabled = true
minLevel = LogcatLevel.WARNING
}
}
}
}

View File

@ -351,9 +351,11 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
SentryAndroid.init(this) { options ->
options.dsn = BuildConfig.SENTRY_DSN
options.release = BuildConfig.VERSION_NAME
if(BuildConfig.SENTRY_DSN != "") {
SentryAndroid.init(this) { options ->
options.dsn = BuildConfig.SENTRY_DSN
options.release = BuildConfig.VERSION_NAME
}
}
@Suppress("DEPRECATION") // We are fixing a bug in the splash screen