Modern Apps git

← Modern-Apps.git

app store: fix downloading

Commit
ec3d54dfdf7eb67ac1547d8bf1f2263d6166a9d3
Author
Vayun Mathur <[email protected]>
When
2026-08-04 17:01 UTC (4 months ago)
Parents
11074b0

Diff

appstore/src/main/java/com/vayunmathur/appstore/data/AppDatabase.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/AppDatabase.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/AppDatabase.ktindex f5d7e974ed..3f1ff6eb2d 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/AppDatabase.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/AppDatabase.kt@@ -39,6 +39,8 @@ data class CachedAppEntity(     val sizeBytes: Long,     val apkUrl: String?,     val targetSdk: Int?,+    /** True when this version was reproduced bit-for-bit by F-Droid's verification server. */+    val reproducible: Boolean = false,     val repoUrl: String?,     val lastUpdated: Long,     /** Comma-joined SHA-256 signing-certificate fingerprints from an authenticated index. */@@ -86,6 +88,7 @@ fun UnifiedApp.toEntity(): CachedAppEntity = CachedAppEntity(     sizeBytes = sizeBytes,     apkUrl = apkUrl,     targetSdk = targetSdk,+    reproducible = reproducible,     repoUrl = repoUrl?.removeSuffix("/") ?: DefaultRepos.FDROID_MAIN,     lastUpdated = lastUpdated,     expectedSigners = expectedSigners.joinToString(",").ifBlank { null },@@ -120,6 +123,7 @@ fun CachedAppEntity.toUnifiedApp(): UnifiedApp = UnifiedApp(     sizeBytes = sizeBytes,     apkUrl = apkUrl,     targetSdk = targetSdk,+    reproducible = reproducible,     repoUrl = repoUrl,     lastUpdated = lastUpdated,     expectedSigners = expectedSigners?.split(",")?.filter { it.isNotBlank() } ?: emptyList(),@@ -265,7 +269,7 @@ interface CachedAppDao {  @Database(     entities = [RepoEntity::class, CachedAppEntity::class, PinnedStampEntity::class],-    version = 5,+    version = 6,     exportSchema = false ) abstract class AppDatabase : RoomDatabase() {@@ -321,6 +325,14 @@ abstract class AppDatabase : RoomDatabase() {                     db.execSQL("ALTER TABLE CachedAppEntity ADD COLUMN whatsNew TEXT")                     db.execSQL("ALTER TABLE CachedAppEntity ADD COLUMN addedTimestamp INTEGER NOT NULL DEFAULT 0")                 }+            },+            object : Migration(5, 6) {+                override fun migrate(db: SupportSQLiteDatabase) {+                    // Reproducibility became a per-app badge rather than an import gate, so+                    // the catalogue now lists non-reproduced F-Droid apps too. Existing rows+                    // predate the badge; the next sync repopulates it. Default false.+                    db.execSQL("ALTER TABLE CachedAppEntity ADD COLUMN reproducible INTEGER NOT NULL DEFAULT 0")+                }             }         )     }
appstore/src/main/java/com/vayunmathur/appstore/data/AppModels.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/AppModels.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/AppModels.ktindex 29ea774774..316ebaec67 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/AppModels.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/AppModels.kt@@ -21,6 +21,12 @@ data class UnifiedApp(     val sizeBytes: Long = 0L,     val apkUrl: String? = null,     val targetSdk: Int? = null,+    /**+     * True when this exact version (packageName + versionCode) was independently+     * reproduced bit-for-bit by F-Droid's verification server. F-Droid only; a badge,+     * not a gate — apps are listed regardless. See [com.vayunmathur.appstore.data.ReproducibleBuilds].+     */+    val reproducible: Boolean = false,     val license: String? = null,     val website: String? = null,     val sourceCode: String? = null,
appstore/src/main/java/com/vayunmathur/appstore/data/CatalogRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/CatalogRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/CatalogRepository.ktindex 4d8e5fe507..ebfb87c66f 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/CatalogRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/CatalogRepository.kt@@ -15,7 +15,8 @@ enum class SyncStep { FDROID, MODERN_APPS } /** What one sync run managed to do, per source. */ data class SyncReport(     val fdroidCount: Int? = null,-    val fdroidSkipped: Int = 0,+    /** How many F-Droid apps carry the reproducible badge this sync. */+    val fdroidReproducible: Int = 0,     val modernCount: Int? = null, ) {     val anyFailed: Boolean get() = fdroidCount == null || modernCount == null@@ -145,7 +146,7 @@ class CatalogRepository(          SyncReport(             fdroidCount = fdroid,-            fdroidSkipped = fdroidProvider.lastFilteredOut,+            fdroidReproducible = fdroidProvider.lastReproducibleCount,             modernCount = modern,         )     }
appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.ktindex 2fa3295c78..32ce31b8cf 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidAppProvider.kt@@ -5,17 +5,18 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext  /**- * F-Droid, restricted twice over:+ * F-Droid, from a single hard-pinned repository.  *- * 1. **One repository only** — [DefaultRepos.FDROID_MAIN], with its index signing- *    certificate hard-pinned. Third-party F-Droid-format repos are not supported and- *    cannot be added, because they ship binaries the upstream developer built.- * 2. **Reproduced builds only** — a version is offered only if F-Droid's verification- *    server independently rebuilt it and got identical bytes (see [ReproducibleBuilds]).+ * **One repository only** — [DefaultRepos.FDROID_MAIN], with its index signing certificate+ * hard-pinned. Third-party F-Droid-format repos are not supported and cannot be added,+ * because they ship binaries the upstream developer built.  *- * Both gates fail closed: if the signed index or the verification feed can't be- * fetched and checked, the sync throws and the previous catalogue is left untouched- * rather than being replaced with unverified entries.+ * The whole catalogue is imported (newest version of every app). F-Droid's reproducibility+ * feed ([ReproducibleBuilds]) is consulted only to *badge* the versions that were+ * independently reproduced bit-for-bit — it no longer decides what is listed. That feed is+ * best-effort: if it can't be fetched, apps are simply imported without the badge rather+ * than the sync failing. The signed-index gate still fails closed, so the catalogue is+ * never replaced with entries whose hashes and signer keys weren't authenticated.  *  * Reads go through [CatalogRepository], which queries the cache table this writes.  */@@ -24,15 +25,15 @@ class FDroidAppProvider(     private val appContext: Context, ) { -    /** Number of packages dropped by the reproducibility gate on the last sync. */+    /** Number of packages tagged reproducible on the last sync. */     @Volatile-    var lastFilteredOut: Int = 0+    var lastReproducibleCount: Int = 0         private set      /**-     * Refresh from f-droid.org and replace this source's rows. Throws if either the index-     * signature or the reproducibility feed can't be obtained — the caller surfaces that-     * instead of silently serving a stale or unverified catalogue.+     * Refresh from f-droid.org and replace this source's rows. Throws if the signed index+     * can't be obtained — the caller surfaces that instead of silently serving a stale or+     * unauthenticated catalogue. A missing reproducibility feed is not fatal.      */     suspend fun syncIntoDb(): Int = withContext(Dispatchers.IO) {         val result = fetchVerifiedIndex()@@ -49,23 +50,20 @@ class FDroidAppProvider(     }      private suspend fun fetchVerifiedIndex(): FDroidRepository.IndexResult {-        // Fetch the reproducibility verdicts first: no verdicts means no catalogue, and-        // there is no point pulling 54 MB of index we would then throw away.-        val verified = ReproducibleBuilds.fetch(appContext)-        if (verified.size == 0) {-            throw java.io.IOException("F-Droid verification feed listed no reproduced builds")-        }-        var rejected = 0+        // Reproducibility verdicts are best-effort: a fetch failure just means nothing gets+        // the badge this sync, not that the catalogue disappears.+        val verified = runCatching { ReproducibleBuilds.fetch(appContext) }.getOrNull()+        var reproduced = 0         val result = FDroidRepository.fetchRepoIndex(             context = appContext,             repoUrl = DefaultRepos.FDROID_MAIN,             pinnedFingerprint = FDroidRepository.FDROID_SIGNING_CERT_SHA256,         ) { pkg, versionCode ->-            val ok = verified.contains(pkg, versionCode)-            if (!ok) rejected+++            val ok = verified?.contains(pkg, versionCode) == true+            if (ok) reproduced++             ok         }-        lastFilteredOut = rejected+        lastReproducibleCount = reproduced         return result     } }
appstore/src/main/java/com/vayunmathur/appstore/data/FDroidRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidRepository.ktindex bea8a7ba85..20b11c3069 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidRepository.kt@@ -40,28 +40,27 @@ object FDroidRepository {      * Fetch and verify [repoUrl]'s index.      *      * [pinnedFingerprint] null means trust-on-first-use, and the caller must persist-     * [IndexResult.signerSha256]. [acceptVersion] decides which versions of a package may-     * be offered at all — the newest *accepted* version wins, so a package whose latest-     * build has not yet been reproduced falls back to its newest reproduced one rather-     * than disappearing.+     * [IndexResult.signerSha256]. Every app's newest version is imported; [isReproducible]+     * only *tags* whether that version was independently reproduced (surfaced as a badge),+     * it never drops a version or a package.      */     suspend fun fetchRepoIndex(         context: Context,         repoUrl: String,         pinnedFingerprint: String?,-        acceptVersion: (packageName: String, versionCode: Long) -> Boolean,+        isReproducible: (packageName: String, versionCode: Long) -> Boolean,     ): IndexResult = withContext(Dispatchers.IO) {         val base = repoUrl.trimEnd('/')         val work = File(context.cacheDir, "fdroid-index/${base.hashCode()}").apply { mkdirs() }         try {             val errors = mutableListOf<String>()             try {-                return@withContext fetchV2(base, pinnedFingerprint, work, acceptVersion)+                return@withContext fetchV2(base, pinnedFingerprint, work, isReproducible)             } catch (e: Exception) {                 errors += "index-v2: ${e.message}"             }             try {-                return@withContext fetchV1(base, pinnedFingerprint, work, acceptVersion)+                return@withContext fetchV1(base, pinnedFingerprint, work, isReproducible)             } catch (e: Exception) {                 errors += "index-v1: ${e.message}"             }@@ -80,7 +79,7 @@ object FDroidRepository {         base: String,         pinnedFingerprint: String?,         work: File,-        acceptVersion: (String, Long) -> Boolean,+        isReproducible: (String, Long) -> Boolean,     ): IndexResult {         val entryJar = File(work, "entry.jar")         downloadToFile("$base/entry.jar", entryJar)@@ -102,7 +101,7 @@ object FDroidRepository {         }          return IndexResult(-            apps = AppProvider.filterTargetSdk(parseV2Streaming(indexFile, base, acceptVersion)),+            apps = AppProvider.filterTargetSdk(parseV2Streaming(indexFile, base, isReproducible)),             signerSha256 = verified.signerSha256,         )     }@@ -112,14 +111,14 @@ object FDroidRepository {         base: String,         pinnedFingerprint: String?,         work: File,-        acceptVersion: (String, Long) -> Boolean,+        isReproducible: (String, Long) -> Boolean,     ): IndexResult {         val jar = File(work, "index-v1.jar")         downloadToFile("$base/index-v1.jar", jar)         val indexFile = File(work, "index-v1.json")         val signer = SignedJarIndex.extractVerified(jar, "index-v1.json", pinnedFingerprint, indexFile)         return IndexResult(-            apps = AppProvider.filterTargetSdk(parseV1Streaming(indexFile, base, acceptVersion)),+            apps = AppProvider.filterTargetSdk(parseV1Streaming(indexFile, base, isReproducible)),             signerSha256 = signer,         )     }@@ -147,7 +146,7 @@ object FDroidRepository {     private fun parseV2Streaming(         file: File,         repoBase: String,-        acceptVersion: (String, Long) -> Boolean,+        isReproducible: (String, Long) -> Boolean,     ): List<UnifiedApp> {         val result = mutableListOf<UnifiedApp>()         JsonReader(file.reader()).use { r ->@@ -160,7 +159,7 @@ object FDroidRepository {                         while (r.hasNext()) {                             val pkg = r.nextName()                             try {-                                val app = parsePackageV2(r, pkg, repoBase, acceptVersion)+                                val app = parsePackageV2(r, pkg, repoBase, isReproducible)                                 if (app != null) result.add(app)                             } catch (_: Exception) {                                 try { r.skipValue() } catch (_: Exception) {}@@ -180,7 +179,7 @@ object FDroidRepository {         reader: JsonReader,         packageName: String,         repoBase: String,-        acceptVersion: (String, Long) -> Boolean,+        isReproducible: (String, Long) -> Boolean,     ): UnifiedApp? {         // reader at BEGIN_OBJECT of package         var metaName: String? = null@@ -311,10 +310,9 @@ object FDroidRepository {                                 }                             }                             reader.endObject()-                            // Newest *acceptable* version wins: a package whose latest build-                            // hasn't been reproduced yet falls back to its newest reproduced-                            // one instead of vanishing from the catalogue.-                            if (vAdded >= latestAdded && acceptVersion(packageName, vVersionCode)) {+                            // Newest version always wins; reproducibility is recorded as a+                            // badge below, not used to drop older-but-reproduced builds.+                            if (vAdded >= latestAdded) {                                 latestAdded = vAdded                                 latestFileName = vFileName                                 latestSize = vFileSize@@ -336,8 +334,8 @@ object FDroidRepository {         }         reader.endObject() -        // No version passed acceptVersion — drop the package entirely rather than-        // advertising an entry that has no installable APK behind it.+        // No usable version at all — drop the package rather than advertising an entry+        // that has no installable APK behind it.         if (latestAdded < 0L || latestFileName == null) return null          // index-v2 file names are repo-absolute ("/com.example_12.apk").@@ -347,6 +345,7 @@ object FDroidRepository {             source = AppSource.FDROID,             expectedSigners = latestSigners,             apkSha256 = latestSha256,+            reproducible = isReproducible(packageName, latestVersionCode),             name = metaName ?: packageName.substringAfterLast('.'),             summary = metaSummary ?: "",             description = metaDesc ?: "",@@ -376,7 +375,7 @@ object FDroidRepository {     private fun parseV1Streaming(         file: File,         repoBase: String,-        acceptVersion: (String, Long) -> Boolean,+        isReproducible: (String, Long) -> Boolean,     ): List<UnifiedApp> {         val appsMeta = mutableMapOf<String, V1AppMeta>()         val packagesMap = mutableMapOf<String, V1PackageLatest>()@@ -402,7 +401,7 @@ object FDroidRepository {                         while (r.hasNext()) {                             val pkgName = r.nextName()                             try {-                                val latest = parseV1PackagesArray(r, pkgName, acceptVersion)+                                val latest = parseV1PackagesArray(r)                                 if (latest != null) packagesMap[pkgName] = latest                             } catch (_: Exception) {                                 try { r.skipValue() } catch (_: Exception) {}@@ -418,7 +417,7 @@ object FDroidRepository {          val result = mutableListOf<UnifiedApp>()         for ((pkg, meta) in appsMeta) {-            // Same rule as v2: no acceptable version means no catalogue entry.+            // No version at all means no catalogue entry.             val latest = packagesMap[pkg] ?: continue             result.add(                 UnifiedApp(@@ -444,6 +443,7 @@ object FDroidRepository {                     sizeBytes = latest?.size ?: 0L,                     apkUrl = latest?.apkName?.let { repoBase + "/" + it.trimStart('/') },                     targetSdk = latest?.targetSdk,+                    reproducible = latest?.let { isReproducible(pkg, it.versionCode) } ?: false,                     expectedSigners = listOfNotNull(latest?.signer),                     // v1 states the hash algorithm; only pin it when it really is SHA-256.                     apkSha256 = latest?.hash?.takeIf { latest?.hashType.equals("sha256", true) },@@ -593,11 +593,10 @@ object FDroidRepository {      private fun parseV1PackagesArray(         reader: JsonReader,-        packageName: String,-        acceptVersion: (String, Long) -> Boolean,     ): V1PackageLatest? {-        // array of package versions, take the last acceptable one-        var last: V1PackageLatest? = null+        // Array of package versions; keep the one with the highest versionCode rather than+        // relying on array order.+        var best: V1PackageLatest? = null         reader.beginArray()         while (reader.hasNext()) {             try {@@ -624,8 +623,8 @@ object FDroidRepository {                     }                 }                 reader.endObject()-                if (acceptVersion(packageName, versionCode)) {-                    last = V1PackageLatest(+                if (best == null || versionCode > best.versionCode) {+                    best = V1PackageLatest(                         apkName, versionName, versionCode, size, targetSdk, hash, hashType, signer                     )                 }@@ -635,7 +634,7 @@ object FDroidRepository {             }         }         reader.endArray()-        return last+        return best     }      // ---- Helpers ----
appstore/src/main/java/com/vayunmathur/appstore/data/FDroidVerification.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidVerification.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidVerification.ktindex b0d4f2ada9..d3b7c6651a 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidVerification.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/FDroidVerification.kt@@ -29,8 +29,9 @@ import java.io.File  * never match the published APK's hash — `verified` is the field that carries the  * verdict, not a hash comparison.  *- * This is a hard gate: [ReproducibleBuilds.fetch] throwing means the F-Droid sync fails- * rather than falling back to importing unreproduced apps.+ * This drives a per-app **badge**, not a gate: [ReproducibleBuilds.fetch] is best-effort,+ * and a failure just means no app is badged reproducible this sync — the catalogue is still+ * imported in full. See [FDroidAppProvider].  */ object ReproducibleBuilds { 
appstore/src/main/java/com/vayunmathur/appstore/data/play/DeviceInfoProvider.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/play/DeviceInfoProvider.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/play/DeviceInfoProvider.ktindex 4a57d3d60a..3330f8623c 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/play/DeviceInfoProvider.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/play/DeviceInfoProvider.kt@@ -16,6 +16,31 @@ import java.util.Properties  */ object DeviceInfoProvider { +    /**+     * The exact device profile Aurora ships and its dispenser is tuned to:+     * gplayapi's bundled `gplayapi_px_9a.properties` (Pixel 9a, Finsky 45.8.21-31,+     * Vending 84582130, sdk 35). The AAR merges its res/raw into this module, so we+     * load it by name.+     *+     * Prefer this over [buildDeviceProperties]: the shared anonymous accounts the+     * dispenser hands out are minted against this standard profile, and gplayapi's+     * hardcoded `X-DFE-Encoded-Targets`/`X-DFE-Phenotype` headers are tuned for this+     * Finsky version. A runtime-built native profile (esp. on de-Googled ROMs, where+     * [GsfVersionProvider] falls back to a 2020-era Finsky 21.5.17) is inconsistent+     * with those headers and gets auth/purchase rejected — i.e. "keys not working".+     * Falls back to the native profile only if the bundled resource is missing.+     */+    fun auroraProfile(context: Context): Properties = try {+        val id = context.resources.getIdentifier("gplayapi_px_9a", "raw", context.packageName)+        if (id != 0) {+            context.resources.openRawResource(id).use { input -> Properties().apply { load(input) } }+        } else {+            buildDeviceProperties(context)+        }+    } catch (_: Exception) {+        buildDeviceProperties(context)+    }+     fun buildDeviceProperties(context: Context): Properties {         val props = Properties()         val pm = context.packageManager
appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.ktindex 82995a804f..4596763f2c 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/play/PlayRepository.kt@@ -148,7 +148,9 @@ class PlayRepository(private val context: Context) {          _authState.value = PlayAuthState.Authenticating -        val deviceProps = DeviceInfoProvider.buildDeviceProperties(context)+        // Use the same curated Pixel 9a profile Aurora + its dispenser are tuned to,+        // so the dispensed anonymous accounts and gplayapi's DFE headers stay consistent.+        val deviceProps = DeviceInfoProvider.auroraProfile(context)         val result = anonAuthRepo.ensureAuthData(context, deviceProps)         val authData = result.getOrElse { err ->             _authState.value = PlayAuthState.Error(anonAuthRepo.errorMessage(err))
appstore/src/main/java/com/vayunmathur/appstore/data/security/InstallVerifier.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/security/InstallVerifier.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/security/InstallVerifier.ktindex b7712dd334..440b363ae2 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/security/InstallVerifier.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/security/InstallVerifier.kt@@ -97,17 +97,23 @@ object InstallVerifier {         }          // The catalogue filters on the target SDK each source *claims*, which a source-        // may not state at all. Re-check it against the manifest we now hold, so the-        // floor holds for every install regardless of what the listing said.-        parsed.firstNotNullOfOrNull { (_, info) -> info?.applicationInfo?.targetSdkVersion }-            ?.let { target ->-                if (target < AppProvider.MIN_TARGET_SDK) {-                    return VerificationResult.Rejected(-                        "it is built for Android API $target, and this store needs " +-                            "${AppProvider.MIN_TARGET_SDK} or newer"-                    )-                }-            }+        // may not state at all. Re-check it against the manifest we now hold, so the floor+        // holds for every install regardless of what the listing said.+        //+        // Read it from the *base* APK specifically: a config split carries no <uses-sdk>,+        // so an arbitrary file's value (0, or absent) is meaningless and reading it first+        // by chance would either miss a low-target base or wrongly reject a valid one. Block+        // only when the base APK's target is actually readable and below the floor —+        // targetSdkVersion == 0 means "couldn't determine", which stays allowed by policy.+        val baseTargetSdk = parsed.firstOrNull { (_, info) ->+            info?.packageName == requirement.expectedPackage && info.splitNames.isNullOrEmpty()+        }?.second?.applicationInfo?.targetSdkVersion ?: 0+        if (baseTargetSdk in 1 until AppProvider.MIN_TARGET_SDK) {+            return VerificationResult.Rejected(+                "it is built for Android API $baseTargetSdk, and this store needs " ++                    "${AppProvider.MIN_TARGET_SDK} or newer"+            )+        }          // Signers of the bytes we actually hold. Every readable file must agree, or the         // set is mixed and something has been substituted.
appstore/src/main/java/com/vayunmathur/appstore/data/security/TrustProfile.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/security/TrustProfile.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/security/TrustProfile.ktindex aea84cde79..e04d85766d 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/security/TrustProfile.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/security/TrustProfile.kt@@ -73,8 +73,9 @@ enum class TrustProfile {     MODERN_APPS,      /**-     * F-Droid, restricted to builds F-Droid's verification server independently-     * reproduced bit-for-bit.+     * F-Droid, from the one hard-pinned repository. Versions independently reproduced+     * bit-for-bit by F-Droid's verification server are badged; reproducibility is a badge,+     * not an admission gate.      */     FDROID, @@ -150,8 +151,8 @@ enum class TrustProfile {     companion object {         fun of(source: AppSource): TrustProfile = when (source) {             AppSource.MODERN_APPS -> MODERN_APPS-            // Non-reproduced F-Droid packages are dropped during sync and never reach the-            // UI, so anything surviving from FDROID really was rebuilt.+            // The whole F-Droid catalogue is listed; whether a given version was reproduced+            // is shown per-app as a badge (see UnifiedApp.reproducible).             AppSource.FDROID -> FDROID             AppSource.PLAYSTORE -> PLAY         }
appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailPage.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailPage.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailPage.ktindex 3bb86f5fb0..cf5a239340 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailPage.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailPage.kt@@ -378,12 +378,16 @@ private fun WhatsNew(app: UnifiedApp) {  @Composable private fun Chips(app: UnifiedApp) {-    if (app.categories.isEmpty() && app.antiFeatures.isEmpty() && !app.containsAds) return+    if (app.categories.isEmpty() && app.antiFeatures.isEmpty() && !app.containsAds && !app.reproducible) return     LazyRow(         Modifier.fillMaxWidth(),         contentPadding = PaddingValues(horizontal = 16.dp),         horizontalArrangement = Arrangement.spacedBy(8.dp),     ) {+        // F-Droid versions the verification server rebuilt bit-for-bit earn a positive badge.+        if (app.reproducible) {+            item("reproducible") { InfoChip(stringResource(R.string.chip_reproducible)) }+        }         items(app.categories, key = { "cat-$it" }) { InfoChip(it) }         if (app.containsAds) {             item("ads") { InfoChip(stringResource(R.string.chip_contains_ads), emphasise = true) }
appstore/src/main/res/values/strings.xml
diff --git a/appstore/src/main/res/values/strings.xml b/appstore/src/main/res/values/strings.xmlindex d361dbd9d5..ad36e9da5a 100644--- a/appstore/src/main/res/values/strings.xml+++ b/appstore/src/main/res/values/strings.xml@@ -31,7 +31,7 @@     <string name="section_modern_apps_subtitle">Built in this repo and signed with the same key as this store</string>     <string name="section_play_top_charts">Top on the Play Store</string>     <string name="section_recently_updated">New and updated</string>-    <string name="section_recently_updated_subtitle">The newest builds F-Droid has reproduced</string>+    <string name="section_recently_updated_subtitle">The newest builds on F-Droid</string>     <string name="section_category_subtitle">Apps from the offline catalogue in this category</string>     <string name="home_empty_title">Nothing here yet</string>     <string name="home_empty_message">Sync your sources to fill this up, or search for an app by name.</string>@@ -104,6 +104,7 @@     <string name="detail_rating_count">Ratings</string>     <string name="detail_permissions">Permissions</string>     <string name="chip_contains_ads">Contains ads</string>+    <string name="chip_reproducible">Reproducible build</string>     <string name="link_website">Website</string>     <string name="link_source">Source code</string>     <string name="link_privacy">Privacy policy</string>@@ -154,13 +155,13 @@     <string name="trust_modern_apps_limits">One developer, one key, no independent review and nobody rebuilding the source to confirm the app matches it. There is no scanning and no way to pull a bad release off phones that already took it.</string>      <string name="trust_fdroid_title">F-Droid</string>-    <string name="trust_fdroid_summary">Built from public source code, and independently rebuilt by a second machine that got an identical file. Only versions that were reproduced are offered here.</string>+    <string name="trust_fdroid_summary">Built from public source code. Versions a second machine independently rebuilt to an identical file are badged as reproducible.</string>     <string name="trust_fdroid_practice_source">Every app is built from source F-Droid publishes, not from a binary a developer sent in</string>-    <string name="trust_fdroid_practice_rebuild">A second build server rebuilds it and compares the result byte for byte</string>+    <string name="trust_fdroid_practice_rebuild">A second build server rebuilds many apps and compares the result byte for byte</string>     <string name="trust_fdroid_practice_antifeatures">Tracking, ads and non-free dependencies are labelled on the listing</string>     <string name="trust_fdroid_check_index_signed">F-Droid\'s app list is signed, and checked against a key built into this store</string>     <string name="trust_fdroid_check_chained">Every entry in that list is chained back to the signature</string>-    <string name="trust_fdroid_check_rebuilt">F-Droid\'s second build server rebuilt this exact version and got the same file</string>+    <string name="trust_fdroid_check_rebuilt">Versions F-Droid\'s second build server reproduced bit-for-bit are badged as reproducible</string>     <string name="trust_fdroid_check_hash_and_key">The hash and the signing key both come from the signed list</string>     <string name="trust_fdroid_limits">F-Droid holds the signing key, not the developer, so its build servers can sign anything. Nobody checks what an app does, only that it matches its source. Updates wait to be rebuilt, which can take days or weeks — security fixes included — and there is no way to pull a bad app back off phones.</string> @@ -180,7 +181,7 @@     <string name="repos_sync_sources">Sync sources</string>     <string name="source_modern_apps">Modern Apps</string>     <string name="source_modern_apps_pin">Pinned to this app\'s own signing key</string>-    <string name="source_fdroid">F-Droid (reproducible builds only)</string>+    <string name="source_fdroid">F-Droid</string>     <string name="source_fdroid_pin">Pinned to F-Droid\'s app list signing key</string>     <string name="source_play">Play Store (anonymous)</string>     <string name="source_play_pin">Nothing to pin: Google holds the signing key</string>