Skip to content

Commit

Permalink
refactor: Personal Change
Browse files Browse the repository at this point in the history
  • Loading branch information
E85Addict committed Jan 17, 2025
1 parent 2d8e1fb commit e47f177
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 27 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ jobs:
- name: Report to Telegram
env:
TG_TOKEN: ${{ secrets.TG_TOKEN }}
TG_CHAT: ${{ secrets.TG_CHAT }}
if: env.TG_TOKEN != null
run: |
cd build || { echo "build folder not found"; exit 1; }
TG_CHAT="@rvc_magisk"
NL=$'\n'
APKS=""
MODULES=""
Expand Down Expand Up @@ -145,3 +145,17 @@ jobs:
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"
- uses: actions/upload-artifact@v4
with:
name: logs
path: logs
if-no-files-found: ignore
- name: Delete Older Releases
uses: dev-drprasad/delete-older-releases@v0.3.2
with:
repo: E85Addict/revanced-magisk-module # defaults to current repo
keep_latest: 10
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
workflow_dispatch:
schedule:
- cron: "0 16 * * *"
- cron: "0 */8 * * *"

jobs:
check:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Delete old workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: 0
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 0
delete_workflow_pattern:
description: 'The name of the workflow. if not set then it will target all workflows.'
required: false

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
2 changes: 1 addition & 1 deletion CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ compression-level = 9 # module zip compression level
remove-rv-integrations-checks = true # remove checks from the revanced integrations

patches-source = "revanced/revanced-patches" # where to fetch patches bundle from. default: "revanced/revanced-patches"
cli-source = "j-hc/revanced-cli" # where to fetch cli from. default: "j-hc/revanced-cli"
cli-source = "E85Addict/revanced-cli" # where to fetch cli from. default: "E85Addict/revanced-cli"
# options like cli-source can also set per app
rv-brand = "ReVanced Extended" # rebrand from 'ReVanced' to something different. default: "ReVanced"

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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)
[![Build Modules](https://github.com/E85Addict/revanced-magisk-module/actions/workflows/build.yml/badge.svg)](https://github.com/E85Addict/revanced-magisk-module/actions/workflows/build.yml)
[![CI](https://github.com/E85Addict/revanced-magisk-module/actions/workflows/ci.yml/badge.svg?event=schedule)](https://github.com/E85Addict/revanced-magisk-module/actions/workflows/ci.yml)

Extensive ReVanced builder

Get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/releases).
Get the [latest CI release](https://github.com/E85Addict/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.

Expand All @@ -29,7 +29,7 @@ Note that the <a href="../../actions/workflows/ci.yml">CI workflow</a> is schedu
## 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)
* Use the repo as a [template](https://github.com/new?template_name=revanced-magisk-module&template_owner=E85Addict)
* 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)
Expand All @@ -39,12 +39,12 @@ also see here [`CONFIG.md`](./CONFIG.md)
## Building Locally
### On Termux
```console
bash <(curl -sSf https://raw.githubusercontent.com/j-hc/revanced-magisk-module/main/build-termux.sh)
bash <(curl -sSf https://raw.githubusercontent.com/E85Addict/revanced-magisk-module/main/build-termux.sh)
```

### On Desktop
```console
$ git clone https://github.com/j-hc/revanced-magisk-module
$ git clone https://github.com/E85Addict/revanced-magisk-module
$ cd revanced-magisk-module
$ ./build.sh
```
4 changes: 2 additions & 2 deletions build-termux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ if [ -d revanced-magisk-module ] || [ -f config.toml ]; then
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
git clone https://github.com/E85Addict/revanced-magisk-module --recurse --depth 1
mv -f config.toml revanced-magisk-module/config.toml
cd revanced-magisk-module
fi
else
pr "Cloning revanced-magisk-module."
git clone https://github.com/j-hc/revanced-magisk-module --depth 1
git clone https://github.com/E85Addict/revanced-magisk-module --depth 1
cd revanced-magisk-module
sed -i '/^enabled.*/d; /^\[.*\]/a enabled = false' config.toml
grep -q 'revanced-magisk-module' ~/.gitconfig 2>/dev/null ||
Expand Down
24 changes: 18 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ if ! PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs); then
if [ "$OS" = Android ]; then PARALLEL_JOBS=1; else PARALLEL_JOBS=$(nproc); fi
fi
REMOVE_RV_INTEGRATIONS_CHECKS=$(toml_get "$main_config_t" remove-rv-integrations-checks) || REMOVE_RV_INTEGRATIONS_CHECKS="true"
LOGGING_F=$(toml_get "$main_config_t" logging-to-file) && vtf "$LOGGING_F" "logging-to-file" || LOGGING_F=false
DEF_PATCHES_VER=$(toml_get "$main_config_t" patches-version) || DEF_PATCHES_VER="latest"
DEF_CLI_VER=$(toml_get "$main_config_t" cli-version) || DEF_CLI_VER="latest"
DEF_PATCHES_SRC=$(toml_get "$main_config_t" patches-source) || DEF_PATCHES_SRC="ReVanced/revanced-patches"
DEF_CLI_SRC=$(toml_get "$main_config_t" cli-source) || DEF_CLI_SRC="j-hc/revanced-cli"
DEF_CLI_SRC=$(toml_get "$main_config_t" cli-source) || DEF_CLI_SRC="E85Addict/revanced-cli"
DEF_RV_BRAND=$(toml_get "$main_config_t" rv-brand) || DEF_RV_BRAND="ReVanced"
mkdir -p "$TEMP_DIR" "$BUILD_DIR"

Expand All @@ -41,6 +42,7 @@ if [ "$ENABLE_MAGISK_UPDATE" = true ] && [ -z "${GITHUB_REPOSITORY-}" ]; then
ENABLE_MAGISK_UPDATE=false
fi
if ((COMPRESSION_LEVEL > 9)) || ((COMPRESSION_LEVEL < 0)); then abort "compression-level must be within 0-9"; fi
if [ "$LOGGING_F" = true ]; then mkdir -p logs; fi

jq --version >/dev/null || abort "\`jq\` is not installed. install it with 'apt install jq' or equivalent"
java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it with 'apt install openjdk-17-jre' or equivalent"
Expand All @@ -57,6 +59,16 @@ gh_dl "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/j-hc/cmpr/releas
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"

build_rv_w() {
if [ "$LOGGING_F" = true ]; then
logf=logs/"${table_name,,}.log"
: >"$logf"
{ build_rv 2>&1 "$(declare -p app_args)" | tee "$logf"; } &
else
build_rv "$(declare -p app_args)" &
fi
}

declare -A cliriplib
idx=0
for table_name in $(toml_get_table_names); do
Expand Down Expand Up @@ -133,7 +145,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}-E85"
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 All @@ -146,7 +158,7 @@ for table_name in $(toml_get_table_names); do
app_args[arch]="arm64-v8a"
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
idx=$((idx + 1))
build_rv "$(declare -p app_args)" &
build_rv_w
app_args[table]="$table_name (arm-v7a)"
app_args[arch]="arm-v7a"
app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
Expand All @@ -155,10 +167,10 @@ for table_name in $(toml_get_table_names); do
idx=$((idx - 1))
fi
idx=$((idx + 1))
build_rv "$(declare -p app_args)" &
build_rv_w
else
idx=$((idx + 1))
build_rv "$(declare -p app_args)" &
build_rv_w
fi
done
wait
Expand All @@ -167,7 +179,7 @@ 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 "\n[revanced-magisk-module](https://github.com/E85Addict/revanced-magisk-module)\n"
log "$(cat "$TEMP_DIR"/*-rv/changelog.md)"

SKIPPED=$(cat "$TEMP_DIR"/skipped 2>/dev/null || :)
Expand Down
66 changes: 59 additions & 7 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app
logging-to-file = true # enables logging of every patch process to a seperate file
enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app
parallel-jobs = 1

# add 'enabled = false' for not patching a specific app or remove it from the config
# see https://github.com/j-hc/revanced-magisk-module/blob/main/CONFIG.md for more detailed explanations
# see https://github.com/E85Addict/revanced-magisk-module/blob/main/CONFIG.md for more detailed explanations

# you can use rvmm-config-gen to generate a config

[YouTube]
enabled = true
build-mode = "both"
module-prop-name = "youtube-E85"
patches-source = "E85Addict/revanced-patches"
excluded-patches = ""
included-patches = ""
patcher-args = "-e 'Change header' -Oheader='premium*header'"
version = "auto"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
uptodown-dlurl = "https://youtube.en.uptodown.com/android"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.youtube"

[Music]
enabled = true
build-mode = "both"
arch = "both"
module-prop-name = "music-E85"
arch = "arm64-v8a"
patches-source = "E85Addict/revanced-patches"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube-music"
uptodown-dlurl = "https://youtube-music.en.uptodown.com/android"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.apps.youtube.music"

[GooglePhotos]
enabled = false
build-mode = "both"
arch = "both"
version = "auto"
Expand All @@ -31,23 +40,29 @@ uptodown-dlurl = "https://google-photos.en.uptodown.com/android"

# dont build on gh actions (https://github.com/j-hc/revanced-magisk-module/issues/554)
[Music-Extended]
enabled = false
enabled = true
app-name = "Music"
patches-source = "inotia00/revanced-patches"
cli-source = "inotia00/revanced-cli"
rv-brand = "ReVanced Extended"
build-mode = "both"
arch = "both"
module-prop-name = "music-E85"
arch = "arm64-v8a"
included-patches = "'Custom header for YouTube Music'"
patcher-args = "--legacy-options options.json"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube-music"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.apps.youtube.music"

[YouTube-Extended]
enabled = false
enabled = true
app-name = "YouTube"
patches-source = "inotia00/revanced-patches"
cli-source = "inotia00/revanced-cli"
rv-brand = "ReVanced Extended"
build-mode = "both"
module-prop-name = "youtube-E85"
included-patches = "'Custom header for YouTube'"
patcher-args = "--legacy-options options.json"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.youtube"

Expand All @@ -65,7 +80,10 @@ dpi = "120-640dpi"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.twitter.android"

[TikTok]
enabled = false
enabled = true
build-mode = "both"
apkmirror-dlurl = "https://www.apkmirror.com/apk/tiktok-pte-ltd/tik-tok-including-musical-ly/"
uptodown-dlurl = "https://tiktok.en.uptodown.com/android"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.zhiliaoapp.musically"
included-patches = "'SIM spoof'"

Expand All @@ -81,3 +99,37 @@ uptodown-dlurl = "https://spotify.en.uptodown.com/android"
[IconPackStudio]
enabled = false
apkmirror-dlurl = "https://www.apkmirror.com/apk/smart-launcher-team/icon-pack-studio/"

[YouTube-Custom]
enabled = true
exclusive-patches = true
module-prop-name = "youtube-E85"
build-mode = "module"
patches-source = "E85Addict/revanced-patches"
included-patches = """\
'Custom branding' 'Disable precise seeking gesture' 'Remove background playback restrictions' \
'Seekbar tapping' 'Video ads' 'Hide ads' 'Enable tablet layout' 'Restore old video quality menu' 'Seekbar thumbnails' \
'Return YouTube Dislike' 'Miniplayer' 'Theme' 'SponsorBlock' \
"""
patcher-args = "-e 'Change header' -Oheader='premium*header'"
version = "auto"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
uptodown-dlurl = "https://youtube.en.uptodown.com/android"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.youtube"

[Telegram]
enabled = true
build-mode = "both"
patches-source = "Aunali321/ReVancedExperiments"
uptodown-dlurl = "https://telegram.en.uptodown.com/android"
apkmirror-dlurl = "https://www.apkmirror.com/apk/telegram-fz-llc/telegram/"
version = "auto"

[Instagram]
enabled = true
build-mode = "both"
patches-source = "Aunali321/ReVancedExperiments"
uptodown-dlurl = "https://instagram.en.uptodown.com/android"
#apkmirror-dlurl = "https://www.apkmirror.com/apk/instagram/instagram-instagram/"
version = "auto"
arch = "arm64-v8a"
Binary file modified ks.keystore
Binary file not shown.
Loading

0 comments on commit e47f177

Please sign in to comment.