From e50f99c975a549d4793fb715c5be5e40636739b8 Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Sun, 1 Mar 2026 09:09:15 +0100 Subject: [PATCH] security: remove keystore and hardcoded signing credentials - Remove pixel10.keystore from repository - Move signing passwords to local.properties (gitignored) - Add *.keystore and *.jks to .gitignore - build.gradle.kts now reads credentials from local.properties After pulling, create local.properties with: KEYSTORE_FILE=pixel10.keystore KEYSTORE_PASSWORD= KEY_ALIAS=pixel10 KEY_PASSWORD= --- .gitignore | 2 ++ app/build.gradle.kts | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index dc81b83..d644dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ local.properties *.bin *.task *.tflite +*.keystore +*.jks diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cbd6085..5c4954d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,15 +15,19 @@ android { versionName = "1.8.0" } - val keystoreFile = rootProject.file("pixel10.keystore") + val localProps = rootProject.file("local.properties") + val props = java.util.Properties().apply { + if (localProps.exists()) load(localProps.inputStream()) + } + val keystoreFile = rootProject.file(props.getProperty("KEYSTORE_FILE", "pixel10.keystore")) signingConfigs { create("release") { - if (keystoreFile.exists()) { + if (keystoreFile.exists() && props.containsKey("KEYSTORE_PASSWORD")) { storeFile = keystoreFile - storePassword = "pixel10ai" - keyAlias = "pixel10" - keyPassword = "pixel10ai" + storePassword = props.getProperty("KEYSTORE_PASSWORD") + keyAlias = props.getProperty("KEY_ALIAS", "pixel10") + keyPassword = props.getProperty("KEY_PASSWORD") } } }