Skip to content

Commit f72048a

Browse files
committed
Initial commit
0 parents  commit f72048a

31 files changed

+2213
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Bug report
3+
about: Bug report
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**DO NOT REPORT REVANCED STUFF IN THIS REPO**
11+
if you delete these lines and proceed to report revanced stuff like **patch bugs** or **patch requests**, you will be **blocked** from this repo
12+
13+
Use issues only to report bugs of the rvmm builder or the modules

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/workflows/build.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Build Modules
2+
on:
3+
workflow_call:
4+
inputs:
5+
from_ci:
6+
type: boolean
7+
required: false
8+
default: true
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
run:
14+
permissions: write-all
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/setup-java@v4
18+
with:
19+
distribution: "zulu"
20+
java-version: "17"
21+
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
submodules: true
27+
28+
- name: Set execute permissions for required scripts
29+
run: |
30+
chmod +x ./build.sh
31+
chmod +x bin/toml/tq-x86_64
32+
33+
- name: Update config
34+
if: ${{ inputs.from_ci }}
35+
run: |
36+
if git checkout origin/update build.md; then
37+
UPDATE_CFG=$(./build.sh config.toml --config-update)
38+
if [ "$UPDATE_CFG" ]; then
39+
echo "$UPDATE_CFG" > config.json
40+
fi
41+
fi
42+
43+
- name: Get next version code
44+
id: next_ver_code
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
TAG=$(gh release list -L 1 | awk -F '\t' '{print $3}')
49+
if [ -z "$TAG" ]; then TAG=0; fi
50+
echo "NEXT_VER_CODE=$((TAG + 1))" >> $GITHUB_OUTPUT
51+
52+
- name: Build modules/APKs
53+
run: if [ -f "config.json" ]; then ./build.sh config.json; else ./build.sh config.toml; fi
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
GITHUB_REPOSITORY: $GITHUB_REPOSITORY
57+
NEXT_VER_CODE: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}
58+
59+
- name: Get output
60+
id: get_output
61+
run: |
62+
DELIM="$(openssl rand -hex 8)"
63+
echo "BUILD_LOG<<${DELIM}" >> "$GITHUB_OUTPUT"
64+
cat build.md >> "$GITHUB_OUTPUT"
65+
echo "${DELIM}" >> "$GITHUB_OUTPUT"
66+
cp -f build.md build.tmp
67+
68+
- name: Extract version number
69+
id: extract_version
70+
run: |
71+
# Extract version from the file name
72+
VERSION=$(ls ./build/youtube-revanced-v*-arm-v7a.apk | head -n 1 | sed -n 's/.*youtube-revanced-v\([0-9.]*\)-arm.*/\1/p')
73+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
74+
75+
- name: Upload modules to release
76+
uses: svenstaro/upload-release-action@v2
77+
with:
78+
body: ${{ steps.get_output.outputs.BUILD_LOG }}
79+
repo_token: ${{ secrets.GITHUB_TOKEN }}
80+
file: ./build/*
81+
release_name: Build ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | v${{ steps.extract_version.outputs.VERSION }}
82+
tag: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}
83+
file_glob: true
84+
overwrite: true
85+
86+
- name: Update changelog and Magisk update json
87+
id: update_config
88+
run: |
89+
git checkout -f update || git switch --discard-changes --orphan update
90+
cp -f build.tmp build.md
91+
get_update_json() {
92+
echo "{
93+
\"version\": \"$1\",
94+
\"versionCode\": ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }},
95+
\"zipUrl\": \"$2\",
96+
\"changelog\": \"https://raw.githubusercontent.com/$GITHUB_REPOSITORY/update/build.md\"
97+
}"
98+
}
99+
100+
cd build || { echo "build folder not found"; exit 1; }
101+
for OUTPUT in *magisk*.zip; do
102+
[ "$OUTPUT" = "*magisk*.zip" ] && continue
103+
ZIP_S=$(unzip -p "$OUTPUT" module.prop)
104+
if ! UPDATE_JSON=$(echo "$ZIP_S" | grep updateJson); then continue; fi
105+
UPDATE_JSON="${UPDATE_JSON##*/}"
106+
VER=$(echo "$ZIP_S" | grep version=)
107+
VER="${VER##*=}"
108+
DLURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
109+
get_update_json "$VER" "$DLURL" >"../$UPDATE_JSON"
110+
done
111+
cd ..
112+
113+
find . -name "*-update.json" | grep . || : >dummy-update.json
114+
115+
- uses: stefanzweifel/git-auto-commit-action@v5
116+
with:
117+
branch: update
118+
skip_checkout: true
119+
file_pattern: build.md *-update.json
120+
commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}
121+
122+
- name: Report to Telegram
123+
env:
124+
TG_TOKEN: ${{ secrets.TG_TOKEN }}
125+
if: env.TG_TOKEN != null
126+
run: |
127+
cd build || { echo "build folder not found"; exit 1; }
128+
129+
TG_CHAT="@rvc_magisk"
130+
NL=$'\n'
131+
APKS=""
132+
MODULES=""
133+
for OUTPUT in *; do
134+
DL_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
135+
if [[ $OUTPUT = *.apk ]]; then
136+
APKS+="${NL}📦[${OUTPUT}](${DL_URL})"
137+
elif [[ $OUTPUT = *.zip ]]; then
138+
MODULES+="${NL}📦[${OUTPUT}](${DL_URL})"
139+
fi
140+
done
141+
MODULES=${MODULES#"$NL"}
142+
APKS=${APKS#"$NL"}
143+
144+
BODY="$(sed 's/^\* \*\*/↪ \*\*/g; s/^\* `/↪ \*\*/g; s/`/\*/g; s/^\* /\↪/g; s/\*\*/\*/g; s/###//g; s/^- /↪ /g; /^==/d;' ../build.md)"
145+
MSG="*New build!*
146+
147+
${BODY}
148+
149+
*▼ Download Links:*
150+
Modules:
151+
${MODULES}
152+
153+
APKs:
154+
${APKS}
155+
"
156+
echo "'$MSG'"
157+
MSG=${MSG:0:9450}
158+
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
159+
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"

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "0 16 * * *"
6+
7+
jobs:
8+
check:
9+
permissions: write-all
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set execute permissions for required scripts
18+
run: |
19+
chmod +x ./build.sh
20+
chmod +x bin/toml/tq-x86_64
21+
22+
- name: Should build?
23+
id: should_build
24+
shell: bash
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
if ! git checkout origin/update build.md; then
29+
echo "first time building!"
30+
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT
31+
else
32+
UPDATE_CFG=$(./build.sh config.toml --config-update)
33+
if [ "$UPDATE_CFG" ]; then
34+
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT
35+
else
36+
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT
37+
fi
38+
fi
39+
40+
- name: Clear older runs
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || :
45+
46+
outputs:
47+
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }}
48+
49+
build:
50+
permissions: write-all
51+
needs: check
52+
uses: ./.github/workflows/build.yml
53+
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }}
54+
secrets: inherit

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.apk
2+
*.zip
3+
/temp
4+
/build
5+
test*
6+
/logs
7+
build.md
8+
cmpr

