generated from j-hc/revanced-magisk-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca4fe4f
Showing
30 changed files
with
2,236 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: Bug report | ||
about: Bug report | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**DO NOT REPORT REVANCED STUFF IN THIS REPO** | ||
if you delete these lines and proceed to report revanced stuff like **patch bugs** or **patch requests**, you will be **blocked** from this repo | ||
|
||
Use issues only to report bugs of the rvmm builder or the modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
name: Build Modules | ||
on: | ||
workflow_call: | ||
inputs: | ||
from_ci: | ||
type: boolean | ||
required: false | ||
default: true | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Update config | ||
if: ${{ inputs.from_ci }} | ||
run: | | ||
if git checkout origin/update build.md; then | ||
UPDATE_CFG=$(./build.sh config.toml --config-update) | ||
if [ "$UPDATE_CFG" ]; then | ||
echo "$UPDATE_CFG" > config.json | ||
fi | ||
fi | ||
- name: Get next version code | ||
id: next_ver_code | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
TAG=$(gh release list -L 1 | awk -F '\t' '{print $3}') | ||
if [ -z "$TAG" ]; then TAG=0; fi | ||
echo "NEXT_VER_CODE=$((TAG + 1))" >> $GITHUB_OUTPUT | ||
- name: Build modules/APKs | ||
run: if [ -f "config.json" ]; then ./build.sh config.json; else ./build.sh config.toml; fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: $GITHUB_REPOSITORY | ||
NEXT_VER_CODE: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | ||
|
||
- name: Get output | ||
id: get_output | ||
run: | | ||
DELIM="$(openssl rand -hex 8)" | ||
echo "BUILD_LOG<<${DELIM}" >> "$GITHUB_OUTPUT" | ||
cat build.md >> "$GITHUB_OUTPUT" | ||
echo "${DELIM}" >> "$GITHUB_OUTPUT" | ||
cp -f build.md build.tmp | ||
- name: Upload modules to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
body: ${{ steps.get_output.outputs.BUILD_LOG }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./build/* | ||
release_name: ReVanced | ||
tag: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | ||
file_glob: true | ||
overwrite: true | ||
|
||
- name: Update changelog and Magisk update json | ||
id: update_config | ||
run: | | ||
git checkout -f update || git switch --discard-changes --orphan update | ||
cp -f build.tmp build.md | ||
get_update_json() { | ||
echo "{ | ||
\"version\": \"$1\", | ||
\"versionCode\": ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}, | ||
\"zipUrl\": \"$2\", | ||
\"changelog\": \"https://raw.githubusercontent.com/$GITHUB_REPOSITORY/update/build.md\" | ||
}" | ||
} | ||
cd build || { echo "build folder not found"; exit 1; } | ||
for OUTPUT in *magisk*.zip; do | ||
[ "$OUTPUT" = "*magisk*.zip" ] && continue | ||
ZIP_S=$(unzip -p "$OUTPUT" module.prop) | ||
if ! UPDATE_JSON=$(echo "$ZIP_S" | grep updateJson); then continue; fi | ||
UPDATE_JSON="${UPDATE_JSON##*/}" | ||
VER=$(echo "$ZIP_S" | grep version=) | ||
VER="${VER##*=}" | ||
DLURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}" | ||
get_update_json "$VER" "$DLURL" >"../$UPDATE_JSON" | ||
done | ||
cd .. | ||
find . -name "*-update.json" | grep . || : >dummy-update.json | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
branch: update | ||
skip_checkout: true | ||
file_pattern: build.md *-update.json | ||
commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | ||
|
||
- 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" | ||
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})" | ||
elif [[ $OUTPUT = *.zip ]]; then | ||
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!* | ||
${BODY} | ||
*▼ Download Links:* | ||
Modules: | ||
${MODULES} | ||
APKs: | ||
${APKS} | ||
" | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 16 * * *" | ||
|
||
jobs: | ||
check: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Should build? | ||
id: should_build | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if ! git checkout origin/update build.md; then | ||
echo "first time building!" | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
else | ||
UPDATE_CFG=$(./build.sh config.toml --config-update) | ||
if [ "$UPDATE_CFG" ]; then | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
else | ||
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
- name: Clear older runs | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || : | ||
outputs: | ||
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }} | ||
|
||
build: | ||
permissions: write-all | ||
needs: check | ||
uses: ./.github/workflows/build.yml | ||
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.apk | ||
*.zip | ||
/temp | ||
/build | ||
test* | ||
/logs | ||
build.md | ||
cmpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Config | ||
|
||
Adding another revanced app is as easy as this: | ||
```toml | ||
[Some-App] | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" | ||
# or uptodown-dlurl = "https://app.en.uptodown.com/android" | ||
``` | ||
|
||
## More about other options: | ||
|
||
There exists an example below with all defaults shown and all the keys explicitly set. | ||
**All keys are optional** (except download urls) and are assigned to their default values if not set explicitly. | ||
|
||
```toml | ||
parallel-jobs = 1 # amount of cores to use for parallel patching, if not set $(nproc) is used | ||
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" | ||
# options like cli-source can also set per app | ||
rv-brand = "ReVanced Extended" # rebrand from 'ReVanced' to something different. default: "ReVanced" | ||
|
||
patches-version = "v2.160.0" # 'latest', 'dev', or a version number. default: "latest" | ||
cli-version = "v5.0.0" # 'latest', 'dev', or a version number. default: "latest" | ||
|
||
[Some-App] | ||
app-name = "SomeApp" # if set, release name becomes SomeApp instead of Some-App. default is same as table name, which is 'Some-App' here. | ||
enabled = true # whether to build the app. default: true | ||
version = "auto" # 'auto', 'latest', 'beta' or a version number (e.g. '17.40.41'). default: auto | ||
build-mode = "apk" # 'both', 'apk' or 'module'. default: apk | ||
|
||
# optional args to be passed to cli. can be used to set patch options | ||
# multiline strings in the config is supported | ||
patcher-args = """\ | ||
-OdarkThemeBackgroundColor=#FF0F0F0F \ | ||
-Oanother-option=value \ | ||
""" | ||
|
||
# 'auto' option gets the latest possible version supported by all the included patches | ||
# 'latest' gets the latest stable without checking patches support. 'beta' gets the latest beta/alpha | ||
# whitespace seperated list of patches to exclude. default: "" | ||
excluded-patches = """\ | ||
'Some Patch' \ | ||
'Some Other Patch' \ | ||
""" | ||
|
||
included-patches = "'Some Patch'" # whitespace seperated list of non-default patches to include. default: "" | ||
include-stock = true # includes stock apk in the module. default: true | ||
exclusive-patches = false # exclude all patches by default. default: false | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" | ||
uptodown-dlurl = "https://spotify.en.uptodown.com/android" | ||
module-prop-name = "some-app-magisk" # magisk module prop name. | ||
apkmirror-dpi = "360-480dpi" # used to select apk variant from apkmirror. default: nodpi | ||
arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a', 'all', 'both'. 'both' downloads both arm64-v8a and arm-v7a. default: all | ||
riplib = true # enables ripping x86 and x86_64 libs from apks with j-hc revanced cli. default: true | ||
|
||
``` |
Oops, something went wrong.