Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NoName-exe authored Mar 7, 2025
2 parents 7fa37a4 + 20827c3 commit d623025
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build-termux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ until
do sleep 1; done
if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then
pr "Setting up environment..."
yes "" | pkg update -y && pkg install -y git curl jq openjdk-17 zip
yes "" | pkg update -y && pkg upgrade -y && pkg install -y git curl jq openjdk-17 zip
: >~/.rvmm_"$(date '+%Y%m')"
fi
mkdir -p /sdcard/Download/revanced-magisk-module/
Expand Down
33 changes: 21 additions & 12 deletions revanced-magisk/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,24 @@ install() {
abort "ERROR: Stock $PKG_NAME apk was not found"
fi
ui_print "- Updating $PKG_NAME to $PKG_VER"
VERIF_ADB=$(settings get global verifier_verify_adb_installs)
install_err=""
VERIF1=$(settings get global verifier_verify_adb_installs)
VERIF2=$(settings get global package_verifier_enable)
settings put global verifier_verify_adb_installs 0
settings put global package_verifier_enable 0
SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk")
for IT in 1 2; do
if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -d -S "$SZ"); then
ui_print "ERROR: install-create failed"
settings put global verifier_verify_adb_installs "$VERIF_ADB"
abort "$SES"
install_err="$SES"
break
fi
SES=${SES#*[} SES=${SES%]*}
set_perm "$MODPATH/$PKG_NAME.apk" 1000 1000 644 u:object_r:apk_data_file:s0
if ! op=$(pmex install-write -S "$SZ" "$SES" "$PKG_NAME.apk" "$MODPATH/$PKG_NAME.apk"); then
ui_print "ERROR: install-write failed"
settings put global verifier_verify_adb_installs "$VERIF_ADB"
abort "$op"
install_err="$op"
break
fi
if ! op=$(pmex install-commit "$SES"); then
if echo "$op" | grep -q INSTALL_FAILED_VERSION_DOWNGRADE; then
Expand All @@ -101,29 +104,35 @@ install() {
ui_print "- Created the uninstall script."
ui_print ""
ui_print "- Reboot and reflash the module!"
abort
install_err=" "
break
else
ui_print "- Uninstalling..."
if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then
ui_print "$op"
if [ $IT = 2 ]; then abort "ERROR: pm uninstall failed."; fi
if [ $IT = 2 ]; then
install_err="ERROR: pm uninstall failed."
break
fi
fi
continue
fi
fi
ui_print "ERROR: install-commit failed"
settings put global verifier_verify_adb_installs "$VERIF_ADB"
abort "$op"
install_err="$op"
break
fi
if BASEPATH=$(pmex path "$PKG_NAME"); then
BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*}
else
settings put global verifier_verify_adb_installs "$VERIF_ADB"
abort "ERROR: install $PKG_NAME manually and reflash the module"
install_err="ERROR: install $PKG_NAME manually and reflash the module"
break
fi
break
done
settings put global verifier_verify_adb_installs "$VERIF_ADB"
settings put global verifier_verify_adb_installs "$VERIF1"
settings put global package_verifier_enable "$VERIF2"
if [ "$install_err" ]; then abort "$install_err"; fi
}
if [ $INS = true ] && ! install; then abort; fi
BASEPATHLIB=${BASEPATH}/lib/${ARCH}
Expand Down
2 changes: 1 addition & 1 deletion utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ dl_apkmirror() {
else
if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi
local resp node app_table uurl dlurl=""
uurl=$(grep -F "downloadLink" <<<"$__APKMIRROR_RESP__" | grep -F "${version//./-}-release/" |
uurl=$(grep -F "downloadLink" <<<"$__APKMIRROR_RESP__" | grep -F "${version//./-}-release/" | head -1 |
sed -n 's;.*href="\(.*-release\).*;\1;p')
if [ -z "$uurl" ]; then url="${url}/${url##*/}-${version//./-}-release/"; else url=https://www.apkmirror.com$uurl; fi
resp=$(req "$url" -) || return 1
Expand Down

0 comments on commit d623025

Please sign in to comment.