mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-26 12:48:36 -06:00
Fixed post build processing
This commit is contained in:
parent
c41dba2d06
commit
e8cd60dbdb
2 changed files with 15 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Use force to run the builds forcefully
|
||||||
|
|
||||||
# Get timestamp
|
# Get timestamp
|
||||||
timestamp=$(date '+%s')
|
timestamp=$(date '+%s')
|
||||||
|
|
||||||
|
@ -7,7 +9,7 @@ timestamp=$(date '+%s')
|
||||||
patch_file="./patches.txt"
|
patch_file="./patches.txt"
|
||||||
|
|
||||||
# Set working directory and current directory
|
# Set working directory and current directory
|
||||||
WDIR="/home/sintan/Downloads/Random/ReVanced/build/"
|
WDIR="$1"
|
||||||
ODIR="$PWD"
|
ODIR="$PWD"
|
||||||
|
|
||||||
# Get line numbers where included & excluded patches start from.
|
# Get line numbers where included & excluded patches start from.
|
||||||
|
@ -89,13 +91,13 @@ for artifact in "${!artifacts[@]}"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Exit if no updates happened
|
# Exit if no updates happened
|
||||||
if [ ! $flag ]; then
|
if [[ $flag==false && "$1" != "force" ]]; then
|
||||||
echo "Nothing to update" | tee -a build.log
|
echo "Nothing to update" | tee -a build.log
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download required apk files
|
# Download required apk files
|
||||||
$ODIR/download_apkmirror.sh
|
$ODIR/download_apkmirror.sh "$WDIR"
|
||||||
|
|
||||||
# Fetch microG
|
# Fetch microG
|
||||||
chmod +x apkeep
|
chmod +x apkeep
|
||||||
|
@ -128,7 +130,7 @@ if [ -f "com.google.android.youtube.apk" ]; then
|
||||||
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.apk
|
||||||
else
|
else
|
||||||
echo "Cannot find YouTube APK, skipping build" | tee -a build.log
|
echo "Cannot find YouTube APK, skipping build" | tee -a build.log
|
||||||
fi
|
fi
|
||||||
|
@ -146,20 +148,24 @@ if [ -f "com.google.android.apps.youtube.music.apk" ]; then
|
||||||
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.apk
|
||||||
else
|
else
|
||||||
echo "Cannot find YouTube Music APK, skipping build" | tee -a build.log
|
echo "Cannot find YouTube Music APK, skipping build" | tee -a build.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Rename files
|
||||||
|
mv revanced.apk ReVanced-nonroot-$timestamp.apk
|
||||||
|
mv revanced-music.apk ReVanced-Music-nonroot-$timestamp.apk
|
||||||
|
|
||||||
# Send telegram message about the new build
|
# Send telegram message about the new build
|
||||||
echo "Sending messages to telegram" | tee -a 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 ""
|
/home/sintan/.local/bin/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
|
||||||
cat message.tmp | ../telegram.sh -
|
cat message.tmp | ../telegram.sh -
|
||||||
rm message.tmp
|
rm message.tmp
|
||||||
|
|
||||||
# Do some cleanup
|
# Do some cleanup
|
||||||
mkdir -p archive
|
mkdir -p archive
|
||||||
mv ReVanced*.apk archive/
|
mv ReVanced*.apk archive/
|
||||||
find archive/ -mtime +3 -exec rm {} \;
|
find archive/ -mtime +3 -exec rm {} \;
|
||||||
|
|
|
@ -81,7 +81,7 @@ dl_ytm() {
|
||||||
|
|
||||||
# Get into the build directory
|
# Get into the build directory
|
||||||
|
|
||||||
cd "/home/sintan/Downloads/Random/ReVanced/build/"
|
cd "$1"
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue