From cf16fb0477004f6c491b5fcbad8909ba4aae8d01 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 15 Sep 2025 13:33:46 +0200 Subject: [PATCH] feat(android-distribution): Use ProGuard UUID for build identification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace custom APK parsing with existing SDK infrastructure: - Use Sentry.getCurrentScopes().options.proguardUuid for build identification - Leverage automatic loading from sentry-debug-meta.properties or manifest - Better performance (no runtime APK parsing) - More reliable than signature extraction - Consistent with SDK patterns The ProGuard UUID provides a stable, unique identifier for each build and is automatically generated by sentry-cli or the Sentry Gradle plugin. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../internal/DistributionInternal.kt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sentry-android-distribution/src/main/java/io/sentry/android/distribution/internal/DistributionInternal.kt b/sentry-android-distribution/src/main/java/io/sentry/android/distribution/internal/DistributionInternal.kt index 648d7c70d07..b475bb46b7e 100644 --- a/sentry-android-distribution/src/main/java/io/sentry/android/distribution/internal/DistributionInternal.kt +++ b/sentry-android-distribution/src/main/java/io/sentry/android/distribution/internal/DistributionInternal.kt @@ -1,6 +1,7 @@ package io.sentry.android.distribution.internal import android.content.Context +import io.sentry.Sentry import io.sentry.android.distribution.DistributionOptions import io.sentry.android.distribution.UpdateStatus @@ -19,10 +20,22 @@ internal object DistributionInternal { } fun checkForUpdateBlocking(context: Context): UpdateStatus { - return UpdateStatus.Error("Implementation coming in future PR") + val buildIdentifier = Sentry.getCurrentScopes().options.proguardUuid + return if (!buildIdentifier.isNullOrEmpty()) { + UpdateStatus.Error( + "Build identifier from ProGuard UUID: $buildIdentifier. HTTP client and API models coming in future PRs." + ) + } else { + UpdateStatus.Error( + "No ProGuard UUID found. Ensure sentry-debug-meta.properties contains io.sentry.ProguardUuids or set via manifest." + ) + } } fun checkForUpdateAsync(context: Context, onResult: (UpdateStatus) -> Unit) { - throw NotImplementedError() + // For now, just call the blocking version and return the result + // In future PRs, this will be truly async + val result = checkForUpdateBlocking(context) + onResult(result) } }