2016-05-28 00:24:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
|
|
|
|
# Install desired parts of the Android SDK:
|
2018-08-15 16:52:18 +02:00
|
|
|
. $(cd "$(dirname "$0")"; pwd)/properties.sh
|
2018-08-27 22:25:51 +02:00
|
|
|
|
2018-08-27 21:21:31 +02:00
|
|
|
ANDROID_SDK_FILE=sdk-tools-linux-4333796.zip
|
|
|
|
ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
|
2018-08-27 22:25:51 +02:00
|
|
|
ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-Linux-x86_64.zip
|
2018-09-19 23:29:39 +02:00
|
|
|
ANDROID_NDK_SHA256=c413dd014edc37f822d0dc88fabc05b64232d07d5c6e9345224e47073fdf140b
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
if [ ! -d $ANDROID_HOME ]; then
|
|
|
|
mkdir -p $ANDROID_HOME
|
|
|
|
cd $ANDROID_HOME/..
|
2019-02-12 09:41:30 +01:00
|
|
|
rm -Rf $(basename $ANDROID_HOME)
|
2016-05-28 00:24:50 +02:00
|
|
|
|
2017-05-20 21:17:00 +02:00
|
|
|
# https://developer.android.com/studio/index.html#command-tools
|
2018-08-01 22:18:14 +02:00
|
|
|
# The downloaded version below is 26.1.1.:
|
2018-08-27 22:25:51 +02:00
|
|
|
echo "Downloading android sdk..."
|
2017-05-20 21:17:00 +02:00
|
|
|
curl --fail --retry 3 \
|
|
|
|
-o tools.zip \
|
2018-08-27 21:21:31 +02:00
|
|
|
https://dl.google.com/android/repository/${ANDROID_SDK_FILE}
|
|
|
|
echo "${ANDROID_SDK_SHA256} tools.zip" | sha256sum -c -
|
2017-02-02 02:23:43 +01:00
|
|
|
rm -Rf android-sdk
|
2017-02-02 01:39:29 +01:00
|
|
|
unzip -q tools.zip -d android-sdk
|
|
|
|
rm tools.zip
|
2016-05-28 00:24:50 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d $NDK ]; then
|
|
|
|
mkdir -p $NDK
|
|
|
|
cd $NDK/..
|
2019-02-12 09:41:30 +01:00
|
|
|
rm -Rf $(basename $NDK)
|
2018-08-27 22:25:51 +02:00
|
|
|
echo "Downloading android ndk..."
|
2017-02-02 01:39:29 +01:00
|
|
|
curl --fail --retry 3 -o ndk.zip \
|
2018-08-27 22:25:51 +02:00
|
|
|
https://dl.google.com/android/repository/${ANDROID_NDK_FILE}
|
2018-08-27 21:21:31 +02:00
|
|
|
echo "${ANDROID_NDK_SHA256} ndk.zip" | sha256sum -c -
|
2018-08-15 16:52:18 +02:00
|
|
|
rm -Rf android-ndk-r$TERMUX_NDK_VERSION
|
2016-05-28 00:24:50 +02:00
|
|
|
unzip -q ndk.zip
|
2019-02-12 09:41:30 +01:00
|
|
|
mv android-ndk-r$TERMUX_NDK_VERSION $(basename $NDK)
|
2016-05-28 00:24:50 +02:00
|
|
|
rm ndk.zip
|
|
|
|
fi
|
|
|
|
|
2017-11-02 00:21:36 +01:00
|
|
|
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
2018-03-25 00:02:47 +01:00
|
|
|
# The android-21 platform is used in the ecj package:
|
2019-01-27 09:02:45 +01:00
|
|
|
yes | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" "build-tools;${TERMUX_ANDROID_BUILD_TOOLS_VERSION}" "platforms;android-28" "platforms;android-21"
|