2016-05-28 00:24:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
|
|
|
|
# Install desired parts of the Android SDK:
|
|
|
|
test -f $HOME/.termuxrc && . $HOME/.termuxrc
|
|
|
|
: ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
|
|
|
|
: ${NDK:="${HOME}/lib/android-ndk"}
|
|
|
|
|
|
|
|
if [ ! -d $ANDROID_HOME ]; then
|
|
|
|
mkdir -p $ANDROID_HOME
|
|
|
|
cd $ANDROID_HOME/..
|
|
|
|
rm -Rf `basename $ANDROID_HOME`
|
|
|
|
|
2016-06-10 23:19:22 +02:00
|
|
|
if [ `uname` = Darwin ]; then
|
|
|
|
curl --fail --retry 3 -o android-sdk.zip https://dl.google.com/android/android-sdk_r24.4.1-macosx.zip
|
|
|
|
rm -Rf android-sdk-macosx
|
|
|
|
unzip -q android-sdk.zip
|
|
|
|
mv android-sdk-macosx `basename $ANDROID_HOME`
|
|
|
|
rm android-sdk.zip
|
|
|
|
else
|
|
|
|
curl --fail --retry 3 -o android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
|
|
|
|
rm -Rf android-sdk-linux
|
|
|
|
tar xzf android-sdk.tgz
|
|
|
|
mv android-sdk-linux `basename $ANDROID_HOME`
|
|
|
|
rm android-sdk.tgz
|
|
|
|
fi
|
2016-05-28 00:24:50 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d $NDK ]; then
|
|
|
|
mkdir -p $NDK
|
|
|
|
cd $NDK/..
|
|
|
|
rm -Rf `basename $NDK`
|
2016-10-07 19:35:36 +02:00
|
|
|
NDK_VERSION=r13
|
2016-07-26 15:06:39 +02:00
|
|
|
curl --fail --retry 3 -o ndk.zip http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-`uname`-x86_64.zip
|
2016-05-28 00:24:50 +02:00
|
|
|
|
2016-07-26 15:06:39 +02:00
|
|
|
rm -Rf android-ndk-$NDK_VERSION
|
2016-05-28 00:24:50 +02:00
|
|
|
unzip -q ndk.zip
|
2016-07-26 15:06:39 +02:00
|
|
|
mv android-ndk-$NDK_VERSION `basename $NDK`
|
2016-05-28 00:24:50 +02:00
|
|
|
rm ndk.zip
|
|
|
|
fi
|
|
|
|
|
2016-10-07 01:37:47 +02:00
|
|
|
echo y | $ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "build-tools-24.0.1,android-24"
|