1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-07 21:37:02 +09:00

DROID-3232 App | Tech | Script for preparing Android App manifest for APK distribution (#2087)

This commit is contained in:
Evgenii Kozlov 2025-02-12 13:25:48 +01:00 committed by Evgenii Kozlov
parent 24f7f62bb4
commit 4b36bf5832
3 changed files with 26 additions and 1 deletions

View file

@ -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

View file

@ -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
update_mw_custom: download_mw_artefacts_custom
prepare_app_manifest_for_release_apk:
./scripts/release/apk.sh

19
scripts/release/apk.sh Executable file
View file

@ -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|<!-- <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />-->|<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />|' "$FILE"
sed -i '' 's|<!-- <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />-->|<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />|' "$FILE"
else
# Linux (sed works without the empty string argument for in-place editing)
sed -i 's|<!-- <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />-->|<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />|' "$FILE"
sed -i 's|<!-- <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />-->|<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />|' "$FILE"
fi
echo "Lines uncommented successfully."