From e230fb42b81245beb19a0570710d94ed47517aa1 Mon Sep 17 00:00:00 2001 From: Dennis Guse Date: Tue, 24 Dec 2024 15:01:23 +0100 Subject: [PATCH] Reproducible build: prepare using the PlayStore key for reproducible builds. Part of #418. --- build.gradle | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 13b93730a..afc98c3d8 100644 --- a/build.gradle +++ b/build.gradle @@ -95,30 +95,41 @@ android { } nightly { - signingConfig signingConfigs.nightly applicationIdSuffix ".nightly" + signingConfig signingConfigs.nightly } release { + // Non-reproducible: https://f-droid.org/de/packages/de.dennisguse.opentracks/ crunchPngs false minifyEnabled false + versionNameSuffix "irreproducible" } - releasePlayStore { + reproducible { + // Developer Binaries: https://github.com/OpenTracksApp/OSMDashboard/releases/download/v%v/de.dennisguse.opentracks.playstore_%v.apk + // FDroid: https://f-droid.org/de/packages/de.dennisguse.opentracks.playstore + // PlayStore: https://play.google.com/store/apps/details?id=de.dennisguse.opentracks.playstore applicationIdSuffix ".playstore" - versionNameSuffix "-PlayStore" - signingConfig signingConfigs.debug + + crunchPngs false + minifyEnabled false } } applicationVariants.configureEach { variant -> variant.resValue "string", "applicationId", variant.applicationId - if (variant.buildType.name == 'nightly') { - variant.outputs.configureEach { + variant.outputs.configureEach { + if (variant.buildType.name == 'reproducible') { + outputFileName = "${applicationId}_${variant.buildType.name}_${variant.versionName}.apk" + } else { + outputFileName = "${applicationId}_${variant.buildType.name}_${variant.versionCode}.apk" + } + + if (variant.buildType.name == 'nightly') { setVersionCodeOverride(getVersionCode()) setVersionNameOverride(getVersionName()) - outputFileName = "${applicationId}_${variant.versionCode}.apk" } } }