android: shasum pin barcode scanner
pins the barcode scanner aar used in the android build and its 2 dependencies to a sha256 hash using a script `fetch_barcode_scanner.sh` which is called in the process of building the apk by `make_apk.sh`. It fetches the 3 aar files if not already existing, puts them in `/contrib/android/aars` and verifies their shasum against the hardcoded hashes in `fetch_barcode_scanner.sh`.
This commit is contained in:
50
contrib/android/fetch_barcode_scanner.sh
Executable file
50
contrib/android/fetch_barcode_scanner.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script to fetch and pin https://github.com/markusfisch/BarcodeScannerView and its dependencies,
|
||||
# https://github.com/markusfisch/CameraView/ and https://github.com/markusfisch/zxing-cpp
|
||||
# which are being used as barcode scanner in the Android app.
|
||||
|
||||
# To bump the version of BarcodeScannerView, get the newest version tag from the github repo,
|
||||
# then get the required dependencies from
|
||||
# https://jitpack.io/com/github/markusfisch/BarcodeScannerView/**NEWEST_VERSION**/BarcodeScannerView-**NEWEST_VERSION**.pom
|
||||
# then fetch the aars from jitpack and update the versions and sha256s below. Also update kotlin-stdlib
|
||||
# in buildozer_qml.spec
|
||||
|
||||
BARCODE_SCANNER_VIEW_VERSION="1.6.0"
|
||||
BARCODE_SCANNER_VIEW_AAR_SHA256="2be6c9a5ab86f7198683af4a6c0e5acd3e8fe6a02df2d12c3b716dc422537789"
|
||||
|
||||
CAMERA_VIEW_VERSION="1.9.2"
|
||||
CAMERA_VIEW_AAR_SHA256="3c9be35d29b84637d2a2b0e0e7253bc5a35408fafb26c5cb7225aeb7326e2be4"
|
||||
|
||||
ZXING_CPP_VERSION="v2.2.0.1"
|
||||
ZXING_CPP_AAR_SHA256="7991381f181ff16555c4ac9c5d83e6a0d3a7da896efb8c3807897305ca33b957"
|
||||
|
||||
DOWNLOAD_REPOSITORY_ROOT="https://jitpack.io/com/github/markusfisch"
|
||||
|
||||
set -e
|
||||
|
||||
CONTRIB_ANDROID="$(dirname "$(readlink -e "$0")")"
|
||||
CONTRIB="$CONTRIB_ANDROID"/..
|
||||
CACHEDIR="$CONTRIB_ANDROID/.cache"
|
||||
|
||||
. "$CONTRIB"/build_tools_util.sh
|
||||
|
||||
# check if $CACHEDIR/aars exists, create it if not
|
||||
if [ ! -d "$CACHEDIR/aars" ]; then
|
||||
mkdir -p "$CACHEDIR/aars"
|
||||
fi
|
||||
|
||||
info "Fetching BarcodeScannerView..."
|
||||
download_if_not_exist "$CACHEDIR/aars/BarcodeScannerView.aar" \
|
||||
"${DOWNLOAD_REPOSITORY_ROOT}/BarcodeScannerView/${BARCODE_SCANNER_VIEW_VERSION}/BarcodeScannerView-${BARCODE_SCANNER_VIEW_VERSION}.aar"
|
||||
verify_hash "$CACHEDIR/aars/BarcodeScannerView.aar" "$BARCODE_SCANNER_VIEW_AAR_SHA256"
|
||||
|
||||
info "Fetching CameraView..."
|
||||
download_if_not_exist "$CACHEDIR/aars/CameraView.aar" \
|
||||
"${DOWNLOAD_REPOSITORY_ROOT}/CameraView/${CAMERA_VIEW_VERSION}/CameraView-${CAMERA_VIEW_VERSION}.aar"
|
||||
verify_hash "$CACHEDIR/aars/CameraView.aar" "$CAMERA_VIEW_AAR_SHA256"
|
||||
|
||||
info "Fetching zxing-cpp..."
|
||||
download_if_not_exist "$CACHEDIR/aars/zxing-cpp.aar" \
|
||||
"${DOWNLOAD_REPOSITORY_ROOT}/zxing-cpp/${ZXING_CPP_VERSION}/zxing-cpp-${ZXING_CPP_VERSION}.aar"
|
||||
verify_hash "$CACHEDIR/aars/zxing-cpp.aar" "$ZXING_CPP_AAR_SHA256"
|
||||
Reference in New Issue
Block a user