Просмотр исходного кода

chore: use the saved project debug keystore for builds

Krasimir Kazakov 1 неделя назад
Родитель
Сommit
c7be96103b
2 измененных файлов с 16 добавлено и 1 удалено
  1. 1 1
      AGENTS.md
  2. 15 0
      android/app/build.gradle.kts

+ 1 - 1
AGENTS.md

@@ -124,4 +124,4 @@ Release checklist:
    `https://git.krasi.net/api/v1/repos/kkazakov/car-interface-android/releases`,
    `https://git.krasi.net/api/v1/repos/kkazakov/car-interface-android/releases`,
    selects the highest published semver tag, and downloads
    selects the highest published semver tag, and downloads
    `/raw/main/releases/cardash-android-<version>.apk`. No app-side release configuration is needed.
    `/raw/main/releases/cardash-android-<version>.apk`. No app-side release configuration is needed.
-7. The current release build uses the project debug signing config. Reuse the existing debug keystore (certificate SHA-256 `C2:8E:5B:0B:E0:F8:27:EE:12:22:B0:62:9F:EE:1C:F2:7E:14:3F:78:95:86:1E:3F:34:15:A6:E5:3A:06:BE:ED`); never let Gradle generate a fresh debug key for a release, or in-place updates will fail. Android still requires the user to confirm installation and allow unknown-app installs once; never attempt silent installation.
+7. The current release build uses the project debug signing config. Reuse the existing debug keystore (certificate SHA-256 `C2:8E:5B:0B:E0:F8:27:EE:12:22:B0:62:9F:EE:1C:F2:7E:14:3F:78:95:86:1E:3F:34:15:A6:E5:3A:06:BE:ED`). It is stored locally at `android/keystore/debug.keystore`; that path is gitignored and must never be committed. The Gradle config uses it for debug and release when present, falling back to the default debug key otherwise. Never let Gradle generate a fresh key for a release, or in-place updates will fail. Android still requires the user to confirm installation and allow unknown-app installs once; never attempt silent installation.

+ 15 - 0
android/app/build.gradle.kts

@@ -4,6 +4,10 @@ plugins {
     id("dev.flutter.flutter-gradle-plugin")
     id("dev.flutter.flutter-gradle-plugin")
 }
 }
 
 
+// Local-only signing key. It is gitignored and shared by debug and release
+// builds so in-place updates keep the same package signature.
+val projectDebugKeystore = rootProject.file("keystore/debug.keystore")
+
 android {
 android {
     namespace = "com.wasp.cardash_launcher"
     namespace = "com.wasp.cardash_launcher"
     compileSdk = 36
     compileSdk = 36
@@ -22,6 +26,17 @@ android {
         versionName = flutter.versionName
         versionName = flutter.versionName
     }
     }
 
 
+    signingConfigs {
+        getByName("debug") {
+            if (projectDebugKeystore.exists()) {
+                storeFile = projectDebugKeystore
+                storePassword = "android"
+                keyAlias = "androiddebugkey"
+                keyPassword = "android"
+            }
+        }
+    }
+
     buildTypes {
     buildTypes {
         release {
         release {
             // Local-only build for now. Replace with a real signing config before distribution.
             // Local-only build for now. Replace with a real signing config before distribution.