mirror of
https://github.com/This-null/flexcam.git
synced 2026-09-02 23:43:49 +08:00
Sign release builds with a dedicated release key
- Add a release signing config that reads keystore.properties when present - Keep debug builds working when the key file is absent - Enable v2 and v3 signature schemes so the key can be rotated later - Ignore keystores and keystore.properties so secrets stay out of the repo
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -33,3 +33,9 @@ release/FlexCam-Windows.zip
|
||||
|
||||
# Personal handoff/backup note (not for the repo)
|
||||
FLEXCAM-HANDOFF.md
|
||||
|
||||
# Signing keys and secrets (never commit)
|
||||
*.jks
|
||||
*.keystore
|
||||
keystore.properties
|
||||
android/keystore.properties
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
android {
|
||||
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||
val keystoreProperties = Properties()
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
namespace = "com.flexcam"
|
||||
compileSdk = 36
|
||||
|
||||
@@ -15,9 +24,25 @@ android {
|
||||
versionName = "1.3"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
create("release") {
|
||||
storeFile = file(keystoreProperties["storeFile"] as String)
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
enableV2Signing = true
|
||||
enableV3Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user