From 68c39538e34d93d6b3dd8a19f45993b277959ebe Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 20 Dec 2020 10:42:01 +0100 Subject: [PATCH] fix downloading APKs from gitlab --- data/build-package.download | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/build-package.download b/data/build-package.download index 5c052ae..0c08dcd 100644 --- a/data/build-package.download +++ b/data/build-package.download @@ -11,7 +11,7 @@ repo_nanolx="https://nanolx.org/fdroid/repo" repo_bromite="https://fdroid.bromite.org/fdroid/repo" repo_ogapps="https://gitlab.opengapps.org/opengapps" -useragent='Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' +useragent='Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0' if [ "${BP_DEBUG}" = '1' ]; then wget_opts="-v --show-progress" @@ -284,7 +284,8 @@ grab_apk_from_github () { grab_apk_from_gitlab () { [ "${BP_DEBUG}" = '1' ] && debug_message newline "curl ${curl_opts} -s -N \"https://gitlab.com/${1}/-/tags\"" "\n" - local apk_url="$(curl -A "${useragent}" -s -N "https://gitlab.com/AuroraOSS/AuroraServices/-/tags" | tr '<' '\n' | grep -m 1 -oP '(?<=a href=").*uploads.*apk?(?=")')" + local apk_tag="$(curl -A "${useragent}" -s -N "https://gitlab.com/${1}/-/tags" | grep -m1 ref-name | sed 's/.*\">//;s/<\/.*//')" + local apk_url="$(curl -A "${useragent}" -s -N "https://gitlab.com/${1}/-/tags/${apk_tag}" | tr '<' '\n' | gawk -F \" '/uploads.*apk/{print $2}')" local apk_url="https://gitlab.com${apk_url}" local apk_dest="${appsfolder[2]}/${2}/${3}"