Преглед изворни кода

chore: use the saved project debug keystore for builds

Krasimir Kazakov пре 1 недеља
родитељ
комит
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`,
    selects the highest published semver tag, and downloads
    `/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")
 }
 
+// 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 {
     namespace = "com.wasp.cardash_launcher"
     compileSdk = 36
@@ -22,6 +26,17 @@ android {
         versionName = flutter.versionName
     }
 
+    signingConfigs {
+        getByName("debug") {
+            if (projectDebugKeystore.exists()) {
+                storeFile = projectDebugKeystore
+                storePassword = "android"
+                keyAlias = "androiddebugkey"
+                keyPassword = "android"
+            }
+        }
+    }
+
     buildTypes {
         release {
             // Local-only build for now. Replace with a real signing config before distribution.