mirror of
https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root.git
synced 2025-12-06 08:07:40 +00:00
Fix cli v5
New v5 patches no longer include a .json file, so I'm using the CLI to get the correct version.
This commit is contained in:
@@ -166,7 +166,14 @@ get_apk() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
if [ -z "$version" ] && [ "$version" != "latest" ]; then
|
if [ -z "$version" ] && [ "$version" != "latest" ]; then
|
||||||
version=$(jq -r '[.. | objects | select(.name == "'$1'" and .versions != null) | .versions[]] | reverse | .[0] // ""' *.json | uniq)
|
if [[ $(ls revanced-cli-*.jar) =~ revanced-cli-([0-9]+) ]]; then
|
||||||
|
num=${BASH_REMATCH[1]}
|
||||||
|
if [ $num -ge 5 ]; then
|
||||||
|
version=$(java -jar *cli*.jar list-patches --with-packages --with-versions *.rvp | awk -v pkg="$1" 'BEGIN { found = 0 } /^Index:/ { found = 0 } /Package name: / { if ($3 == pkg) { found = 1 } } /Compatible versions:/ { if (found) { getline; latest_version = $1; while (getline && $1 ~ /^[0-9]+\./) { latest_version = $1 } print latest_version; exit } }')
|
||||||
|
else
|
||||||
|
version=$(jq -r '[.. | objects | select(.name == "'$1'" and .versions != null) | .versions[]] | reverse | .[0] // ""' *.json | uniq)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
export version="$version"
|
export version="$version"
|
||||||
local attempt=0
|
local attempt=0
|
||||||
|
|||||||
Reference in New Issue
Block a user