build-termux: config selection

This commit is contained in:
j-hc 2023-03-26 13:47:39 +03:00
parent 805c22a687
commit 4f3aa1f628

View File

@ -19,6 +19,8 @@ ask() {
return 1 return 1
} }
CFG=config.toml
if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then
pr "Setting up environment..." pr "Setting up environment..."
yes "" | pkg update -y && pkg install -y openssl git wget jq openjdk-17 zip yes "" | pkg update -y && pkg install -y openssl git wget jq openjdk-17 zip
@ -32,26 +34,29 @@ if [ -d revanced-magisk-module ]; then
if git -C revanced-magisk-module status | grep -q 'is behind'; then if git -C revanced-magisk-module status | grep -q 'is behind'; then
pr "revanced-magisk-module already is not synced with upstream." pr "revanced-magisk-module already is not synced with upstream."
pr "Cloning revanced-magisk-module. config.toml will be preserved." pr "Cloning revanced-magisk-module. config.toml will be preserved."
cp -f revanced-magisk-module/config.toml . cp -f revanced-magisk-module/config*toml .
rm -rf revanced-magisk-module rm -rf revanced-magisk-module
git clone https://github.com/j-hc/revanced-magisk-module --recurse --depth 1 git clone https://github.com/j-hc/revanced-magisk-module --recurse --depth 1
mv -f config.toml revanced-magisk-module/config.toml mv -f config*toml revanced-magisk-module/
fi fi
else else
pr "Cloning revanced-magisk-module." pr "Cloning revanced-magisk-module."
git clone https://github.com/j-hc/revanced-magisk-module --recurse --depth 1 git clone https://github.com/j-hc/revanced-magisk-module --recurse --depth 1
sed -i '/^enabled.*/d; /^\[.*\]/a enabled = false' revanced-magisk-module/config.toml sed -i '/^enabled.*/d; /^\[.*\]/a enabled = false' revanced-magisk-module/config*toml
fi fi
cd revanced-magisk-module cd revanced-magisk-module
chmod +x build.sh build-termux.sh chmod +x build.sh build-termux.sh
if ask "Do you want to open the config.toml for customizations? [y/n]"; then if ! ask "Select config (y=revanced n=revanced extended)"; then
nano config.toml CFG=config-rv-ex.toml
fi
if ask "Do you want to open the config for customizations? [y/n]"; then
nano $CFG
fi fi
if ! ask "Setup is done. Do you want to start building? [y/n]"; then if ! ask "Setup is done. Do you want to start building? [y/n]"; then
exit 0 exit 0
fi fi
./build.sh ./build.sh $CFG
cd build cd build
pr "Ask for storage permission" pr "Ask for storage permission"