From c0f1b3d5e3f505fff06ff163342be19b7b8defe5 Mon Sep 17 00:00:00 2001 From: Kgothatso Ngako Date: Wed, 18 Nov 2026 11:00:44 +0200 Subject: [PATCH] build: Giza's version numbers and an upload key from outside the repo (fork, Phase 7) versionCode 1 and versionName 0.1.0: a new applicationId has no store history to stay above. The desktop packageVersion stays 1.0.0, since jpackage refuses a DMG whose major version is 0. Release builds are signed with an upload key named by gradle properties (giza.upload.*) or the environment (GIZA_UPLOAD_*), and are unsigned without them, as before. Key files are gitignored. It must never be Bennu's key. The store records, provisioning and listings are outside this tree. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 3 +++ composeApp/build.gradle.kts | 28 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e7ee90c3..3a464858 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ captures **/xcshareddata/WorkspaceSettings.xcsettings node_modules/ gradle/gradle-daemon-jvm.properties +# Signing keys live outside the repository (composeApp/build.gradle.kts, signingConfigs). +*.jks +*.keystore diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 04e85766..2d54de37 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -198,8 +198,31 @@ android { applicationId = "mobi.giza.android" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() - versionCode = 9 - versionName = "0.1.5" + // Giza's own numbering, from the start (docs/giza-rebrand.md, D7). A new + // applicationId has no versions in the store to stay above; Bennu's ran to 9, 0.1.5. + versionCode = 1 + versionName = "0.1.0" + } + // The upload key, from outside the repository: gradle properties (~/.gradle/gradle.properties, + // or -P on the command line) or the environment, under the names below. Without them a + // release build is unsigned, as Bennu's always were from this script, and is signed by hand. + // + // Never Bennu's key. Two apps sharing a key is half of what Android needs to let one read + // the other's data, and Giza must never be able to open Bennu's (giza-rebrand.md, Phase 0). + val uploadStoreFile = providers.gradleProperty("giza.upload.storeFile") + .orElse(providers.environmentVariable("GIZA_UPLOAD_STORE_FILE")) + signingConfigs { + if (uploadStoreFile.isPresent) { + create("upload") { + storeFile = file(uploadStoreFile.get()) + storePassword = providers.gradleProperty("giza.upload.storePassword") + .orElse(providers.environmentVariable("GIZA_UPLOAD_STORE_PASSWORD")).get() + keyAlias = providers.gradleProperty("giza.upload.keyAlias") + .orElse(providers.environmentVariable("GIZA_UPLOAD_KEY_ALIAS")).get() + keyPassword = providers.gradleProperty("giza.upload.keyPassword") + .orElse(providers.environmentVariable("GIZA_UPLOAD_KEY_PASSWORD")).get() + } + } } packaging { resources { @@ -210,6 +233,7 @@ android { buildTypes { getByName("release") { isMinifyEnabled = false + signingConfigs.findByName("upload")?.let { signingConfig = it } } getByName("debug") { applicationIdSuffix = ".debug"