Skip to content

Commit

Permalink
build: Readapt for this repository
Browse files Browse the repository at this point in the history
* After the breaking changes made by ReVanced, some changes were
  necessary. This commit re-implements goodies that were in this
  repository before the changes.
  ReVanced Extended and anddea versions now moved to the `rvx` branch.
  Partial commit history at: https://github.com/peternmuller/revanced-builder/commits/rvx/

Signed-off-by: peternmuller <[email protected]>
  • Loading branch information
peternmuller committed Dec 5, 2024
1 parent b18024d commit 2bfaf09
Show file tree
Hide file tree
Showing 23 changed files with 421 additions and 199 deletions.
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
run:
permissions: write-all
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -106,42 +106,42 @@ jobs:
skip_checkout: true
file_pattern: build.md *-update.json
commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}
commit_options: '--signoff'
commit_author: peternmuller <[email protected]>

- name: Report to Telegram
env:
TG_TOKEN: ${{ secrets.TG_TOKEN }}
if: env.TG_TOKEN != null
run: |
cd build || { echo "build folder not found"; exit 1; }
TG_CHAT="@rvc_magisk"
TG_CHAT="@PeterSpace10T"
NL=$'\n'
APKS=""
MODULES=""
for OUTPUT in *; do
DL_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
if [[ $OUTPUT = *.apk ]]; then
APKS+="${NL}📦[${OUTPUT}](${DL_URL})"
APKS+="${NL}📦 [${OUTPUT}](${DL_URL})"
elif [[ $OUTPUT = *.zip ]]; then
MODULES+="${NL}📦[${OUTPUT}](${DL_URL})"
MODULES+="${NL}📦 [${OUTPUT}](${DL_URL})"
fi
done
MODULES=${MODULES#"$NL"}
APKS=${APKS#"$NL"}
BODY="$(sed 's/^\* \*\*/↪ \*\*/g; s/^\* `/↪ \*\*/g; s/`/\*/g; s/^\* /\↪/g; s/\*\*/\*/g; s/###//g; s/^- /↪ /g; /^==/d;' ../build.md)"
MSG="*New build!*
MSG="*New Build Released! 🎉*
${BODY}
*▼ Download Links:*
Modules:
*Modules:*
${MODULES}
APKs:
*APKs:*
${APKS}
*By @peternoz*
*🌟 Check out my builder source:*
https://github.com/peternmuller/revanced-builder
"
echo "'$MSG'"
MSG=${MSG:0:9450}
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: CI
on:
workflow_dispatch:
branches: [ "main" ]
schedule:
- cron: "0 16 * * *"
- cron: "0 */1 * * *"

jobs:
check:
permissions: write-all
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -46,4 +47,4 @@ jobs:
needs: check
uses: ./.github/workflows/build.yml
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }}
secrets: inherit
secrets: inherit
115 changes: 71 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,77 @@
# ReVanced Magisk Module
[![Telegram](https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white)](https://t.me/rvc_magisk)
[![CI](https://github.com/j-hc/revanced-magisk-module/actions/workflows/ci.yml/badge.svg?event=schedule)](https://github.com/j-hc/revanced-magisk-module/actions/workflows/ci.yml)

Extensive ReVanced builder

Get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/releases).

Use [**zygisk-detach**](https://github.com/j-hc/zygisk-detach) to detach YouTube and YT Music from Play Store if you are using magisk modules.

<details><summary><big>Features</big></summary>
<ul>
<li>Support all present and future ReVanced and <a href="https://github.com/inotia00/revanced-patches">ReVanced Extended</a> apps</li>
<li> Can build Magisk modules and non-root APKs</li>
<li> Updated daily with the latest versions of apps and patches</li>
<li> Optimize APKs and modules for size</li>
<li> Modules</li>
<ul>
<li> recompile invalidated odex for faster usage</li>
<li> receive updates from Magisk app</li>
<li> do not break safetynet or trigger root detections</li>
<li> handle installation of the correct version of the stock app and all that</li>
<li> support Magisk and KernelSU</li>
</ul>
</ul>
Note that the <a href="../../actions/workflows/ci.yml">CI workflow</a> is scheduled to build the modules and APKs everyday using GitHub Actions if there is a change in ReVanced patches. You may want to disable it.
</details>

## To include/exclude patches or patch other apps

* Star the repo :eyes:
* Use the repo as a [template](https://github.com/new?template_name=revanced-magisk-module&template_owner=j-hc)
* Customize [`config.toml`](./config.toml) using [rvmm-config-gen](https://j-hc.github.io/rvmm-config-gen/)
* Run the build [workflow](../../actions/workflows/build.yml)
* Grab your modules and APKs from [releases](../../releases)

also see here [`CONFIG.md`](./CONFIG.md)
#### ⚠️ Do not download APKs or modules from random websites you find on Google, as they may be dangerous and because providers impersonate ReVanced/ReVanced Extended. Please build your application from official sources or use open source builders like this one.

# Welcome to my ReVanced Builder!
[![CI](https://github.com/peternmuller/revanced-builder/actions/workflows/ci.yml/badge.svg?event=schedule)](https://github.com/peternmuller/revanced-builder/actions/workflows/ci.yml)
[![GitHub License](https://img.shields.io/github/license/peternmuller/revanced-builder?logo=gnu&label=License&link=https%3A%2F%2Fgithub.com%2Fpeternmuller%2Frevanced-builder%2Fblob%2Fmain%2FLICENSE)](https://github.com/peternmuller/revanced-builder/blob/main/LICENSE)
[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/peternmuller/revanced-builder/total?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNNC43NSAxNy4yNWEuNzUuNzUgMCAwIDEgLjc1Ljc1djIuMjVjMCAuMTM4LjExMi4yNS4yNS4yNWgxMi41YS4yNS4yNSAwIDAgMCAuMjUtLjI1VjE4YS43NS43NSAwIDAgMSAxLjUgMHYyLjI1QTEuNzUgMS43NSAwIDAgMSAxOC4yNSAyMkg1Ljc1QTEuNzUgMS43NSAwIDAgMSA0IDIwLjI1VjE4YS43NS43NSAwIDAgMSAuNzUtLjc1WiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPjxwYXRoIGQ9Ik01LjIyIDkuOTdhLjc0OS43NDkgMCAwIDEgMS4wNiAwbDQuOTcgNC45NjlWMi43NWEuNzUuNzUgMCAwIDEgMS41IDB2MTIuMTg5bDQuOTctNC45NjlhLjc0OS43NDkgMCAxIDEgMS4wNiAxLjA2bC02LjI1IDYuMjVhLjc0OS43NDkgMCAwIDEtMS4wNiAwbC02LjI1LTYuMjVhLjc0OS43NDkgMCAwIDEgMC0xLjA2WiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPjwvc3ZnPg==&label=Downloads&link=https%3A%2F%2Fgithub.com%2Fpeternmuller%2Frevanced-builder%2Freleases)](https://github.com/peternmuller/revanced-builder/releases)

This ReVanced Builder creates both APKs and [Magisk](https://github.com/topjohnwu/Magisk)/[KernelSU](https://github.com/tiann/KernelSU) modules for [ReVanced](https://github.com/ReVanced) and [ReVanced Extended](https://github.com/inotia00/revanced-patches) versions of YouTube and YouTube Music.

#### **Get the latest CI release [here](https://github.com/peternmuller/revanced-builder/releases/latest)!**

## Installation
### Non-root users
- Install the [ReVanced GmsCore app](https://github.com/ReVanced/GmsCore/releases/latest).
- Download the APK files you want to install from the [releases page](https://github.com/peternmuller/revanced-builder/releases/latest).
- (Optional) Import [one of my custom settings file](https://github.com/peternmuller/revanced-builder/tree/main/custom-settings) in your application. [*How to do this?*](https://github.com/peternmuller/revanced-builder/tree/main/custom-settings)
- Enjoy!
### Root users
- Download the ZIP files you want to flash from the [releases page](https://github.com/peternmuller/revanced-builder/releases/latest).
- (Optional) Import [one of my custom settings file](https://github.com/peternmuller/revanced-builder/tree/main/custom-settings) in your application. [*How to do this?*](https://github.com/peternmuller/revanced-builder/tree/main/custom-settings)
- (Optional) Use [zygisk-detach](https://github.com/j-hc/zygisk-detach) to detach YouTube and YouTube Music from the Play Store.
- Enjoy!

## Easily update ReVanced apps with Obtainium
You can easily update the ReVanced apps from this builder by using [Obtainium](https://github.com/ImranR98/Obtainium) which allows you to install and update apps directly from their releases pages, and receive notifications when new releases are made available.

#### Here is a quick tutorial on how to add them to Obtainium:

<img width="2160" alt="obtainium_quick_tutorial" src="https://github.com/user-attachments/assets/3f0af16e-328e-4831-99c5-9253192403c7">

> [!NOTE]
> In step 5, you need to enter the regular expression that corresponds to the application you want to install:
> - YouTube ReVanced: `youtube-revanced-v`
> - YouTube Music ReVanced: `yt-music-revanced-v`
> - YouTube ReVanced Extended: `youtube-revanced-extended`
> - YouTube Music ReVanced Extended: `yt-music-revanced-extended`
> - YouTube ReVanced anddea: `youtube-revanced-anddea`
> - YouTube Music ReVanced anddea: `yt-music-revanced-anddea`
## Import custom settings in ReVanced applications
I personally like my YouTube and YouTube Music applications to be as close as possible to the original look, but less cluttered, easier and less annoying to use. If this is also the case for you, I highly recommend importing [my custom settings files](https://github.com/peternmuller/revanced-builder/tree/main/custom-settings).

**To do this, go to YouTube Settings &rarr; ReVanced (or ReVanced Extended) &rarr; Miscellaneous (or Advanced Settings for YouTube Music) &rarr; Import&nbsp;/&nbsp;Export settings.**

## Building Locally
### On Termux
```console
bash <(curl -sSf https://raw.githubusercontent.com/j-hc/revanced-magisk-module/main/build-termux.sh)
```bash
bash <(curl -sSf https://raw.githubusercontent.com/peternmuller/revanced-builder/main/build-termux.sh)
```

### On Desktop
```console
$ git clone https://github.com/j-hc/revanced-magisk-module
$ cd revanced-magisk-module
$ ./build.sh
```bash
git clone https://github.com/peternmuller/revanced-builder
cd revanced-builder
./build.sh
```

## Credits
- [j-hc](https://github.com/j-hc) for creating this amazing builder.
- [Kevinr99089](https://github.com/kevinr99089) for providing assistance with the builder.
- [KitsunedFox](https://github.com/KitsunedFox) for the idea of the Obtainium tutorial.
- And of course, the [ReVanced](https://github.com/ReVanced) team, [inotia00](https://github.com/inotia00) and [anddea](https://github.com/anddea) for their work on the ReVanced apps!

## License
Copyright (C) 2024 Peter Noël Muller

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Binary file modified bin/aapt2/aapt2-arm
Binary file not shown.
Binary file modified bin/aapt2/aapt2-arm64
Binary file not shown.
Binary file modified bin/apksigner.jar
Binary file not shown.
Binary file modified bin/htmlq/htmlq-arm
Binary file not shown.
Binary file modified bin/htmlq/htmlq-arm64
Binary file not shown.
48 changes: 24 additions & 24 deletions build-termux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,45 @@ if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then
yes "" | pkg update -y && pkg install -y openssl git wget jq openjdk-17 zip
: >~/.rvmm_"$(date '+%Y%m')"
fi
mkdir -p /sdcard/Download/revanced-magisk-module/
mkdir -p /sdcard/Download/revanced-builder/

if [ ! -d revanced-magisk-module ]; then
pr "Cloning revanced-magisk-module."
git clone https://github.com/j-hc/revanced-magisk-module --depth 1
cd revanced-magisk-module
if [ ! -d revanced-builder ]; then
pr "Cloning revanced-builder."
git clone https://github.com/peternmuller/revanced-builder --depth 1
cd revanced-builder
sed -i '/^enabled.*/d; /^\[.*\]/a enabled = false' config.toml
grep -q 'revanced-magisk-module' ~/.gitconfig 2>/dev/null \
|| git config --global --add safe.directory ~/revanced-magisk-module
grep -q 'revanced-builder' ~/.gitconfig 2>/dev/null \
|| git config --global --add safe.directory ~/revanced-builder
else
cd revanced-magisk-module
pr "Checking for revanced-magisk-module updates"
cd revanced-builder
pr "Checking for revanced-builder updates"
git fetch
if git status | grep -q 'is behind\|fatal'; then
pr "revanced-magisk-module already is not synced with upstream."
pr "Cloning revanced-magisk-module. config.toml will be preserved."
pr "revanced-builder already is not synced with upstream."
pr "Cloning revanced-builder. config.toml will be preserved."
cd ..
cp -f revanced-magisk-module/config.toml .
rm -rf revanced-magisk-module
git clone https://github.com/j-hc/revanced-magisk-module --recurse --depth 1
mv -f config.toml revanced-magisk-module/config.toml
cd revanced-magisk-module
cp -f revanced-builder/config.toml .
rm -rf revanced-builder
git clone https://github.com/peternmuller/revanced-builder --recurse --depth 1
mv -f config.toml revanced-builder/config.toml
cd revanced-builder
fi
fi

[ -f ~/storage/downloads/revanced-magisk-module/config.toml ] \
|| cp config.toml ~/storage/downloads/revanced-magisk-module/config.toml
[ -f ~/storage/downloads/revanced-builder/config.toml ] \
|| cp config.toml ~/storage/downloads/revanced-builder/config.toml

if ask "Open rvmm-config-gen to generate a config?"; then
am start -a android.intent.action.VIEW -d https://j-hc.github.io/rvmm-config-gen/
fi
printf "\n"
until
if ask "Open 'config.toml' to configure builds?\nAll are disabled by default, you will need to enable at first time building"; then
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-magisk-module/config.toml -t text/plain
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-builder/config.toml -t text/plain
fi
ask "Setup is done. Do you want to start building?"
do :; done
cp -f ~/storage/downloads/revanced-magisk-module/config.toml config.toml
cp -f ~/storage/downloads/revanced-builder/config.toml config.toml

./build.sh

Expand All @@ -78,10 +78,10 @@ for op in *; do
pr "glob fail"
exit 1
}
mv -f "${PWD}/${op}" ~/storage/downloads/revanced-magisk-module/"${op}"
mv -f "${PWD}/${op}" ~/storage/downloads/revanced-builder/"${op}"
done

pr "Outputs are available in /sdcard/Download/revanced-magisk-module folder"
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-magisk-module -t resource/folder
pr "Outputs are available in /sdcard/Download/revanced-builder folder"
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-builder -t resource/folder
sleep 2
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-magisk-module -t resource/folder
am start -a android.intent.action.VIEW -d file:///sdcard/Download/revanced-builder -t resource/folder
15 changes: 7 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ if [ "$(echo "$TEMP_DIR"/*-rv/changelog.md)" ]; then
fi

mkdir -p ${MODULE_TEMPLATE_DIR}/bin/arm64 ${MODULE_TEMPLATE_DIR}/bin/arm ${MODULE_TEMPLATE_DIR}/bin/x86 ${MODULE_TEMPLATE_DIR}/bin/x64
gh_dl "${MODULE_TEMPLATE_DIR}/bin/arm64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-arm64-v8a"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-armeabi-v7a"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/x86/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/x64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86_64"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/arm64/cmpr" "https://github.com/peternmuller/cmpr/releases/latest/download/cmpr-arm64-v8a"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/peternmuller/cmpr/releases/latest/download/cmpr-armeabi-v7a"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/x86/cmpr" "https://github.com/peternmuller/cmpr/releases/latest/download/cmpr-x86"
gh_dl "${MODULE_TEMPLATE_DIR}/bin/x64/cmpr" "https://github.com/peternmuller/cmpr/releases/latest/download/cmpr-x86_64"

declare -A cliriplib
idx=0
Expand Down Expand Up @@ -133,7 +133,7 @@ for table_name in $(toml_get_table_names); do
table_name_f=${table_name,,}
table_name_f=${table_name_f// /-}
app_args[module_prop_name]=$(toml_get "$t" module-prop-name) || {
app_args[module_prop_name]="${table_name_f}-jhc"
app_args[module_prop_name]="${table_name_f}-peternmuller"
if [ "${app_args[arch]}" = "arm64-v8a" ]; then
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
elif [ "${app_args[arch]}" = "arm-v7a" ]; then
Expand Down Expand Up @@ -165,9 +165,8 @@ wait
rm -rf temp/tmp.*
if [ -z "$(ls -A1 "${BUILD_DIR}")" ]; then abort "All builds failed."; fi

log "\nInstall [Microg](https://github.com/ReVanced/GmsCore/releases) for non-root YouTube and YT Music APKs"
log "Use [zygisk-detach](https://github.com/j-hc/zygisk-detach) to detach root ReVanced YouTube and YT Music from Play Store"
log "\n[revanced-magisk-module](https://github.com/j-hc/revanced-magisk-module)\n"
log "\nInstall [ReVanced GmsCore](https://github.com/ReVanced/GmsCore/releases/latest) for non-root YouTube and YouTube Music APKs"
log "(Optional) Use [zygisk-detach](https://github.com/j-hc/zygisk-detach/releases/latest) to detach root ReVanced YouTube and YouTube Music from the Play Store\n"
log "$(cat "$TEMP_DIR"/*-rv/changelog.md)"

SKIPPED=$(cat "$TEMP_DIR"/skipped 2>/dev/null || :)
Expand Down
Loading

0 comments on commit 2bfaf09

Please sign in to comment.