mirror of
https://gitlab.com/Nanolx/NanoDroid
synced 2024-11-17 21:26:22 +00:00
Added a bunch of debug messages, added wget support and debug in README and used date for creating per-build dates
This commit is contained in:
parent
60ab874f10
commit
ea9c427625
@ -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 DEBUG=1` allows seeing debug messages when repos are fetched and APKs are downloaded
|
||||
|
||||
`export 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)
|
||||
|
@ -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}")
|
||||
|
||||
|
@ -5,7 +5,15 @@ nanodroid_broken_files=0
|
||||
missing_database=""
|
||||
|
||||
debug_message () {
|
||||
[ "$DEBUG" = '1' ] && echo "$2$(tput setaf 3)$1$(tput sgr 0)"
|
||||
[ "$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 () {
|
||||
|
@ -23,30 +23,30 @@ debug_download () {
|
||||
index)
|
||||
if [ "$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
|
||||
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
|
||||
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 () {
|
||||
[ "$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 () {
|
||||
[ "$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=\"}"
|
||||
|
Loading…
Reference in New Issue
Block a user