CONFIG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Config
2+
3+
Adding another revanced app is as easy as this:
4+
```toml
5+
[Some-App]
6+
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app"
7+
# or uptodown-dlurl = "https://app.en.uptodown.com/android"
8+
```
9+
10+
## More about other options:
11+
12+
There exists an example below with all defaults shown and all the keys explicitly set.
13+
**All keys are optional** (except download urls) and are assigned to their default values if not set explicitly.
14+
15+
```toml
16+
parallel-jobs = 1 # amount of cores to use for parallel patching, if not set $(nproc) is used
17+
compression-level = 9 # module zip compression level
18+
remove-rv-integrations-checks = true # remove checks from the revanced integrations
19+
20+
patches-source = "revanced/revanced-patches" # where to fetch patches bundle from. default: "revanced/revanced-patches"
21+
cli-source = "j-hc/revanced-cli" # where to fetch cli from. default: "j-hc/revanced-cli"
22+
# options like cli-source can also set per app
23+
rv-brand = "ReVanced Extended" # rebrand from 'ReVanced' to something different. default: "ReVanced"
24+
25+
patches-version = "v2.160.0" # 'latest', 'dev', or a version number. default: "latest"
26+
cli-version = "v5.0.0" # 'latest', 'dev', or a version number. default: "latest"
27+
28+
[Some-App]
29+
app-name = "SomeApp" # if set, release name becomes SomeApp instead of Some-App. default is same as table name, which is 'Some-App' here.
30+
enabled = true # whether to build the app. default: true
31+
version = "auto" # 'auto', 'latest', 'beta' or a version number (e.g. '17.40.41'). default: auto
32+
build-mode = "apk" # 'both', 'apk' or 'module'. default: apk
33+
34+
# optional args to be passed to cli. can be used to set patch options
35+
# multiline strings in the config is supported
36+
patcher-args = """\
37+
-OdarkThemeBackgroundColor=#FF0F0F0F \
38+
-Oanother-option=value \
39+
"""
40+
41+
# 'auto' option gets the latest possible version supported by all the included patches
42+
# 'latest' gets the latest stable without checking patches support. 'beta' gets the latest beta/alpha
43+
# whitespace seperated list of patches to exclude. default: ""
44+
excluded-patches = """\
45+
'Some Patch' \
46+
'Some Other Patch' \
47+
"""
48+
49+
included-patches = "'Some Patch'" # whitespace seperated list of non-default patches to include. default: ""
50+
include-stock = true # includes stock apk in the module. default: true
51+
exclusive-patches = false # exclude all patches by default. default: false
52+
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app"
53+
uptodown-dlurl = "https://spotify.en.uptodown.com/android"
54+
module-prop-name = "some-app-magisk" # magisk module prop name.
55+
apkmirror-dpi = "360-480dpi" # used to select apk variant from apkmirror. default: nodpi
56+
arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a', 'all', 'both'. 'both' downloads both arm64-v8a and arm-v7a. default: all
57+
riplib = true # enables ripping x86 and x86_64 libs from apks with j-hc revanced cli. default: true
58+
59+
```

0 commit comments

Comments
 (0)