Files
ooni-probe-cli/MOBILE/android/ensure
T
Simone Basso 42b547d311 fix: repair the Android build (#905)
Rather than hardcoding the NDK version inside a script, encode it
as a file in the filesystem, which is easier to share.

Make sure we use the desired NDK by setting environment variables.

Use `-androidabi 21`, which:

1. is what rclone did: https://github.com/rclone/rclone/commit/8390ba4ca9f18fea546ecdfdf8f86aed5c36030f

2. is the minimum ABI used by probe-android: https://github.com/ooni/probe-android/blob/994651be52ff75ee3a00dba499ec7c7b40ab25c1/app/build.gradle#L10

Part of https://github.com/ooni/probe/issues/2130
2022-08-29 18:51:25 +02:00

20 lines
509 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
__install_extra="build-tools;32.0.0 platforms;android-31"
__ndk_version=$(cat ./NDKVERSION)
ANDROID_HOME=$(./MOBILE/android/home)
__sdkmanager=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager
if [[ ! -x $__sdkmanager ]]; then
echo "FATAL: expected to find sdkmanager at $__sdkmanager, but found nothing" 1>&2
echo "HINT: run ./MOBILE/android/setup to (re)install the SDK" 1>&2
exit 1
fi
set -x
echo "Yes" | $__sdkmanager --install $__install_extra "ndk;$__ndk_version"