Since 35.0.1, the filename has changed on the server from -windows.zip to -win.zip The links are referenced from this file: <https://dl.google.com/android/repository/repository2-2.xml> Refs <https://www.reddit.com/r/Android/comments/1fhbs7w/download_links_to_platformtoolsadb/>
33 lines
835 B
Bash
Executable File
33 lines
835 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
|
cd "$DEPS_DIR"
|
|
. common
|
|
|
|
VERSION=35.0.2
|
|
FILENAME=platform-tools_r$VERSION-win.zip
|
|
PROJECT_DIR=platform-tools-$VERSION
|
|
SHA256SUM=2975a3eac0b19182748d64195375ad056986561d994fffbdc64332a516300bb9
|
|
|
|
cd "$SOURCES_DIR"
|
|
|
|
if [[ -d "$PROJECT_DIR" ]]
|
|
then
|
|
echo "$PWD/$PROJECT_DIR" found
|
|
else
|
|
get_file "https://dl.google.com/android/repository/$FILENAME" "$FILENAME" "$SHA256SUM"
|
|
mkdir -p "$PROJECT_DIR"
|
|
cd "$PROJECT_DIR"
|
|
ZIP_PREFIX=platform-tools
|
|
unzip "../$FILENAME" \
|
|
"$ZIP_PREFIX"/AdbWinApi.dll \
|
|
"$ZIP_PREFIX"/AdbWinUsbApi.dll \
|
|
"$ZIP_PREFIX"/adb.exe
|
|
mv "$ZIP_PREFIX"/* .
|
|
rmdir "$ZIP_PREFIX"
|
|
fi
|
|
|
|
mkdir -p "$INSTALL_DIR/$HOST/bin"
|
|
cd "$INSTALL_DIR/$HOST/bin"
|
|
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/$HOST/bin/"
|