diff options
author | George Hazan <ghazan@miranda.im> | 2022-11-30 17:48:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-11-30 17:48:47 +0300 |
commit | 0ece30dc7c0e34b4c5911969b8fa99c33c6d023c (patch) | |
tree | 671325d3fec09b999411e4e3ab84ef8259261818 /protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh | |
parent | 46c53ffc6809c67e4607e99951a2846c382b63b2 (diff) |
Telegram: update for TDLIB
Diffstat (limited to 'protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh')
-rw-r--r-- | protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh b/protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh new file mode 100644 index 0000000000..61d93170a5 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/android/fetch-sdk.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +ANDROID_SDK_ROOT=${1:-SDK} +ANDROID_NDK_VERSION=${2:-23.2.8568313} + +if [ -e "$ANDROID_SDK_ROOT" ] ; then + echo "Error: file or directory \"$ANDROID_SDK_ROOT\" already exists. Delete it manually to proceed." + exit 1 +fi + +source ./check-environment.sh || exit 1 + +SDKMANAGER="./sdkmanager" +if [[ "$OS_NAME" == "win" ]] ; then + SDKMANAGER="./sdkmanager.bat" +fi + +echo "Downloading SDK Manager..." +mkdir -p "$ANDROID_SDK_ROOT" || exit 1 +cd "$ANDROID_SDK_ROOT" || exit 1 +$WGET "https://dl.google.com/android/repository/commandlinetools-$OS_NAME-8512546_latest.zip" || exit 1 +mkdir -p cmdline-tools || exit 1 +unzip -qq "commandlinetools-$OS_NAME-8512546_latest.zip" -d cmdline-tools || exit 1 +rm "commandlinetools-$OS_NAME-8512546_latest.zip" || exit 1 +mv cmdline-tools/* cmdline-tools/latest/ || exit 1 + +echo "Installing required SDK tools..." +cd cmdline-tools/latest/bin/ || exit 1 +yes | $SDKMANAGER --licenses >/dev/null || exit 1 +$SDKMANAGER --install "ndk;$ANDROID_NDK_VERSION" "cmake;3.22.1" "build-tools;33.0.0" "platforms;android-33" > /dev/null || exit 1 |