From 2b710f3f655dd9602bb32a88ccfb843667adc419 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Tue, 8 Sep 2026 18:23:42 +0200 Subject: [PATCH] sec: load release signing credentials from local.properties or env instead of hardcoded values --- android/app/build.gradle | 14 ++++++++++++-- withAndroidSigning.js | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c5bac30e..ab8afbf9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -107,9 +107,19 @@ android { release { storeFile file("../../schnappix-upload-key.keystore") - storePassword "#O0he7k00O0he7k00!" + def localProperties = new Properties() + def localPropertiesFile = rootProject.file("local.properties") + if (!localPropertiesFile.exists()) { + localPropertiesFile = rootProject.file("../local.properties") + } + if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } + } + storePassword localProperties.getProperty("RELEASE_STORE_PASSWORD") ?: System.getenv("RELEASE_STORE_PASSWORD") ?: "" keyAlias "schnappix-alias" - keyPassword "#O0he7k00O0he7k00!" + keyPassword localProperties.getProperty("RELEASE_KEY_PASSWORD") ?: System.getenv("RELEASE_KEY_PASSWORD") ?: "" } } diff --git a/withAndroidSigning.js b/withAndroidSigning.js index 2d37c3db..4cf1aaa5 100644 --- a/withAndroidSigning.js +++ b/withAndroidSigning.js @@ -8,9 +8,19 @@ module.exports = function withAndroidSigning(config) { const signingConfig = ` release { storeFile file("../../schnappix-upload-key.keystore") - storePassword "#O0he7k00O0he7k00!" + def localProperties = new Properties() + def localPropertiesFile = rootProject.file("local.properties") + if (!localPropertiesFile.exists()) { + localPropertiesFile = rootProject.file("../local.properties") + } + if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } + } + storePassword localProperties.getProperty("RELEASE_STORE_PASSWORD") ?: System.getenv("RELEASE_STORE_PASSWORD") ?: "" keyAlias "schnappix-alias" - keyPassword "#O0he7k00O0he7k00!" + keyPassword localProperties.getProperty("RELEASE_KEY_PASSWORD") ?: System.getenv("RELEASE_KEY_PASSWORD") ?: "" } `;