Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Features

- Add `proguardUuid` option to `SentryOptions` ([#436](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/436))
- This will propagate the `proguardUuid` value to Sentry Android

## 0.17.1

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public class io/sentry/kotlin/multiplatform/SentryOptions {
public final fun getFailedRequestTargets ()Ljava/util/List;
public final fun getMaxAttachmentSize ()J
public final fun getMaxBreadcrumbs ()I
public final fun getProguardUuid ()Ljava/lang/String;
public final fun getRelease ()Ljava/lang/String;
public final fun getSampleRate ()Ljava/lang/Double;
public final fun getSdk ()Lio/sentry/kotlin/multiplatform/protocol/SdkVersion;
Expand Down Expand Up @@ -213,6 +214,7 @@ public class io/sentry/kotlin/multiplatform/SentryOptions {
public final fun setFailedRequestTargets (Ljava/util/List;)V
public final fun setMaxAttachmentSize (J)V
public final fun setMaxBreadcrumbs (I)V
public final fun setProguardUuid (Ljava/lang/String;)V
public final fun setRelease (Ljava/lang/String;)V
public final fun setSampleRate (Ljava/lang/Double;)V
public final fun setSdk (Lio/sentry/kotlin/multiplatform/protocol/SdkVersion;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public class io/sentry/kotlin/multiplatform/SentryOptions {
public final fun getFailedRequestTargets ()Ljava/util/List;
public final fun getMaxAttachmentSize ()J
public final fun getMaxBreadcrumbs ()I
public final fun getProguardUuid ()Ljava/lang/String;
public final fun getRelease ()Ljava/lang/String;
public final fun getSampleRate ()Ljava/lang/Double;
public final fun getSdk ()Lio/sentry/kotlin/multiplatform/protocol/SdkVersion;
Expand Down Expand Up @@ -210,6 +211,7 @@ public class io/sentry/kotlin/multiplatform/SentryOptions {
public final fun setFailedRequestTargets (Ljava/util/List;)V
public final fun setMaxAttachmentSize (J)V
public final fun setMaxBreadcrumbs (I)V
public final fun setProguardUuid (Ljava/lang/String;)V
public final fun setRelease (Ljava/lang/String;)V
public final fun setSampleRate (Ljava/lang/Double;)V
public final fun setSdk (Lio/sentry/kotlin/multiplatform/protocol/SdkVersion;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ internal fun SentryOptions.toAndroidSentryOptionsCallback(): (SentryAndroidOptio
androidOptions.isAnrEnabled = kmpOptions.isAnrEnabled
androidOptions.anrTimeoutIntervalMillis = kmpOptions.anrTimeoutIntervalMillis

kmpOptions.proguardUuid?.let { uuid ->
androidOptions.proguardUuid = uuid
}

// Replay options
androidOptions.sessionReplay.maskAllText =
kmpOptions.sessionReplay.maskAllText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ actual interface PlatformOptions : CommonPlatformOptions {
val attachScreenshot: Boolean
val attachViewHierarchy: Boolean
val sessionReplay: AndroidSentryReplayOptions
val proguardUuid: String?
}

class SentryAndroidOptionsWrapper(private val androidOptions: SentryAndroidOptions) :
Expand Down Expand Up @@ -76,6 +77,9 @@ class SentryAndroidOptionsWrapper(private val androidOptions: SentryAndroidOptio
override val sendDefaultPii: Boolean
get() = androidOptions.isSendDefaultPii

override val proguardUuid: String?
get() = androidOptions.proguardUuid

override fun applyFromOptions(options: SentryOptions) {
options.toAndroidSentryOptionsCallback().invoke(androidOptions)
}
Expand Down Expand Up @@ -113,6 +117,7 @@ actual fun PlatformOptions.assertPlatformSpecificOptions(kmpOptions: SentryOptio
kmpReplayOptions.sessionSampleRate
)
assertEquals(androidOptions.sessionReplay.quality.name, kmpReplayOptions.quality.name)
assertEquals(androidOptions.proguardUuid, kmpOptions.proguardUuid)
}

actual fun createSentryPlatformOptionsConfiguration(): PlatformOptionsConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,20 @@ public open class SentryOptions {
public var experimental: ExperimentalOptions = ExperimentalOptions()
private set

/**
* Sets the ProGuard UUID for the app. This option is used to match ProGuard/R8/DexGuard mapping
* files to your app. The UUID is typically generated automatically during the build process
* and included in the AndroidManifest.xml file.
*
* **Platform Availability**: Android only.
*
* On non-Android platforms, this option is ignored and has no effect.
*
* For more information on ProGuard mapping files and obfuscation, see:
* [ProGuard & DexGuard Documentation](https://docs.sentry.io/platforms/android/enhance-errors/proguard/)
*/
public var proguardUuid: String? = null

/**
* Experimental options for new features, these options are going to be promoted to SentryOptions
* before GA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class SentryOptionsTest : BaseSentryTest() {
assertEquals(SentryReplayOptions.Quality.MEDIUM, options.sessionReplay.quality)
assertTrue(options.enableWatchdogTerminationTracking)
assertFalse(options.sendDefaultPii)
assertNull(options.proguardUuid)
}

@Test
Expand Down Expand Up @@ -165,6 +166,7 @@ class SentryOptionsTest : BaseSentryTest() {
sessionReplay.maskAllImages = false
sessionReplay.quality = SentryReplayOptions.Quality.LOW
sendDefaultPii = true
proguardUuid = "test-proguard-uuid-12345"
}

val platformOptions = createPlatformOptions()
Expand Down