diff --git a/README.md b/README.md index 26cb8ef..dd1b277 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,14 @@ The `build-package` script additionally supports the following parameters: * `ver [version] [date]` change project version * `bump` increment Magisk module version by 1 +## "Secret" parameters + +`export BP_DEBUG=1` allows seeing debug messages when repos are fetched and APKs are downloaded + +`export BP_USE_WGET=1` tells the script to use wget for downloading indices and APks + +## Custom builds + The following applications are custom builds (see [F-Droid Repository](#f-droid-repository) below): * Play Store (reason: re-signed and modified to support (in-)app-purchases with microG GmsCore) diff --git a/build-package b/build-package index 54d31c2..6b28b25 100755 --- a/build-package +++ b/build-package @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=22.3.20190805 +VERSION=22.3.$(LANG='en_US' date +"%Y%m%d") CWD=$(readlink -m "${BASH_SOURCE[0]}") CWD=$(dirname "${CWD}") diff --git a/data/build-package.common b/data/build-package.common index 1ebd30a..5413c50 100644 --- a/data/build-package.common +++ b/data/build-package.common @@ -5,7 +5,15 @@ nanodroid_broken_files=0 missing_database="" debug_message () { - [ "$DEBUG" = '1' ] && echo "$2$(tput setaf 3)$1$(tput sgr 0)" + [ "$BP_DEBUG" != '1' ] && return 0 + case "$1" in + normal) + echo "$3$(tput setaf 3)$2$(tput sgr 0)" + ;; + newline) + echo -e "$3$(tput setaf 3)$2$(tput sgr 0)" + ;; + esac } check_nanodroid () { diff --git a/data/build-package.download b/data/build-package.download index 2e987dc..c716ef1 100644 --- a/data/build-package.download +++ b/data/build-package.download @@ -21,32 +21,32 @@ done debug_download () { case $1 in index) - if [ "$USE_WGET" = '1' ]; then + if [ "$BP_USE_WGET" = '1' ]; then rm -rf "$2" - debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" " " + debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" " " wget -q --show-progress "$3" -O "$2" || error "$4" else - debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\"" " " + debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\"" " " curl -sSL -o "$2" "$3" || error "$4" fi ;; no_delete) - if [ "$USE_WGET" = '1' ]; then + if [ "$BP_USE_WGET" = '1' ]; then rm -rf "$2" - debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" + debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" wget -q --show-progress "$3" -O "$2" else - debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\"" + debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\"" curl -sSL -o "$2" "$3" fi ;; delete) - if [ "$USE_WGET" = '1' ]; then + if [ "$BP_USE_WGET" = '1' ]; then rm -rf "$2" - debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" + debug_message normal "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" wget -q --show-progress "$3" -O "$2" || rm -f "$4" else - debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\"" + debug_message normal "curl -sSL -o \"${2#$CWD/}\" \"$3\"" curl -sSL -o "$2" "$3" || rm -f "$4" fi ;; @@ -220,6 +220,7 @@ grab_apk_from_url () { } grab_apk_from_github () { + [ "$BP_DEBUG" = '1' ] && debug_message normal "curl -s -N \"https://api.github.com/repos/${1}/releases\"" local apk_url="$(curl -s -N "https://api.github.com/repos/${1}/releases" | \ gawk -F\" '/browser_download_url.*apk/{print $4 ; exit}')" local apk_dest="${appsfolder[2]}/${2}/${3}" @@ -245,6 +246,7 @@ grab_apk_from_github () { } grab_apk_from_gitlab () { + [ "$BP_DEBUG" = '1' ] && debug_message newline "curl -s -N \"https://gitlab.com/${1}/-/tags\"" "\n" 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=\"}"