2022-08-12 13:30:51 +03:00
|
|
|
#!/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
|
2023-07-01 22:44:36 +03:00
|
|
|
mkdir -p "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
2022-08-12 13:30:51 +03:00
|
|
|
|
|
|
|
curl -sSf "$libsim" -o "$tmp/libsimplex.zip"
|
2023-07-01 22:44:36 +03:00
|
|
|
unzip -o "$tmp/libsimplex.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
2022-08-12 13:30:51 +03:00
|
|
|
|
|
|
|
curl -sSf "$libsup" -o "$tmp/libsupport.zip"
|
2023-07-01 22:44:36 +03:00
|
|
|
unzip -o "$tmp/libsupport.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
|
2022-08-12 13:30:51 +03:00
|
|
|
|
2023-06-29 14:53:11 +03:00
|
|
|
gradle -p "$tmp/simplex-chat/apps/multiplatform/" clean build
|
|
|
|
cp "$tmp/simplex-chat/apps/multiplatform/android/build/outputs/apk/release/android-release-unsigned.apk" "$PWD/simplex-chat.apk"
|