feat: release signing via secrets.properties and shared keystore
Gradle reads signing credentials from repo-root secrets.properties; secrets.properties.example documents setup for work and home builds. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Android-клиент [Security Alert Center (SAC)](https://git.kalinamall.ru/PapaTramp/security-alert-center).
|
||||
|
||||
**Версия:** `0.5.11` (versionCode 25)
|
||||
**Версия:** `0.5.15` (versionCode 29)
|
||||
|
||||
## Возможности
|
||||
|
||||
@@ -29,12 +29,20 @@ Android-клиент [Security Alert Center (SAC)](https://git.kalinamall.ru/Pap
|
||||
|
||||
JDK 17+, `local.properties`. Опционально `app/google-services.json` для FCM.
|
||||
|
||||
**Debug** (ключ свой на каждом ПК):
|
||||
|
||||
```bash
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
APK: `app/build/outputs/apk/debug/app-debug.apk`
|
||||
|
||||
**Release** (один ключ на всех ПК — для обновлений поверх старой версии):
|
||||
|
||||
1. Положить `seaca-release.jks` в корень репозитория (не в git).
|
||||
2. Скопировать `secrets.properties.example` → `secrets.properties`, подставить пароль (ASCII).
|
||||
3. `.\gradlew assembleRelease` — APK: `app/build/outputs/apk/release/app-release.apk`
|
||||
|
||||
## Репозитории
|
||||
|
||||
| Репозиторий | URL |
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
@@ -5,6 +7,15 @@ plugins {
|
||||
id("org.jetbrains.kotlin.plugin.serialization")
|
||||
}
|
||||
|
||||
val secretsFile = rootProject.file("secrets.properties")
|
||||
val releaseSecrets = Properties().apply {
|
||||
if (secretsFile.exists()) {
|
||||
secretsFile.inputStream().use { load(it) }
|
||||
}
|
||||
}
|
||||
val releaseKeystoreConfigured = secretsFile.exists() &&
|
||||
releaseSecrets.getProperty("SEACA_STORE_FILE") != null
|
||||
|
||||
android {
|
||||
namespace = "ru.kalinamall.seaca"
|
||||
compileSdk = 35
|
||||
@@ -17,8 +28,22 @@ android {
|
||||
versionName = "0.5.15"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (releaseKeystoreConfigured) {
|
||||
create("release") {
|
||||
storeFile = rootProject.file(releaseSecrets.getProperty("SEACA_STORE_FILE"))
|
||||
storePassword = releaseSecrets.getProperty("SEACA_STORE_PASSWORD")
|
||||
keyAlias = releaseSecrets.getProperty("SEACA_KEY_ALIAS")
|
||||
keyPassword = releaseSecrets.getProperty("SEACA_KEY_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
if (releaseKeystoreConfigured) {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Скопируйте в secrets.properties в корне репозитория (рядом с gradlew.bat).
|
||||
# Пароль — только ASCII (латиница, цифры, символы). Store и key — один пароль.
|
||||
# seaca-release.jks — тот же файл на рабочем и домашнем ПК (не в git).
|
||||
|
||||
SEACA_STORE_FILE=seaca-release.jks
|
||||
SEACA_STORE_PASSWORD=change-me-ascii-only
|
||||
SEACA_KEY_ALIAS=seaca
|
||||
SEACA_KEY_PASSWORD=change-me-ascii-only
|
||||
Reference in New Issue
Block a user