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);