From 26e4682c76ecea93b892e1fe69ea7bd6c83c44a1 Mon Sep 17 00:00:00 2001 From: Evgenii Kozlov Date: Wed, 12 Feb 2025 13:25:48 +0100 Subject: [PATCH] DROID-3232 App | Tech | Script for preparing Android App manifest for APK distribution (#2087) --- .github/workflows/release.yml | 3 +++ Makefile | 5 ++++- scripts/release/apk.sh | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/release/apk.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1817fa400d..deaa02d2c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,9 @@ jobs: -Pcom.anytype.ci=true \ -Dorg.gradle.unsafe.configuration-cache=false" + - name: Prepare Android Manifest for APKs + run: ./scripts/release/apk.sh + - name: Build release APKS run: ./gradlew :app:assembleRelease diff --git a/Makefile b/Makefile index 29ce2c0d3f..5c2c525cd1 100644 --- a/Makefile +++ b/Makefile @@ -47,4 +47,7 @@ clean_protos: update_mw: download_mw_artefacts normalize_mw_imports clean_protos # Update mw from custom build (download only library, you have to update your proto files manually) -update_mw_custom: download_mw_artefacts_custom \ No newline at end of file +update_mw_custom: download_mw_artefacts_custom + +prepare_app_manifest_for_release_apk: + ./scripts/release/apk.sh diff --git a/scripts/release/apk.sh b/scripts/release/apk.sh new file mode 100755 index 0000000000..bd5543ab10 --- /dev/null +++ b/scripts/release/apk.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Script for preparing Android Manifest for APK distribution. + +# Define the file to be modified +FILE="app/src/main/AndroidManifest.xml" + +# Check if the system is macOS or Linux +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS (sed requires an empty string argument for in-place editing) + sed -i '' 's|||' "$FILE" + sed -i '' 's|||' "$FILE" +else + # Linux (sed works without the empty string argument for in-place editing) + sed -i 's|||' "$FILE" + sed -i 's|||' "$FILE" +fi + +echo "Lines uncommented successfully." \ No newline at end of file