mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-11 16:20:01 +00:00
31 lines
1.2 KiB
Bash
Executable File
31 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
# Safety measures
|
|
[ -n "$1" ] || exit 1
|
|
set -eu
|
|
|
|
tmp=$(mktemp -d -t)
|
|
libsim=$(cat "$1" | grep libsimplex)
|
|
libsup=$(cat "$1" | grep libsupport)
|
|
commit="${2:-nix-android}"
|
|
|
|
# Clone simplex
|
|
git clone https://github.com/simplex-chat/simplex-chat "$tmp/simplex-chat"
|
|
|
|
# Switch to nix-android branch
|
|
git -C "$tmp/simplex-chat" checkout "$commit"
|
|
|
|
# Create missing folders
|
|
mkdir -p "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
|
|
|
curl -sSf "$libsim" -o "$tmp/libsimplex.zip"
|
|
unzip -o "$tmp/libsimplex.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
|
|
|
curl -sSf "$libsup" -o "$tmp/libsupport.zip"
|
|
unzip -o "$tmp/libsupport.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
|
|
|
# Build only the arch the libs were downloaded for
|
|
sed -i.bak 's/include(.*/include("arm64-v8a")/' "$tmp/simplex-chat/apps/multiplatform/android/build.gradle.kts"
|
|
|
|
gradle -p "$tmp/simplex-chat/apps/multiplatform/" -Psimplex.assets.dir=../../assets clean :android:assembleFossRelease
|
|
cp "$tmp/simplex-chat/apps/multiplatform/android/build/outputs/apk/foss/release/android-foss-arm64-v8a-release-unsigned.apk" "$PWD/simplex-chat.apk"
|