Update to new build system
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,17 +1,15 @@
|
|||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update && apt-get install -y git jq openjdk-17-jdk zip wget
|
||||||
RUN apt-get install -y bsdmainutils curl wget jq openjdk-17-jre aapt
|
RUN git clone --recurse https://github.com/revanced-apks/build-apps.git /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN sed -i 's/ks\.keystore/build\/revanced\.keystore/g' build.sh
|
||||||
COPY revanced.sh .
|
RUN sed -i 's/enabled = false/enabled = true/g' config.toml
|
||||||
RUN chmod +x revanced.sh
|
|
||||||
|
|
||||||
RUN groupadd -g 1000 revanced
|
RUN groupadd -g 1000 revanced
|
||||||
RUN useradd -u 1000 -g revanced revanced
|
RUN useradd -u 1000 -g revanced revanced
|
||||||
RUN chown -R revanced:revanced /app
|
RUN chown -R revanced:revanced /app
|
||||||
USER revanced
|
USER revanced
|
||||||
|
|
||||||
ENTRYPOINT [ "./revanced.sh" ]
|
CMD [ "bash", "build.sh" ]
|
||||||
CMD [ "-A" ]
|
|
||||||
|
13
README.md
13
README.md
@@ -1,9 +1,9 @@
|
|||||||
# docker-revanced-builder
|
# docker-revanced-builder
|
||||||
|
|
||||||
A bash script that will help you build Revanced apps using Docker. Based on [revanced-automatic-builder](https://github.com/gnuhead-chieb/revanced-automatic-builder).
|
A Docker container that will help you build Revanced apps. Based on [revanced-apks/build-apps](https://github.com/revanced-apks/build-apps).
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run -v $(pwd)/build:/app/build -v $(pwd)/out:/app/out -e GITHUB_TOKEN=YOUR_GITHUB_TOKEN registry.karaolidis.com/nikas36/revanced-builder:latest
|
docker run -v $(pwd)/build:/app/build -e GITHUB_TOKEN=YOUR_GITHUB_TOKEN registry.karaolidis.com/nikas36/revanced-builder:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
@@ -14,11 +14,10 @@ docker run -v $(pwd)/build:/app/build -v $(pwd)/out:/app/out -e GITHUB_TOKEN=YOU
|
|||||||
|
|
||||||
## Volumes
|
## Volumes
|
||||||
|
|
||||||
| Volume | Description |
|
| Volume | Description |
|
||||||
| ------------ | --------------------- |
|
| ------------ | ----------------------------------------------- |
|
||||||
| `/app/build` | The build directory. |
|
| `/app/build` | The build directory (should contain a keystore) |
|
||||||
| `/app/out` | The output directory. |
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
Remember to download [VancedMicroG](<[VancedMicroG](https://github.com/TeamVanced/VancedMicroG/releases)>) in order to be able to sign in to your Google account.
|
Remember to download [VancedMicroG](https://github.com/TeamVanced/VancedMicroG/releases) in order to be able to sign in to your Google account.
|
||||||
|
187
revanced.sh
187
revanced.sh
@@ -1,187 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cli_api="https://api.github.com/repos/revanced/revanced-cli/releases/latest"
|
|
||||||
patches_api="https://api.github.com/repos/revanced/revanced-patches/releases/latest"
|
|
||||||
integrations_api="https://api.github.com/repos/revanced/revanced-integrations/releases/latest"
|
|
||||||
|
|
||||||
vc=4
|
|
||||||
|
|
||||||
apps=("youtube" "music" "twitter" "reddit" "tiktoka" "tiktokg" "spotify" "windyapp" "nyx" "backdrops" "expensemgr" "hexedit" "ticktick" "warnapp" "iconpack" "citra" "myexpenses" "twitch")
|
|
||||||
|
|
||||||
youtube=(
|
|
||||||
"Youtube"
|
|
||||||
"https://apkcombo.com/youtube/com.google.android.youtube"
|
|
||||||
)
|
|
||||||
music=(
|
|
||||||
"Youtube Music"
|
|
||||||
"https://apkcombo.com/youtube-music/com.google.android.apps.youtube.music"
|
|
||||||
)
|
|
||||||
twitter=(
|
|
||||||
"Twitter"
|
|
||||||
"https://apkcombo.com/twitter/com.twitter.android"
|
|
||||||
)
|
|
||||||
reddit=(
|
|
||||||
"Reddit"
|
|
||||||
"https://apkcombo.com/reddit/com.reddit.frontpage"
|
|
||||||
)
|
|
||||||
tiktoka=(
|
|
||||||
"TikTok(Asia)"
|
|
||||||
"https://apkcombo.com/tiktok-asia/com.ss.android.ugc.trill"
|
|
||||||
)
|
|
||||||
tiktokg=(
|
|
||||||
"Tiktok(Global)"
|
|
||||||
"https://apkcombo.com/tiktok/com.zhiliaoapp.musically"
|
|
||||||
)
|
|
||||||
spotify=(
|
|
||||||
"Spotify"
|
|
||||||
"https://apkcombo.com/spotify/com.spotify.music"
|
|
||||||
)
|
|
||||||
windyapp=(
|
|
||||||
"Windy.app"
|
|
||||||
"https://apkcombo.com/windy-app/co.windyapp.android"
|
|
||||||
)
|
|
||||||
nyx=(
|
|
||||||
"Nyx Music Player"
|
|
||||||
"https://apkcombo.com/nyx-music-player/com.awedea.nyx"
|
|
||||||
)
|
|
||||||
backdrops=(
|
|
||||||
"Backdrops - Wallpapers"
|
|
||||||
"https://apkcombo.com/backdrops-wallpapers/com.backdrops.wallpapers"
|
|
||||||
)
|
|
||||||
expensemgr=(
|
|
||||||
"Money Manager"
|
|
||||||
"https://apkcombo.com/money-manager-expense-budget/com.ithebk.expensemanager"
|
|
||||||
)
|
|
||||||
hexedit=(
|
|
||||||
"HEX Editor"
|
|
||||||
"https://apkcombo.com/hex-editor/com.myprog.hexedit"
|
|
||||||
)
|
|
||||||
ticktick=(
|
|
||||||
"TickTick"
|
|
||||||
"https://apkcombo.com/ticktick/com.ticktick.task"
|
|
||||||
)
|
|
||||||
warnapp=(
|
|
||||||
"WarnWetter"
|
|
||||||
"https://apkcombo.com/warnwetter/de.dwd.warnapp"
|
|
||||||
)
|
|
||||||
iconpack=(
|
|
||||||
"Icon Pack Studio"
|
|
||||||
"https://apkcombo.com/icon-pack-studio/ginlemon.iconpackstudio"
|
|
||||||
)
|
|
||||||
citra=(
|
|
||||||
"Citra Emulator"
|
|
||||||
"https://apkcombo.com/citra-emulator/org.citra.citra_emu"
|
|
||||||
)
|
|
||||||
myexpenses=(
|
|
||||||
"My Expenses"
|
|
||||||
"https://apkcombo.com/my-expenses/org.totschnig.myexpenses"
|
|
||||||
)
|
|
||||||
twitch=(
|
|
||||||
"Twitch"
|
|
||||||
"https://apkcombo.com/twitch/tv.twitch.android.app"
|
|
||||||
)
|
|
||||||
|
|
||||||
mkdir /app/build &>/dev/null
|
|
||||||
mkdir /app/out &>/dev/null
|
|
||||||
cd /app/build
|
|
||||||
|
|
||||||
function getappver() {
|
|
||||||
ver=$(jq -r ".[].compatiblePackages[]|select(.name==\"$(eval echo \${$1[1]} | awk -F/ '{print $NF}')\")|.versions[]" ./patches.json | awk '{if(m<$NF) m=$NF} END{print m}')
|
|
||||||
[[ -n "$ver" ]] || ver="all"
|
|
||||||
echo $ver
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check version and download revanced packages
|
|
||||||
for pkg in cli patches integrations; do
|
|
||||||
ver=$(eval curl -sH \"Authorization: token $GITHUB_TOKEN\" '$'${pkg}_api | jq -r ".name")
|
|
||||||
download=$(eval curl -sH \"Authorization: token $GITHUB_TOKEN\" '$'${pkg}_api | jq -r ".assets[-1].browser_download_url")
|
|
||||||
[[ $ver == "null" ]] && {
|
|
||||||
echo "${pkg^}:API Error"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
ls $pkg-$ver &>/dev/null && echo ${pkg^}:updated! || {
|
|
||||||
rm -f $pkg-*
|
|
||||||
wget "$download" -c -t 15 -O $pkg-$ver
|
|
||||||
}
|
|
||||||
done
|
|
||||||
|
|
||||||
# Fetch Patches database
|
|
||||||
wget https://github.com/revanced/revanced-patches/raw/main/patches.json &>/dev/null
|
|
||||||
|
|
||||||
exclude=""
|
|
||||||
if [ $# -eq 2 ]; then
|
|
||||||
if [ "$1" == "--exclude" ] || [ "$1" == "-e" ]; then
|
|
||||||
excludes=$2
|
|
||||||
exclude=" -e ${excludes//,/ -e }"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# List patch available app versions
|
|
||||||
echo -e "Loading apps... \n"
|
|
||||||
{
|
|
||||||
opt=0
|
|
||||||
for pkg in ${apps[@]}; do
|
|
||||||
eval echo "$opt:\${$pkg[0]},$(getappver $pkg)"
|
|
||||||
((opt++))
|
|
||||||
done
|
|
||||||
} | column -t -s,
|
|
||||||
|
|
||||||
# If the script was run with no arguments, prompt the user to select apps
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
read -p "Enter the app numbers you want to download, leave blank for all (e.g. 1,3,5-7): " menuinput
|
|
||||||
if [[ -z $menuinput ]]; then
|
|
||||||
menuinput=0-$((${#apps[@]} - 1))
|
|
||||||
fi
|
|
||||||
# If the script was run with -a or --apps, use the second argument as the app numbers
|
|
||||||
elif [ $# -eq 2 ]; then
|
|
||||||
if [ "$1" == "--apps" ] || [ "$1" == "-a" ]; then
|
|
||||||
menuinput=$2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# If the script was run with -A or --all, download all apps
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
if [ "$1" == "--all" ] || [ "$1" == "-A" ]; then
|
|
||||||
menuinput=0-$((${#apps[@]} - 1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
IFS=',' read -ra app_nums <<<"$menuinput"
|
|
||||||
invalid_input=false
|
|
||||||
selected_apps=()
|
|
||||||
for num in "${app_nums[@]}"; do
|
|
||||||
if [[ $num =~ ^[0-9]+$ ]]; then
|
|
||||||
if ((num >= 0 && num < ${#apps[@]})); then
|
|
||||||
selected_apps+=($num)
|
|
||||||
else
|
|
||||||
invalid_input=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
elif [[ $num =~ ^([0-9]+)-([0-9]+)$ ]]; then
|
|
||||||
start=${BASH_REMATCH[1]}
|
|
||||||
end=${BASH_REMATCH[2]}
|
|
||||||
if ((start < end && start >= 0 && end < ${#apps[@]})); then
|
|
||||||
for ((i = start; i <= end; i++)); do
|
|
||||||
selected_apps+=($i)
|
|
||||||
done
|
|
||||||
else
|
|
||||||
invalid_input=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
invalid_input=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if $invalid_input; then
|
|
||||||
echo "Invalid input. Please enter a comma-separated list of integers or ranges."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download required apk from APKCombo and patch
|
|
||||||
for i in ${selected_apps[@]}; do
|
|
||||||
rm -f ${apps[$i]}-orig.apk &>/dev/null
|
|
||||||
ver=$(getappver ${apps[$i]})
|
|
||||||
[[ "$ver" = "all" ]] && req="apk" || req="phone-${ver}-apk"
|
|
||||||
wget $(eval curl -s "\${${apps[$i]}[1]}/download/${req}" | grep -oPm1 "(?<=href=\")https://download.apkcombo.com/.*?(?=\")")\&$(curl -s "https://apkcombo.com/checkin") -O ${apps[$i]}-orig.apk
|
|
||||||
java -jar cli-* -b patches-* -m integrations-*$exclude -a ${apps[$i]}-orig.apk -c -o ${apps[$i]}-patched.apk --experimental --keystore revanced.keystore
|
|
||||||
mv ${apps[$i]}-patched.apk /app/out
|
|
||||||
done
|
|
Reference in New Issue
Block a user