Skip to content

Instantly share code, notes, and snippets.

@hfutxqd
Created May 28, 2020 12:26
Show Gist options
  • Save hfutxqd/f8e74e7090564877af43d415f8d7d364 to your computer and use it in GitHub Desktop.
Save hfutxqd/f8e74e7090564877af43d415f8d7d364 to your computer and use it in GitHub Desktop.
#!/bin/bash
BASE_URL="https://android.googlesource.com"
BRANCH="android10-release"
SCRIPT_DIR=`dirname "$BASH_SOURCE"`
download_snapshot() {
PROJECT_NAME=${1}
FILE_NAME=${2}
FILE=${SCRIPT_DIR}/${FILE_NAME}-refs_heads_${BRANCH}.tar.gz
echo "Downloading $FILE ..."
if [ -f "$FILE" ]; then
echo "$FILE exist"
else
curl ${BASE_URL}/platform/${PROJECT_NAME}/+archive/refs/heads/${BRANCH}.tar.gz -o ${FILE}
fi
rm -rf ${SCRIPT_DIR}/../${PROJECT_NAME}
mkdir -p ${SCRIPT_DIR}/../${PROJECT_NAME}
tar xzf ${FILE} -C ${SCRIPT_DIR}/../${PROJECT_NAME}
}
download_snapshot frameworks/native native
download_snapshot system/core core
download_snapshot frameworks/base base
download_snapshot external/expat expat
download_snapshot external/libpng libpng
download_snapshot external/protobuf protobuf
download_snapshot external/zlib zlib
download_snapshot external/libcxx libcxx
download_snapshot external/libcxxabi libcxxabi
download_snapshot external/compiler-rt compiler-rt
download_snapshot system/libbase libbase
download_snapshot system/libziparchive libziparchive
download_snapshot libnativehelper libnativehelper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment