From 79147ff05d151cc2e0ffcd00934cc84c0e5274d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh=20D=C6=B0=C6=A1ng?= <46205571+luxysiv@users.noreply.github.com> Date: Sun, 22 Dec 2024 08:41:24 +0700 Subject: [PATCH] Change the way get supported versions --- etc/utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/utils.sh b/etc/utils.sh index fa51aba..204577d 100644 --- a/etc/utils.sh +++ b/etc/utils.sh @@ -29,8 +29,10 @@ get_latest_version() { # Read highest supported versions from Revanced get_supported_version() { - pkg_name="$1" - jq -r '.. | objects | select(.name == "'$pkg_name'" and .versions != null) | .versions[]' patches.json | max + package_name=$1 + output=$(java -jar revanced-cli*.jar list-versions -f "$package_name" patch*.rvp) + version=$(echo "$output" | tail -n +3 | sed 's/ (.*)//' | grep -v -w "Any" | max | xargs) + echo "$version" } # Download necessary resources to patch from Github latest release