mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-26 12:48:36 -06:00
Fixed logging
This commit is contained in:
parent
a352dcf964
commit
c41dba2d06
2 changed files with 20 additions and 20 deletions
|
@ -69,7 +69,7 @@ flag=false
|
||||||
|
|
||||||
# Get inside the working directory
|
# Get inside the working directory
|
||||||
cd "$WDIR"
|
cd "$WDIR"
|
||||||
echo "$(date) | Statring check..." | tee build.log
|
echo "$(date) | Statring check..." | tee -a build.log
|
||||||
|
|
||||||
# Fetch all the dependencies
|
# Fetch all the dependencies
|
||||||
for artifact in "${!artifacts[@]}"; do
|
for artifact in "${!artifacts[@]}"; do
|
||||||
|
@ -80,7 +80,7 @@ for artifact in "${!artifacts[@]}"; do
|
||||||
version=$(curl -s "https://api.github.com/repos/$name/releases/latest" | grep -Eo '"tag_name": "v(.*)"' | sed -E 's/.*"v([^"]+)".*/\1/')
|
version=$(curl -s "https://api.github.com/repos/$name/releases/latest" | grep -Eo '"tag_name": "v(.*)"' | sed -E 's/.*"v([^"]+)".*/\1/')
|
||||||
|
|
||||||
if [[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} ]]; then
|
if [[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} ]]; then
|
||||||
echo "Downloading $artifact" | tee build.log
|
echo "Downloading $artifact" | tee -a build.log
|
||||||
# shellcheck disable=SC2086,SC2046
|
# shellcheck disable=SC2086,SC2046
|
||||||
curl -sLo "$artifact" $(get_artifact_download_url ${artifacts[$artifact]})
|
curl -sLo "$artifact" $(get_artifact_download_url ${artifacts[$artifact]})
|
||||||
jq ".\"$name\" = \"$version\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
jq ".\"$name\" = \"$version\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
||||||
|
@ -90,7 +90,7 @@ done
|
||||||
|
|
||||||
# Exit if no updates happened
|
# Exit if no updates happened
|
||||||
if [ ! $flag ]; then
|
if [ ! $flag ]; then
|
||||||
echo "Nothing to update" | tee build.log
|
echo "Nothing to update" | tee -a build.log
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ if [ ! -f "vanced-microG.apk" ]; then
|
||||||
# Vanced microG 0.2.24.220220
|
# Vanced microG 0.2.24.220220
|
||||||
VMG_VERSION="0.2.24.220220"
|
VMG_VERSION="0.2.24.220220"
|
||||||
|
|
||||||
echo "Downloading Vanced microG" | tee build.log
|
echo "Downloading Vanced microG" | tee -a build.log
|
||||||
./apkeep -a com.mgoogle.android.gms@$VMG_VERSION .
|
./apkeep -a com.mgoogle.android.gms@$VMG_VERSION .
|
||||||
mv com.mgoogle.android.gms@$VMG_VERSION.apk vanced-microG.apk
|
mv com.mgoogle.android.gms@$VMG_VERSION.apk vanced-microG.apk
|
||||||
jq ".\"vanced-microG\" = \"$VMG_VERSION\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
jq ".\"vanced-microG\" = \"$VMG_VERSION\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
||||||
|
@ -124,13 +124,13 @@ if [ -f "com.google.android.youtube.apk" ]; then
|
||||||
# -e microg-support ${patches[@]} \
|
# -e microg-support ${patches[@]} \
|
||||||
# $EXPERIMENTAL \
|
# $EXPERIMENTAL \
|
||||||
# -a com.google.android.youtube.apk -o build/revanced-root.apk
|
# -a com.google.android.youtube.apk -o build/revanced-root.apk
|
||||||
echo "Building Non-root APK" | tee build.log
|
echo "Building Non-root APK" | tee -a build.log
|
||||||
java -jar revanced-cli.jar -m revanced-integrations.apk -b revanced-patches.jar \
|
java -jar revanced-cli.jar -m revanced-integrations.apk -b revanced-patches.jar \
|
||||||
${patches[@]} \
|
${patches[@]} \
|
||||||
$EXPERIMENTAL \
|
$EXPERIMENTAL \
|
||||||
-a com.google.android.youtube.apk -o ReVanced-nonroot-$timestamp.apk
|
-a com.google.android.youtube.apk -o ReVanced-nonroot-$timestamp.apk
|
||||||
else
|
else
|
||||||
echo "Cannot find YouTube APK, skipping build" | tee build.log
|
echo "Cannot find YouTube APK, skipping build" | tee -a build.log
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "************************************"
|
echo "************************************"
|
||||||
|
@ -142,17 +142,17 @@ if [ -f "com.google.android.apps.youtube.music.apk" ]; then
|
||||||
# -e microg-support ${patches[@]} \
|
# -e microg-support ${patches[@]} \
|
||||||
# $EXPERIMENTAL \
|
# $EXPERIMENTAL \
|
||||||
# -a com.google.android.apps.youtube.music.apk -o build/revanced-music-root.apk
|
# -a com.google.android.apps.youtube.music.apk -o build/revanced-music-root.apk
|
||||||
echo "Building Non-root APK" | tee build.log
|
echo "Building Non-root APK" | tee -a build.log
|
||||||
java -jar revanced-cli.jar -b revanced-patches.jar \
|
java -jar revanced-cli.jar -b revanced-patches.jar \
|
||||||
${patches[@]} \
|
${patches[@]} \
|
||||||
$EXPERIMENTAL \
|
$EXPERIMENTAL \
|
||||||
-a com.google.android.apps.youtube.music.apk -o ReVanced-Music-nonroot-$timestamp.apk
|
-a com.google.android.apps.youtube.music.apk -o ReVanced-Music-nonroot-$timestamp.apk
|
||||||
else
|
else
|
||||||
echo "Cannot find YouTube Music APK, skipping build" | tee build.log
|
echo "Cannot find YouTube Music APK, skipping build" | tee -a build.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Send telegram message about the new build
|
# Send telegram message about the new build
|
||||||
echo "Sending messages to telegram" | tee build.log
|
echo "Sending messages to telegram" | tee -a build.log
|
||||||
telegram-upload ReVanced-nonroot-$timestamp.apk ReVanced-Music-nonroot-$timestamp.apk --to "placeholder_for_channel_address" --caption ""
|
telegram-upload ReVanced-nonroot-$timestamp.apk ReVanced-Music-nonroot-$timestamp.apk --to "placeholder_for_channel_address" --caption ""
|
||||||
echo "Build details:" > message.tmp
|
echo "Build details:" > message.tmp
|
||||||
cat versions.json | tail -n+2 | head -n-1 | cut -c3- | sed "s/\"//g" | sed "s/,//g" | sed "s/com.google.android.apps.youtube.music/YouTube Music/" | sed "s/com.google.android.youtube/YouTube/" | sed "s/vanced-microG/Vanced microG/">> message.tmp
|
cat versions.json | tail -n+2 | head -n-1 | cut -c3- | sed "s/\"//g" | sed "s/,//g" | sed "s/com.google.android.apps.youtube.music/YouTube Music/" | sed "s/com.google.android.youtube/YouTube/" | sed "s/vanced-microG/Vanced microG/">> message.tmp
|
||||||
|
|
|
@ -29,7 +29,7 @@ get_largest_ver() {
|
||||||
dl_apk() {
|
dl_apk() {
|
||||||
local url=$1 regexp=$2 output=$3
|
local url=$1 regexp=$2 output=$3
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
|
||||||
echo "$url" | tee build.log
|
echo "$url" | tee -a build.log
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
||||||
req "$url" "$output"
|
req "$url" "$output"
|
||||||
|
@ -37,18 +37,18 @@ dl_apk() {
|
||||||
|
|
||||||
# Downloading youtube
|
# Downloading youtube
|
||||||
dl_yt() {
|
dl_yt() {
|
||||||
echo "Downloading YouTube" | tee build.log
|
echo "Downloading YouTube" | tee -a build.log
|
||||||
local last_ver
|
local last_ver
|
||||||
last_ver="$version"
|
last_ver="$version"
|
||||||
last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube" | get_largest_ver)}"
|
last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube" | get_largest_ver)}"
|
||||||
|
|
||||||
echo "Choosing version '${last_ver}'" | tee build.log
|
echo "Choosing version '${last_ver}'" | tee -a build.log
|
||||||
local base_apk="com.google.android.youtube.apk"
|
local base_apk="com.google.android.youtube.apk"
|
||||||
declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/google-inc/youtube/youtube-${last_ver//./-}-release/" \
|
declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/google-inc/youtube/youtube-${last_ver//./-}-release/" \
|
||||||
"APK</span>[^@]*@\([^#]*\)" \
|
"APK</span>[^@]*@\([^#]*\)" \
|
||||||
"$base_apk")
|
"$base_apk")
|
||||||
echo "YouTube version: ${last_ver}" | tee build.log
|
echo "YouTube version: ${last_ver}" | tee -a build.log
|
||||||
echo "downloaded from: [APKMirror - YouTube]($dl_url)" | tee build.log
|
echo "downloaded from: [APKMirror - YouTube]($dl_url)" | tee -a build.log
|
||||||
jq ".\"$apk\" = \"$last_ver\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
jq ".\"$apk\" = \"$last_ver\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,12 +59,12 @@ ARM_V7A="arm-v7a"
|
||||||
# Downloading youtube music
|
# Downloading youtube music
|
||||||
dl_ytm() {
|
dl_ytm() {
|
||||||
local arch=$ARM64_V8A
|
local arch=$ARM64_V8A
|
||||||
echo "Downloading YouTube Music (${arch})" | tee build.log
|
echo "Downloading YouTube Music (${arch})" | tee -a build.log
|
||||||
local last_ver
|
local last_ver
|
||||||
last_ver="$version"
|
last_ver="$version"
|
||||||
last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube-music" | get_largest_ver)}"
|
last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube-music" | get_largest_ver)}"
|
||||||
|
|
||||||
echo "Choosing version '${last_ver}'" | tee build.log
|
echo "Choosing version '${last_ver}'" | tee -a build.log
|
||||||
local base_apk="com.google.android.apps.youtube.music.apk"
|
local base_apk="com.google.android.apps.youtube.music.apk"
|
||||||
if [ "$arch" = "$ARM64_V8A" ]; then
|
if [ "$arch" = "$ARM64_V8A" ]; then
|
||||||
local regexp_arch='arm64-v8a</div>[^@]*@\([^"]*\)'
|
local regexp_arch='arm64-v8a</div>[^@]*@\([^"]*\)'
|
||||||
|
@ -74,8 +74,8 @@ dl_ytm() {
|
||||||
declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/google-inc/youtube-music/youtube-music-${last_ver//./-}-release/" \
|
declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/google-inc/youtube-music/youtube-music-${last_ver//./-}-release/" \
|
||||||
"$regexp_arch" \
|
"$regexp_arch" \
|
||||||
"$base_apk")
|
"$base_apk")
|
||||||
echo "\nYouTube Music (${arch}) version: ${last_ver}" | tee build.log
|
echo "\nYouTube Music (${arch}) version: ${last_ver}" | tee -a build.log
|
||||||
echo "downloaded from: [APKMirror - YouTube Music ${arch}]($dl_url)" | tee build.log
|
echo "downloaded from: [APKMirror - YouTube Music ${arch}]($dl_url)" | tee -a build.log
|
||||||
jq ".\"$apk\" = \"$last_ver\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
jq ".\"$apk\" = \"$last_ver\"" versions.json > versions.json.tmp && mv versions.json.tmp versions.json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ cd "/home/sintan/Downloads/Random/ReVanced/build/"
|
||||||
|
|
||||||
for apk in "${!apks[@]}"; do
|
for apk in "${!apks[@]}"; do
|
||||||
if [ ! -f $apk ]; then
|
if [ ! -f $apk ]; then
|
||||||
echo "Downloading $apk" | tee build.log
|
echo "Downloading $apk" | tee -a build.log
|
||||||
req "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json" patches.json
|
req "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json" patches.json
|
||||||
supported_vers="$(jq -r '.[].compatiblePackages[] | select(.name == "'$apk'") | .versions | last' patches.json)"
|
supported_vers="$(jq -r '.[].compatiblePackages[] | select(.name == "'$apk'") | .versions | last' patches.json)"
|
||||||
version=0
|
version=0
|
||||||
|
@ -99,6 +99,6 @@ for apk in "${!apks[@]}"; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
version_present=$(jq -r ".\"$apk\"" versions.json)
|
version_present=$(jq -r ".\"$apk\"" versions.json)
|
||||||
[[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} ]] && ${apks[$apk]} || echo "Recommended version of "$apk" already present" | tee build.log
|
[[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} ]] && ${apks[$apk]} || echo "Recommended version of "$apk" already present" | tee -a build.log
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue