Add simple bash script to update bromite packages

Change-Id: Ib6f26091010b5b11f866131ac5276da7681ceae3
diff --git a/update_prebuilts.sh b/update_prebuilts.sh
new file mode 100644
index 0000000..b02a6b0
--- /dev/null
+++ b/update_prebuilts.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+RELEASES=$(curl -s https://api.github.com/repos/bromite/bromite/releases/latest)
+
+LATEST_VERSION=$(jq -r '.tag_name' <<<"${RELEASES}")
+
+git log --pretty=format:'%s' | grep -q "${LATEST_VERSION}" && echo "Packages are up to date" && exit 0
+
+APKS=(
+	arm64_SystemWebView.apk arm64_ChromePublic.apk
+	x64_SystemWebView.apk x64_ChromePublic.apk
+)
+
+rm prebuilt/*
+
+for apk in "${APKS[@]}"; do
+	DOWNLOAD_URL="$(jq -r '.assets | .[] | select(.name=='\"${apk}\"') | .browser_download_url' <<<"${RELEASES}")"
+	wget "${DOWNLOAD_URL}" -O "prebuilt/${apk}"
+	7z a -txz -v100m "prebuilt/${apk/x64/x86_64}.xz" "prebuilt/${apk}" && rm "prebuilt/${apk}"
+done