mirror of
https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root.git
synced 2025-12-06 08:07:40 +00:00
Change method check new patch
- No longer need .txt file - Easier manual patch - Special thanks to Aisrsa for nice idea
This commit is contained in:
@@ -4,11 +4,6 @@ source ./src/build/utils.sh
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch
|
||||
checker "revanced/revanced-patches" "revanced"
|
||||
|
||||
#################################################
|
||||
|
||||
# Download requirements
|
||||
dl_gh "revanced-patches revanced-cli revanced-integrations" "revanced" "latest"
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@ source ./src/build/utils.sh
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch
|
||||
checker "revanced/revanced-patches" "revanced"
|
||||
|
||||
#################################################
|
||||
|
||||
# Download requirements
|
||||
dl_gh "revanced-patches revanced-cli revanced-integrations" "revanced" "latest"
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@ source ./src/build/utils.sh
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch
|
||||
checker "revanced/revanced-patches" "revanced"
|
||||
|
||||
#################################################
|
||||
|
||||
# Download requirements
|
||||
dl_gh "revanced-patches revanced-cli revanced-integrations" "revanced" "latest"
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@ source src/build/utils.sh
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch
|
||||
checker "kitadai31/revanced-patches-android6-7" "revanced-extended-android-6-7"
|
||||
|
||||
#################################################
|
||||
|
||||
# Download requirements
|
||||
dl_gh "revanced-patches-android6-7 revanced-integrations" "kitadai31" "latest"
|
||||
dl_gh "revanced-cli" "revanced" "tags/v3.1.1"
|
||||
|
||||
@@ -4,11 +4,6 @@ source src/build/utils.sh
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch
|
||||
checker "inotia00/revanced-patches" "revanced-extended"
|
||||
|
||||
#################################################
|
||||
|
||||
# Download requirements
|
||||
dl_gh "revanced-patches revanced-integrations revanced-cli" "inotia00" "latest"
|
||||
|
||||
|
||||
28
src/build/ci.sh
Normal file
28
src/build/ci.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check new patch:
|
||||
get_date() {
|
||||
local assets asset name updated_at
|
||||
assets=$(curl -s https://api.github.com/repos/"$1"/releases/latest | jq '.assets')
|
||||
for asset in $(echo "$assets" | jq -r '.[] | @base64'); do
|
||||
asset=$(echo "$asset" | base64 --decode)
|
||||
name=$(echo "$asset" | jq -r '.name')
|
||||
updated_at=$(echo "$asset" | jq -r '.updated_at')
|
||||
[[ $name =~ "$2" ]] && echo "$updated_at"
|
||||
done
|
||||
}
|
||||
checker(){
|
||||
local date1 date2 date1_sec date1_sec repo=$1 ur_repo=$repository check=$2
|
||||
date1=$(get_date "$repo" "patches.json")
|
||||
date2=$(get_date "$ur_repo" "$check")
|
||||
date1_sec=$(date -d "$date1" +%s)
|
||||
date2_sec=$(date -d "$date2" +%s)
|
||||
if [ -z "$date2" ] || [ "$date1_sec" -gt "$date2_sec" ]; then
|
||||
echo "new_patch=1" >> $GITHUB_OUTPUT
|
||||
echo "New patch, building..."
|
||||
elif [ "$date1_sec" -lt "$date2_sec" ]; then
|
||||
echo "new_patch=0" >> $GITHUB_OUTPUT
|
||||
echo "Old patch, not build."
|
||||
fi
|
||||
}
|
||||
checker $1 $2
|
||||
@@ -4,21 +4,30 @@ mkdir ./release
|
||||
|
||||
#################################################
|
||||
|
||||
# Checking new patch:
|
||||
checker() {
|
||||
curl -sL https://api.github.com/repos/$1/releases/latest > json.txt
|
||||
latest_version=$(jq -r '.name' json.txt)
|
||||
curl -sL "https://api.github.com/repos/$repository/releases/latest" | jq -r '.assets[] | select(.name == "'$2'-version.txt") | .browser_download_url' | xargs curl -sLO
|
||||
cur_version=$(cat $2-version.txt)
|
||||
if [ "$latest_version" = "$cur_version" ]; then
|
||||
echo "Old patch, not build!"
|
||||
rm -f ./json.txt ./$2-version.txt
|
||||
exit 0
|
||||
else
|
||||
echo "New patch, building..."
|
||||
rm -f ./json.txt ./$2-version.txt
|
||||
echo $latest_version > $2-version.txt
|
||||
fi
|
||||
# Check new patch:
|
||||
get_date() {
|
||||
local assets asset name updated_at
|
||||
assets=$(curl -s https://api.github.com/repos/"$1"/releases/latest | jq '.assets')
|
||||
for asset in $(echo "$assets" | jq -r '.[] | @base64'); do
|
||||
asset=$(echo "$asset" | base64 --decode)
|
||||
name=$(echo "$asset" | jq -r '.name')
|
||||
updated_at=$(echo "$asset" | jq -r '.updated_at')
|
||||
[[ $name =~ "$2" ]] && echo "$updated_at"
|
||||
done
|
||||
}
|
||||
checker(){
|
||||
local date1 date2 date1_sec date1_sec repo=$1 ur_repo=$GITHUB_REPOSITORY check=$2
|
||||
date1=$(get_date "$repo" "patches.json")
|
||||
date2=$(get_date "$ur_repo" "$check")
|
||||
date1_sec=$(date -d "$date1" +%s)
|
||||
date2_sec=$(date -d "$date2" +%s)
|
||||
if [ -z "$date2" ] || [ "$date1_sec" -gt "$date2_sec" ]; then
|
||||
export new_patch=1
|
||||
echo "New patch, building..."
|
||||
elif [ "$date1_sec" -lt "$date2_sec" ]; then
|
||||
export new_patch=0
|
||||
echo "Old patch, not build."
|
||||
fi
|
||||
}
|
||||
|
||||
#################################################
|
||||
|
||||
Reference in New Issue
Block a user