From dd170979eb591b1ef6ac0e0df2b1abdc143b9b9f Mon Sep 17 00:00:00 2001 From: linonetwo Date: Thu, 22 Feb 2024 18:13:31 +0800 Subject: [PATCH] chore: comment out signingConfig --- .github/workflows/build-f-droid-apk.yml | 2 +- scripts/removeDebugSigningConfigs.mjs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 scripts/removeDebugSigningConfigs.mjs diff --git a/.github/workflows/build-f-droid-apk.yml b/.github/workflows/build-f-droid-apk.yml index 1ae6d25..0f0057b 100644 --- a/.github/workflows/build-f-droid-apk.yml +++ b/.github/workflows/build-f-droid-apk.yml @@ -86,7 +86,7 @@ jobs: - name: Build by eject eas and remove debug signing key run: | npx expo prebuild -p android --clean - sed -i '/signingConfigs {/,/^[[:space:]]*}/{d;}' android/app/build.gradle + zx scripts/removeDebugSigningConfigs.mjs # TODO: https://github.com/tiddly-gittly/TidGi-Mobile/issues/6 # - name: Remove prorietary bits (for fix f-droid) diff --git a/scripts/removeDebugSigningConfigs.mjs b/scripts/removeDebugSigningConfigs.mjs new file mode 100644 index 0000000..8ccc920 --- /dev/null +++ b/scripts/removeDebugSigningConfigs.mjs @@ -0,0 +1,9 @@ +import { promises as fs } from 'fs'; + +const gradleFilePath = './android/app/build.gradle'; +let gradleFileContent = await fs.readFile(gradleFilePath, 'utf8'); + +// Correctly comment out the 'signingConfig' line in the 'release' build type +gradleFileContent = gradleFileContent.replaceAll(/signingConfig signingConfigs.debug/g, '// signingConfig signingConfigs.debug'); + +await fs.writeFile(gradleFilePath, gradleFileContent);