From 4160de3f03ff034651cd88ce9d0fda598bf715e4 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 10 Oct 2024 12:50:48 -0700 Subject: [PATCH] [Android] Download prebuilt sha256sums from URL --- README.md | 2 +- torchchat/utils/scripts/android_example.sh | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b1dba0cc6..4f58f714c 100644 --- a/README.md +++ b/README.md @@ -477,7 +477,7 @@ The following assumes you've completed the steps for [Setting up ExecuTorch](#se 1. Download the AAR file, which contains the Java library and corresponding JNI library, to build and run the app. - - [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar) (sha256sum: 2546feed560cef01cc7b47260c694311346196934f41900cac08e418f4a60096) + - [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar) ([sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar.sha256sums)) 2. Move the downloaded AAR file to `torchchat/edge/android/torchchat/app/libs/`. You may need to create directory `torchchat/edge/android/torchchat/app/libs/` if it does not exist. diff --git a/torchchat/utils/scripts/android_example.sh b/torchchat/utils/scripts/android_example.sh index ef5e04172..06875543f 100755 --- a/torchchat/utils/scripts/android_example.sh +++ b/torchchat/utils/scripts/android_example.sh @@ -31,7 +31,7 @@ else fi LLAMA_AAR_URL="https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar" -LLAMA_AAR_SHASUM="2546feed560cef01cc7b47260c694311346196934f41900cac08e418f4a60096" +LLAMA_AAR_SHASUM_URL="https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar.sha256sums" mkdir -p ${TORCHCHAT_ROOT}/build/android @@ -88,8 +88,10 @@ setup_android_sdk() { download_aar_library() { mkdir -p ${TORCHCHAT_ROOT}/android/torchchat/app/libs - curl "${LLAMA_AAR_URL}" -o ${TORCHCHAT_ROOT}/android/torchchat/app/libs/executorch.aar - echo "${LLAMA_AAR_SHASUM} ${TORCHCHAT_ROOT}/android/torchchat/app/libs/executorch.aar" | shasum --check --status + curl "${LLAMA_AAR_URL}" -O + curl "${LLAMA_AAR_SHASUM_URL}" -O + shasum --check --status executorch.aar.sha256sums + mv executorch.aar ${TORCHCHAT_ROOT}/android/torchchat/app/libs/ } build_app() {