From 09baf0ab390f225110dfa5328ea86b3ca642faef Mon Sep 17 00:00:00 2001 From: j-hc Date: Sat, 28 Jan 2023 10:01:29 +0300 Subject: [PATCH] module: add checks --- CONFIG.md | 6 ++---- scripts/customize.sh | 2 +- scripts/service.sh | 11 +++++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 7675e76..b307b7f 100755 --- a/CONFIG.md +++ b/CONFIG.md @@ -25,10 +25,9 @@ enabled = true # whether to build the app. default: true build-mode = "both" # 'both', 'apk' or 'module'. default: apk allow-alpha-version = false # allow downloading alpha versions from apkmirror. default: false excluded-patches = "some-patch" # whitespace seperated list of patches to exclude. default: "" (empty) -included-patches = "patch-name" # whitespace seperated list of patches to include. default: "" (empty) +included-patches = "patch-name" # whitespace seperated list of patches to include, all default patches are included by default. default: "" (empty) version = "auto" # 'auto', 'latest' or a custom one e.g. '17.40.41'. 'auto' option gets the latest version that is supported by the patches. default: auto exclusive-patches = false # exclude all patches by default. default: false -microg-patch = "microg-support" # name of the microg-patch if exists for the app. default: "" (empty) apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" # download url. if not set, uptodown dl url is used. uptodown-dlurl = "https://spotify.en.uptodown.com/android" # uptodown url. if not set, apkmirror dl url is used. apkmirror is prioritized module-prop-name = "ytrv-magisk" # magisk module prop name. not required. @@ -38,5 +37,4 @@ arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a' or 'all'. default: all ``` # Building ReVanced Extended -Use [`config-rv-ex.toml`](./config-rv-ex.toml) as the config. -By replacing config.toml with config-rv-ex.toml. +Use [`config-rv-ex.toml`](./config-rv-ex.toml) as the config by replacing config.toml with it diff --git a/scripts/customize.sh b/scripts/customize.sh index 60288e4..d095ad6 100755 --- a/scripts/customize.sh +++ b/scripts/customize.sh @@ -24,7 +24,7 @@ BASEPATH=${BASEPATH#*:} INS=true if [ "$BASEPATH" ]; then if [ ! -d ${BASEPATH%base.apk}lib ]; then - ui_print "Invalid installation found. Uninstalling..." + ui_print "* Invalid installation found. Uninstalling..." pm uninstall -k --user 0 __PKGNAME elif cmpr $BASEPATH $MODPATH/__PKGNAME.apk; then ui_print "* __PKGNAME is up-to-date" diff --git a/scripts/service.sh b/scripts/service.sh index 28164fe..334c5b6 100755 --- a/scripts/service.sh +++ b/scripts/service.sh @@ -13,11 +13,18 @@ if [ $BASEPATH ] && [ -d ${BASEPATH%base.apk}lib ]; then VERSION=$(dumpsys package __PKGNAME | grep -m1 versionName) if [ ${VERSION#*=} = __PKGVER ]; then grep __PKGNAME /proc/self/mountinfo | while read -r line; do - mountpoint=$(echo "$line" | cut -d' ' -f5) - umount -l "${mountpoint%%\\*}" + mountpoint=$(echo "$line" | cut -d' ' -f5) + umount -l "${mountpoint%%\\*}" done chcon u:object_r:apk_data_file:s0 $RVPATH su -Mc mount -o bind $RVPATH $BASEPATH am force-stop __PKGNAME + mv -f $MODDIR/err $MODDIR/module.prop 2>/dev/null + else + cp -n $MODDIR/module.prop $MODDIR/err + sed -i "s/^des.*/description=⚠️ Module is inactive: Version mismatch (${VERSION#*=})/g" $MODDIR/module.prop fi +else + cp -n $MODDIR/module.prop $MODDIR/err + sed -i "s/^des.*/description=⚠️ Module is inactive: Invalid installation/g" $MODDIR/module.prop fi