Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app"

## More about other options:

<<<<<<< HEAD
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.
=======
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.
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321

```toml
parallel-jobs = 1 # amount of cores to use for parallel patching, if not set $(nproc) is used
Expand Down
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,28 @@ wait
rm -rf temp/tmp.*
if [ -z "$(ls -A1 "${BUILD_DIR}")" ]; then abort "All builds failed."; fi

<<<<<<< HEAD
# Initial changelog logic
# 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 "$(cat "$TEMP_DIR"/*/changelog.md)"

log "\n$(cat "$TEMP_DIR"/*/changelog.md)"
=======
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 "$(cat "$TEMP_DIR"/*/changelog.md)"
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321

SKIPPED=$(cat "$TEMP_DIR"/skipped 2>/dev/null || :)
if [ -n "$SKIPPED" ]; then
log "\nSkipped:"
log "$SKIPPED"
fi

<<<<<<< HEAD
# New skipped changelog logic with links

# SKIPPED=$(cat "$TEMP_DIR"/skipped 2>/dev/null || :)
Expand All @@ -196,4 +204,6 @@ fi
# log "$(cat "$TEMP_DIR"/*-rv/changelog.md)"
# fi

=======
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
pr "Done"
78 changes: 78 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parallel-jobs = 1

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

<<<<<<< HEAD
patches-source = "anddea/revanced-patches"
integrations-source = "anddea/revanced-integrations"
cli-source = "inotia00/revanced-cli"
Expand Down Expand Up @@ -37,3 +38,80 @@ archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.a
excluded-patches = "'Custom header for YouTube Music'"
included-patches = "'Visual preferences icons for YouTube Music' 'Return YouTube Username' 'Disable music video in album'"
patcher-args = "-e 'Custom branding name for YouTube Music' -OappName='YT Music RVX' -e 'Custom branding icon for YouTube Music' -OappIcon='vanced_black'"
=======
[YouTube]
build-mode = "both"
excluded-patches = ""
included-patches = ""
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]
build-mode = "both"
arch = "both"
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]
build-mode = "both"
arch = "both"
version = "auto"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/photos/"
uptodown-dlurl = "https://google-photos.en.uptodown.com/android"
archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.apps.photos"

[Spotify]
enabled = false
uptodown-dlurl = "https://spotify.en.uptodown.com/android"
archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.spotify.music"

# https://github.com/j-hc/revanced-magisk-module/issues/554
[Music-Extended]
enabled = false
app-name = "Music"
patches-source = "inotia00/revanced-patches"
cli-source = "inotia00/revanced-cli"
rv-brand = "ReVanced Extended"
build-mode = "both"
arch = "both"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube-music"

[YouTube-Extended]
enabled = false
app-name = "YouTube"
patches-source = "inotia00/revanced-patches"
cli-source = "inotia00/revanced-cli"
rv-brand = "ReVanced Extended"
build-mode = "both"
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"

[Twitch]
enabled = false
apkmirror-dlurl = "https://www.apkmirror.com/apk/twitch-interactive-inc/twitch/"
uptodown-dlurl = "https://twitch.en.uptodown.com/android"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/tv.twitch.android.app"

[Twitter]
enabled = false
apkmirror-dlurl = "https://www.apkmirror.com/apk/x-corp/twitter"
build-mode = "apk"
dpi = "120-640dpi"
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.twitter.android"

[TikTok]
enabled = false
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.zhiliaoapp.musically"
included-patches = "'SIM spoof'"

[Messenger]
enabled = false
apkmirror-dlurl = "https://www.apkmirror.com/apk/facebook-2/messenger/"
arch = "arm64-v8a"

[IconPackStudio]
enabled = false
apkmirror-dlurl = "https://www.apkmirror.com/apk/smart-launcher-team/icon-pack-studio/"
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
10 changes: 10 additions & 0 deletions revanced-magisk/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,20 @@ if ! op=$(mm mount -o bind "$RVPATH" "$BASEPATH/base.apk" 2>&1); then
fi
am force-stop "$PKG_NAME"
ui_print "* Optimizing $PKG_NAME"
<<<<<<< HEAD
nohup cmd package compile --reset "$PKG_NAME" >/dev/null 2>&1 &
=======

cmd package compile -m speed-profile -f "$PKG_NAME"
# nohup cmd package compile -m speed-profile -f "$PKG_NAME" >/dev/null 2>&1
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321

rm -rf "${MODPATH:?}/bin" "$MODPATH/$PKG_NAME.apk"

ui_print "* Done"
<<<<<<< HEAD
ui_print " by ev3rlin (https://github.com/ev3rlin)"
=======
ui_print " by j-hc (github.com/j-hc)"
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
ui_print " "
49 changes: 49 additions & 0 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ get_prebuilts() {
local cl_dir=${patches_src%/*}
cl_dir=${TEMP_DIR}/${cl_dir,,}-rv
[ -d "$cl_dir" ] || mkdir "$cl_dir"
<<<<<<< HEAD
=======

>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
for src_ver in "$cli_src CLI $cli_ver revanced-cli" "$patches_src Patches $patches_ver patches"; do
set -- $src_ver
local src=$1 tag=$2 ver=${3-} fprefix=$4
local ext
<<<<<<< HEAD
=======

>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
if [ "$tag" = "CLI" ]; then
ext="jar"
local grab_cl=false
Expand Down Expand Up @@ -97,7 +105,11 @@ get_prebuilts() {
name=$(jq -r .name <<<"$asset")
file="${dir}/${name}"
gh_dl "$file" "$url" >&2 || return 1
<<<<<<< HEAD
echo "$tag: $(cut -d/ -f1 <<<"$src")/${name} " >>"${cl_dir}/changelog.md"
=======
echo "$tag: $(cut -d/ -f1 <<<"$src")/${name}  " >>"${cl_dir}/changelog.md"
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
else
grab_cl=false
local for_err=$file
Expand All @@ -114,6 +126,7 @@ get_prebuilts() {
PATCH_EXT=$(java -jar "$file" -h | grep -oP -m1 '\w+(?= files)' | tr '[:upper:]' '[:lower:]')
if [ -z "$PATCH_EXT" ]; then abort "Unable to detect patch extension from CLI help output."; fi
elif [ "$tag" = "Patches" ]; then
<<<<<<< HEAD
# Initial changelog structure
if [ $grab_cl = true ]; then echo -e "[Changelog](https://github.com/${src}/releases/tag/${tag_name})\n" >>"${cl_dir}/changelog.md"; fi

Expand All @@ -123,6 +136,9 @@ get_prebuilts() {
# echo -e "$changelog_body\n" >>"${cl_dir}/changelog.md"
# fi

=======
if [ $grab_cl = true ]; then echo -e "[Changelog](https://github.com/${src}/releases/tag/${tag_name})\n" >>"${cl_dir}/changelog.md"; fi
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
if [ "$REMOVE_RV_INTEGRATIONS_CHECKS" = true ]; then
# Dynamically calculate inner extension (rvp->rve, mpp->mpe)
local inner_ext="${ext%p}e"
Expand Down Expand Up @@ -155,6 +171,7 @@ set_prebuilts() {
TOML="${BIN_DIR}/toml/tq-${arch}"
}

<<<<<<< HEAD
get_latest_app_version() {
local src=$1 app=$2
local ver_file="patches/src/main/kotlin/app/revanced/patches/${app}/utils/compatibility/Constants.kt"
Expand Down Expand Up @@ -202,6 +219,8 @@ auto_update_app_versions() {
[ "$updated" = true ]
}

=======
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
config_update() {
if [ ! -f build.md ]; then abort "build.md not available"; fi
declare -A sources
Expand Down Expand Up @@ -321,7 +340,11 @@ get_patch_last_supported_ver() {
pcount=$(head -1 <<<"$op") pcount=${pcount#*(} pcount=${pcount% *}
if [ -z "$pcount" ]; then
av_apps=$(java -jar "$cli_jar" list-versions "$patches_jar" 2>&1 | awk '/Package name:/ { printf "%s\x27%s\x27", sep, $NF; sep=", " } END { print "" }')
<<<<<<< HEAD
abort "No patch versions found for '$pkg_name' in this patches source!\nAvailable applications found: $av_apps";
=======
abort "No patch versions found for '$pkg_name' in this patches source!\nAvailable applications found: $av_apps"
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
fi
grep -F "($pcount patch" <<<"$op" | sed 's/ (.* patch.*//' | get_highest_ver || return 1
}
Expand Down Expand Up @@ -512,13 +535,19 @@ get_archive_pkg_name() { echo "$__ARCHIVE_PKG_NAME__"; }

patch_apk() {
local stock_input=$1 patched_apk=$2 patcher_args=$3 cli_jar=$4 patches_jar=$5
<<<<<<< HEAD

# TODO
# Probably add \" \" to both $stock_input and $patched_apk if braces in rv-brand are an issue

local cmd="env -u GITHUB_REPOSITORY java -jar $cli_jar patch $stock_input --purge -o $patched_apk -p $patches_jar --keystore=ks.keystore \
--keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --keystore-entry-alias=jhc $patcher_args"
if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary=${AAPT2}"; fi
=======
local cmd="env -u GITHUB_REPOSITORY java -jar '$cli_jar' patch '$stock_input' --purge -o '$patched_apk' -p '$patches_jar' --keystore=ks.keystore \
--keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --keystore-entry-alias=jhc $patcher_args"
if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary='${AAPT2}'"; fi
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
pr "$cmd"
if eval "$cmd"; then [ -f "$patched_apk" ]; else
rm "$patched_apk" 2>/dev/null || :
Expand Down Expand Up @@ -633,10 +662,17 @@ build_rv() {
p_patcher_args=("${p_patcher_args[@]//-[ei] ${microg_patch}/}")
fi

<<<<<<< HEAD
local spoof_client_patch
spoof_client_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "Spoof Client" || :) spoof_client_patch=${spoof_client_patch#*: }
local spoof_video_patch
spoof_video_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "Spoof Video" || :) spoof_video_patch=${spoof_video_patch#*: }
=======
# local spoof_client_patch
# spoof_client_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "Spoof Client" || :) spoof_client_patch=${spoof_client_patch#*: }
# local spoof_video_patch
# spoof_video_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "Spoof Video" || :) spoof_video_patch=${spoof_video_patch#*: }
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321

local patcher_args patched_apk build_mode
local rv_brand_f=${args[rv_brand],,}
Expand All @@ -657,12 +693,21 @@ build_rv() {
patcher_args+=("-d \"${microg_patch}\"")
fi
fi
<<<<<<< HEAD
if [ -n "$spoof_client_patch" ] && [[ ! ${p_patcher_args[*]} =~ $spoof_client_patch ]] && [ "$build_mode" = module ]; then
patcher_args+=("-d \"${spoof_client_patch}\"")
fi
if [ -n "$spoof_video_patch" ] && [[ ! ${p_patcher_args[*]} =~ $spoof_video_patch ]] && [ "$build_mode" = module ]; then
patcher_args+=("-d \"${spoof_video_patch}\"")
fi
=======
# if [ -n "$spoof_client_patch" ] && [[ ! ${p_patcher_args[*]} =~ $spoof_client_patch ]] && [ "$build_mode" = module ]; then
# patcher_args+=("-d \"${spoof_client_patch}\"")
# fi
# if [ -n "$spoof_video_patch" ] && [[ ! ${p_patcher_args[*]} =~ $spoof_video_patch ]] && [ "$build_mode" = module ]; then
# patcher_args+=("-d \"${spoof_video_patch}\"")
# fi
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
if [ "${args[riplib]}" = true ]; then
patcher_args+=("--rip-lib x86_64 --rip-lib x86")
if [ "$build_mode" = module ]; then
Expand Down Expand Up @@ -733,7 +778,11 @@ module_prop() {
name=${2}
version=v${3}
versionCode=${NEXT_VER_CODE}
<<<<<<< HEAD
author=ev3rlin
=======
author=j-hc
>>>>>>> eb326615a7bd40e995f993d50d41dff03ee2d321
description=${4}" >"${6}/module.prop"

if [ "$ENABLE_MAGISK_UPDATE" = true ]; then echo "updateJson=${5}" >>"${6}/module.prop"; fi
Expand Down