diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index f7107bb57..66ebb0178 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -6,6 +6,10 @@ set -e -u test -f $HOME/.termuxrc && . $HOME/.termuxrc : ${ANDROID_HOME:="${HOME}/lib/android-sdk"} : ${NDK:="${HOME}/lib/android-ndk"} +ANDROID_SDK_FILE=sdk-tools-linux-4333796.zip +ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9 +ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-$(uname)-x86_64.zip +ANDROID_NDK_SHA256=ba3d813b47de75bc32a2f3de087f72599c6cb36fdc9686b96f517f5492ff43ca if [ ! -d $ANDROID_HOME ]; then mkdir -p $ANDROID_HOME @@ -16,7 +20,8 @@ if [ ! -d $ANDROID_HOME ]; then # The downloaded version below is 26.1.1.: curl --fail --retry 3 \ -o tools.zip \ - https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip + https://dl.google.com/android/repository/${ANDROID_SDK_FILE} + echo "${ANDROID_SDK_SHA256} tools.zip" | sha256sum -c - rm -Rf android-sdk unzip -q tools.zip -d android-sdk rm tools.zip @@ -27,8 +32,8 @@ if [ ! -d $NDK ]; then cd $NDK/.. rm -Rf `basename $NDK` curl --fail --retry 3 -o ndk.zip \ - http://dl.google.com/android/repository/android-ndk-r${TERMUX_NDK_VERSION}-`uname`-x86_64.zip - + http://dl.google.com/android/repository/${ANDROID_NDK_FILE} + echo "${ANDROID_NDK_SHA256} ndk.zip" | sha256sum -c - rm -Rf android-ndk-r$TERMUX_NDK_VERSION unzip -q ndk.zip mv android-ndk-r$TERMUX_NDK_VERSION `basename $NDK`