2018-01-23 20:11:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Functions borrowed or derived from
|
|
|
|
# Michael Bryant / Shadow53
|
|
|
|
# https://gitlab.com/Shadow53/android-zip-builder
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
repo_fdroid="https://f-droid.org/repo"
|
|
|
|
repo_guardian="https://guardianproject.info/fdroid/repo"
|
|
|
|
repo_microg="https://microg.org/fdroid/repo"
|
|
|
|
repo_nanolx="https://nanolx.org/fdroid/repo"
|
|
|
|
repo_bromite="https://fdroid.bromite.org/fdroid/repo"
|
2020-01-31 17:04:53 +00:00
|
|
|
repo_ogapps="https://gitlab.opengapps.org/opengapps"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
|
|
|
# check dependencies
|
2019-08-05 17:56:48 +00:00
|
|
|
for dep in gawk curl sha256sum jq gzip; do
|
2018-01-23 20:11:52 +00:00
|
|
|
if ! which ${dep} &>/dev/null; then
|
|
|
|
echo "${dep} is not installed!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download () {
|
|
|
|
case $1 in
|
|
|
|
index)
|
2019-08-11 08:27:25 +00:00
|
|
|
if [ "$BP_USE_WGET" = '1' ]; then
|
2019-08-10 10:29:57 +00:00
|
|
|
rm -rf "$2"
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" " "
|
2019-08-10 10:29:57 +00:00
|
|
|
wget -q --show-progress "$3" -O "$2" || error "$4"
|
|
|
|
else
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\"" " "
|
2019-08-10 10:29:57 +00:00
|
|
|
curl -sSL -o "$2" "$3" || error "$4"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
no_delete)
|
2019-08-11 08:27:25 +00:00
|
|
|
if [ "$BP_USE_WGET" = '1' ]; then
|
2019-08-10 10:29:57 +00:00
|
|
|
rm -rf "$2"
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\""
|
2019-08-10 10:29:57 +00:00
|
|
|
wget -q --show-progress "$3" -O "$2"
|
|
|
|
else
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\""
|
2019-08-10 10:29:57 +00:00
|
|
|
curl -sSL -o "$2" "$3"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
delete)
|
2019-08-11 08:27:25 +00:00
|
|
|
if [ "$BP_USE_WGET" = '1' ]; then
|
2019-08-10 10:29:57 +00:00
|
|
|
rm -rf "$2"
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\""
|
2019-08-10 10:29:57 +00:00
|
|
|
wget -q --show-progress "$3" -O "$2" || rm -f "$4"
|
|
|
|
else
|
2019-08-11 08:02:30 +00:00
|
|
|
debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\""
|
2019-08-10 10:29:57 +00:00
|
|
|
curl -sSL -o "$2" "$3" || rm -f "$4"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2019-06-19 22:01:22 +00:00
|
|
|
index_update_required () {
|
2019-08-09 22:55:05 +00:00
|
|
|
index_file=${1}
|
2019-06-19 22:01:22 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
test ! -f ${index_file} && return 0
|
|
|
|
test $(stat --format=%Z ${index_file}) -le $(($(date +%s) - 3600)) && return 0
|
|
|
|
test "$(file -b ${index_file})" == "empty" && return 0
|
2019-06-19 22:01:22 +00:00
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2019-07-07 19:41:13 +00:00
|
|
|
check_sha256sum () {
|
2019-08-09 22:55:05 +00:00
|
|
|
local input="${1}"
|
2019-07-07 19:41:13 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
in_checksum=""
|
|
|
|
local ex_checksum="${2}"
|
2019-07-07 19:41:13 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
case ${input} in
|
2019-07-08 18:52:43 +00:00
|
|
|
*.gz )
|
2019-08-09 22:55:05 +00:00
|
|
|
in_checksum=$(gzip -dc ${input} 2>/dev/null | sha256sum | gawk '{print $1}')
|
2019-07-07 19:41:13 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
* )
|
2019-08-09 22:55:05 +00:00
|
|
|
in_checksum=$(sha256sum ${input} 2>/dev/null | gawk '{print $1}')
|
2019-07-07 19:41:13 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
[[ ${in_checksum} == ${ex_checksum} ]] && return 0 || return 1
|
2019-07-07 19:41:13 +00:00
|
|
|
}
|
|
|
|
|
2019-06-19 22:38:28 +00:00
|
|
|
update_index () {
|
2019-08-09 22:55:05 +00:00
|
|
|
local index_jar=${1}
|
|
|
|
local index_json="$repofolder/$(basename ${index_jar} .jar).json"
|
|
|
|
local index_repo=${2}
|
2019-06-19 22:38:28 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if index_update_required ${index_json}; then
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download index "${index_jar}" "${index_repo}/index-v1.jar" " failed to update repo index"
|
2019-06-19 22:38:28 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
unzip -q ${index_jar} index-v1.json -d "$repofolder/"
|
|
|
|
mv "$repofolder/index-v1.json" "${index_json}"
|
|
|
|
rm -f ${index_jar}
|
2019-06-26 18:27:07 +00:00
|
|
|
fi
|
2019-06-19 22:38:28 +00:00
|
|
|
}
|
|
|
|
|
2018-09-15 17:21:52 +00:00
|
|
|
update_indices () {
|
|
|
|
echo "+++ upating Repo Indices"
|
|
|
|
echo " ++ F-Droid"
|
2019-08-09 22:55:05 +00:00
|
|
|
[ ! -d "$repofolder" ] && rm -rf "$repofolder" && mkdir -p "$repofolder"
|
|
|
|
update_index "$repofolder/$(awk -F/ '{print $3}' <<< ${repo_fdroid}).index-v1.jar" "${repo_fdroid}"
|
2018-09-15 17:21:52 +00:00
|
|
|
|
|
|
|
echo " ++ Guardian Project"
|
2019-08-09 22:55:05 +00:00
|
|
|
update_index "$repofolder/$(awk -F/ '{print $3}' <<< ${repo_guardian}).index-v1.jar" "${repo_guardian}"
|
2018-09-15 17:21:52 +00:00
|
|
|
|
|
|
|
echo " ++ microG"
|
2019-08-09 22:55:05 +00:00
|
|
|
update_index "$repofolder/$(awk -F/ '{print $3}' <<< ${repo_microg}).index-v1.jar" "${repo_microg}"
|
2018-09-29 19:55:08 +00:00
|
|
|
|
|
|
|
echo " ++ Nanolx"
|
2019-08-09 22:55:05 +00:00
|
|
|
update_index "$repofolder/$(awk -F/ '{print $3}' <<< ${repo_nanolx}).index-v1.jar" "${repo_nanolx}"
|
2018-11-07 19:34:06 +00:00
|
|
|
|
|
|
|
echo " ++ Bromite"
|
2019-08-09 22:55:05 +00:00
|
|
|
update_index "$repofolder/$(awk -F/ '{print $3}' <<< ${repo_bromite}).index-v1.jar" "${repo_bromite}"
|
2018-09-15 17:21:52 +00:00
|
|
|
}
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
grab_apk_from_repo () {
|
|
|
|
case "${1}" in
|
|
|
|
fdroid )
|
2019-08-09 22:55:05 +00:00
|
|
|
local repo=${repo_fdroid}
|
|
|
|
local repo_p="F-Droid"
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
guardian )
|
2019-08-09 22:55:05 +00:00
|
|
|
local repo=${repo_guardian}
|
|
|
|
local repo_p="Guardian Project"
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
microg )
|
2019-08-09 22:55:05 +00:00
|
|
|
local repo=${repo_microg}
|
|
|
|
local repo_p="microG"
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
2018-09-29 19:55:08 +00:00
|
|
|
|
|
|
|
nanolx )
|
2019-08-09 22:55:05 +00:00
|
|
|
local repo=${repo_nanolx}
|
|
|
|
local repo_p="Nanolx"
|
2018-09-29 19:55:08 +00:00
|
|
|
;;
|
2018-11-07 19:34:06 +00:00
|
|
|
|
|
|
|
bromite )
|
2019-08-09 22:55:05 +00:00
|
|
|
local repo=${repo_bromite}
|
|
|
|
local repo_p="Bromite"
|
2018-11-07 19:34:06 +00:00
|
|
|
;;
|
2018-01-23 20:11:52 +00:00
|
|
|
esac
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
local domain="$(awk -F/ '{print $3}' <<< ${repo})"
|
|
|
|
index_file="$repofolder/${domain}.index-v1.json"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
local pkg_name="${2}"
|
2018-11-07 19:34:06 +00:00
|
|
|
|
|
|
|
if [ -z "${5}" ]; then
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_name="$(jq -r --arg pkg "${pkg_name}" '.packages[$pkg][0].apkName' ${index_file})"
|
|
|
|
local sha_sum="$(jq -r --arg pkg "${pkg_name}" '.packages[$pkg][0].hash' ${index_file})"
|
2018-11-07 19:34:06 +00:00
|
|
|
else
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_name="$(jq -r --arg pkg "${pkg_name}" --arg arch "${5}" '[.packages[$pkg][] | select (.nativecode[]==$arch).apkName][0]' ${index_file})"
|
|
|
|
local sha_sum="$(jq -r --arg pkg "${pkg_name}" --arg arch "${5}" '[.packages[$pkg][] | select (.nativecode[]==$arch).hash][0]' ${index_file})"
|
2018-11-07 19:34:06 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
case "${pkg_name}" in
|
2018-11-23 20:18:01 +00:00
|
|
|
com.android.webview )
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_dest="${appsfolder[12]}/${3}/${4}"
|
2018-11-23 20:18:01 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
net.osmand.plus | net.osmand.srtmPlugin.paid )
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_dest="${appsfolder[10]}/${3}/${4}"
|
2018-11-23 20:18:01 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
* )
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_dest="${appsfolder[2]}/${3}/${4}"
|
2018-11-23 20:18:01 +00:00
|
|
|
;;
|
|
|
|
esac
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_url="${repo}/${apk_name}"
|
2019-06-19 22:01:22 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if check_sha256sum "${apk_dest}/${4}.apk.gz" "${sha_sum}"; then
|
|
|
|
echo -e "\nUp-to-Date from ${repo_p} : ${4}.apk"
|
|
|
|
else echo -e "\nUpdating from ${repo_p} : ${4}.apk"
|
|
|
|
mkdir -p "${apk_dest}"
|
|
|
|
rm -f "${apk_dest}/${4}.apk.gz"
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download no_delete "${apk_dest}/${4}.apk" "${apk_url}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if check_sha256sum "${apk_dest}/${4}.apk" "${sha_sum}"; then
|
2019-07-07 19:49:40 +00:00
|
|
|
echo " SHA256 hash of ${4}.apk is correct"
|
2019-08-09 22:55:05 +00:00
|
|
|
gzip "${apk_dest}/${4}.apk"
|
2019-07-07 19:49:40 +00:00
|
|
|
else echo -e " SHA256 hash of ${4}.apk is wrong!\
|
2019-08-09 22:55:05 +00:00
|
|
|
\n expected : ${sha_sum}\
|
|
|
|
\n got : ${in_checksum}"
|
|
|
|
rm -f "${apk_dest}/${4}.apk"
|
2019-07-07 19:41:13 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
grab_apk_from_url () {
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_url="${1}"
|
|
|
|
local apk_dest="${appsfolder[2]}/${2}/${3}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
rm -f "${apk_dest}/${3}.apk.gz"
|
2019-07-26 19:27:20 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
2019-08-02 17:27:18 +00:00
|
|
|
echo -e "\nUpdating from URL : ${3}.apk"
|
2019-07-26 19:27:20 +00:00
|
|
|
else echo -e "\nDownloading from URL : ${3}.apk"
|
2019-08-09 22:55:05 +00:00
|
|
|
mkdir -p "${apk_dest}"
|
2018-01-23 20:11:52 +00:00
|
|
|
fi
|
|
|
|
|
2019-07-26 19:27:20 +00:00
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
2019-07-07 19:41:13 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
2019-08-05 17:56:48 +00:00
|
|
|
else echo "error downloading ${3}"
|
2019-08-05 17:29:06 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grab_apk_from_github () {
|
2019-08-11 08:27:25 +00:00
|
|
|
[ "$BP_DEBUG" = '1' ] && debug_message normal "curl -s -N \"https://api.github.com/repos/${1}/releases\""
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_url="$(curl -s -N "https://api.github.com/repos/${1}/releases" | \
|
2019-08-03 18:26:55 +00:00
|
|
|
gawk -F\" '/browser_download_url.*apk/{print $4 ; exit}')"
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_dest="${appsfolder[2]}/${2}/${3}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
rm -f "${apk_dest}/${3}.apk.gz"
|
2019-07-26 19:27:20 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
2018-01-23 20:11:52 +00:00
|
|
|
echo -e "\nUpdating from GitHub : ${3}.apk"
|
|
|
|
else echo -e "\nDownloading from GitHub : ${3}.apk"
|
2019-08-09 22:55:05 +00:00
|
|
|
mkdir -p "${apk_dest}"
|
2018-01-23 20:11:52 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-05 17:56:48 +00:00
|
|
|
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
2019-08-02 17:00:58 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
2019-08-05 17:56:48 +00:00
|
|
|
else echo "error downloading ${3}"
|
2019-08-05 17:29:06 +00:00
|
|
|
fi
|
2019-08-02 17:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grab_apk_from_gitlab () {
|
2019-08-11 08:27:25 +00:00
|
|
|
[ "$BP_DEBUG" = '1' ] && debug_message newline "curl -s -N \"https://gitlab.com/${1}/-/tags\"" "\n"
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_url=$(curl -s -N "https://gitlab.com/${1}/-/tags" | grep '.apk' | head -n 1)
|
|
|
|
local apk_url=${apk_url%\">*.apk*}
|
|
|
|
local apk_url="https://gitlab.com${apk_url##*a href=\"}"
|
2020-01-17 21:46:23 +00:00
|
|
|
local apk_url="${apk_url/\"*}"
|
2019-08-09 22:55:05 +00:00
|
|
|
local apk_dest="${appsfolder[2]}/${2}/${3}"
|
2019-08-02 17:00:58 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
rm -f "${apk_dest}/${3}.apk.gz"
|
2019-08-02 17:00:58 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
2019-08-02 17:00:58 +00:00
|
|
|
echo -e "\nUpdating from GitLab : ${3}.apk"
|
|
|
|
else echo -e "\nDownloading from GitLab : ${3}.apk"
|
2019-08-09 22:55:05 +00:00
|
|
|
mkdir -p "${apk_dest}"
|
2019-08-02 17:00:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
2019-07-26 19:27:20 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
2019-08-05 17:56:48 +00:00
|
|
|
else echo "error downloading ${3}"
|
2019-08-05 17:29:06 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grab_apk_from_ogapps () {
|
2020-01-27 17:09:45 +00:00
|
|
|
case "${4}" in
|
|
|
|
19 ) local api_letter=K ;;
|
|
|
|
21 ) local api_letter=L ;;
|
|
|
|
23 ) local api_letter=M ;;
|
|
|
|
24 ) local api_letter=N ;;
|
|
|
|
26 ) local api_letter=O ;;
|
|
|
|
28 ) local api_letter=P ;;
|
|
|
|
29 ) local api_letter=Q ;;
|
|
|
|
esac
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
case "${1}" in
|
|
|
|
"com.google.android.syncadapters.calendar" )
|
2020-01-27 17:09:45 +00:00
|
|
|
# use SDK 19 Calendar Syncadapter for SDK 19
|
|
|
|
# use SDK 21 Calendar Syncadapter for SDK 21 - 29
|
2020-01-02 13:24:10 +00:00
|
|
|
if [ "${4}" -eq 19 ]; then
|
2020-01-31 17:04:53 +00:00
|
|
|
local apk_url="${repo_ogapps}/all/raw/master/${2}/${1}/15/nodpi/2015080710.apk"
|
2020-01-02 13:24:10 +00:00
|
|
|
else
|
2020-02-03 17:41:53 +00:00
|
|
|
local apk_url="${repo_ogapps}/all/raw/master/${2}/${1}/21/nodpi/2016184095.apk"
|
2020-01-02 13:24:10 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
2020-01-27 17:09:45 +00:00
|
|
|
"com.google.android.syncadapters.contacts" )
|
2020-01-31 17:04:53 +00:00
|
|
|
local apk_url="${repo_ogapps}/all/raw/master/${2}/${1}/${4}/nodpi/${4}.apk"
|
2020-01-27 17:09:45 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
"com.google.android.backuptransport" )
|
|
|
|
# Use SDK 28 Backuptransport on SDK 29 aswell
|
|
|
|
if [ "${4}" -eq 29 ]; then
|
2020-01-31 17:04:53 +00:00
|
|
|
local apk_url="${repo_ogapps}/all/raw/master/${2}/${1}/28/nodpi/28.apk"
|
2020-01-27 17:09:45 +00:00
|
|
|
else
|
2020-01-31 17:04:53 +00:00
|
|
|
local apk_url="${repo_ogapps}/all/raw/master/${2}/${1}/${4}/nodpi/${4}.apk"
|
2020-01-27 17:09:45 +00:00
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
apk_dest="${appsfolder[6]}/${api_letter}/${2}/${3}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${apk_dest}/${3}.apk.gz" ]]; then
|
|
|
|
echo -e "\nUpdating from OpenGApps : ${3}.apk [${api_letter}]"
|
|
|
|
rm -f "${apk_dest}/${3}.apk.gz"
|
|
|
|
else echo -e "\nDownloading from OpenGApps: ${3}.apk [${api_letter}]"
|
|
|
|
mkdir -p "${apk_dest}"
|
2018-01-23 20:11:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
2019-07-08 15:12:31 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
[ -f "${apk_dest}/${3}.apk" ] && gzip "${apk_dest}/${3}.apk"
|
2018-01-23 20:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grab_lib_from_ogapps () {
|
|
|
|
case "${3}" in
|
|
|
|
arm | x86 ) LIBD=lib ;;
|
|
|
|
arm64 | x86_64 ) LIBD=lib64 ;;
|
|
|
|
esac
|
|
|
|
|
2020-01-31 17:04:53 +00:00
|
|
|
local lib_url="${repo_ogapps}/${3}/raw/master/${LIBD}/${2}/${1}?inline=false"
|
2019-08-09 22:55:05 +00:00
|
|
|
local swp_dest="${appsfolder[8]}/${3}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2018-10-31 19:34:59 +00:00
|
|
|
if [[ "${4}" == "true" ]]; then
|
2019-08-09 22:55:05 +00:00
|
|
|
local lib_dest="${swp_dest}/${1}_${2}"
|
|
|
|
else lib_dest="${swp_dest}/${1}"
|
2018-10-31 19:34:59 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
if [[ -f "${lib_dest}" ]]; then
|
2018-10-31 19:34:59 +00:00
|
|
|
echo -e "\nUpdating from OpenGApps : ${1} [${2}:${3}]"
|
|
|
|
else echo -e "\nDownloading from OpenGApps: ${1} [${2}:${3}]"
|
2019-08-09 22:55:05 +00:00
|
|
|
mkdir -p "${swp_dest}"
|
2018-01-23 20:11:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${lib_dest}" "${lib_url}" "${lib_dest}"
|
2018-01-23 20:11:52 +00:00
|
|
|
}
|
2019-03-01 13:23:44 +00:00
|
|
|
|
|
|
|
grab_patches () {
|
2019-08-09 22:55:05 +00:00
|
|
|
base_url="https://github.com/Lanchon/haystack/blob/master/patches"
|
2019-03-01 13:23:44 +00:00
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
patch_url="${base_url}/${1}?raw=true"
|
|
|
|
patch_dst="${CWD}/patcher/dexpatcher/${2}"
|
2019-03-01 13:23:44 +00:00
|
|
|
|
|
|
|
echo -e "\nUpdating from Haystack : ${2}"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
2019-08-10 10:29:57 +00:00
|
|
|
debug_download delete "${patch_dst}" "${patch_url}""${patch_dst}"
|
2019-03-01 13:23:44 +00:00
|
|
|
}
|