diff --git a/revanced-magisk/customize.sh b/revanced-magisk/customize.sh index 9cb65a55d..85286c8e8 100755 --- a/revanced-magisk/customize.sh +++ b/revanced-magisk/customize.sh @@ -135,16 +135,17 @@ install() { done settings put global verifier_verify_adb_installs "$VERIF_ADB" } -if [ $INS = true ] && ! install; then abort; fi - -ui_print "* Extracting native libs" -BASEPATHLIB=${BASEPATH}/lib/${ARCH} -if [ ! -d "$BASEPATHLIB" ]; then mkdir -p "$BASEPATHLIB"; else rm "$BASEPATHLIB/*" || :; fi -if ! op=$(unzip -v -j "$MODPATH/$PKG_NAME.apk" lib/"${ARCH_LIB}"/* -d "$BASEPATHLIB" 2>&1); then - ui_print "ERROR: extracting native libs failed" - abort "$op" +if [ $INS = true ]; then + if ! install; then abort; fi + ui_print "* Extracting native libs" + BASEPATHLIB=${BASEPATH}/lib/${ARCH} + if [ ! -d "$BASEPATHLIB" ]; then mkdir -p "$BASEPATHLIB"; else rm -f "$BASEPATHLIB/*" >/dev/null 2>&1 || :; fi + if ! op=$(unzip -j "$MODPATH/$PKG_NAME.apk" "lib/${ARCH_LIB}/*" -d "$BASEPATHLIB" 2>&1); then + ui_print "ERROR: extracting native libs failed" + abort "$op" + fi + set_perm_recursive "${BASEPATH}/lib" 1000 1000 755 755 u:object_r:apk_data_file:s0 fi -set_perm_recursive "${BASEPATH}/lib" 1000 1000 755 755 u:object_r:apk_data_file:s0 ui_print "* Setting Permissions" set_perm "$MODPATH/base.apk" 1000 1000 644 u:object_r:apk_data_file:s0 diff --git a/utils.sh b/utils.sh index 7b45d7972..6890aee98 100755 --- a/utils.sh +++ b/utils.sh @@ -228,8 +228,11 @@ get_patch_last_supported_ver() { ver=$(sed -n "/^Name: $line\$/,/^\$/p" <<<"$op" | sed -n "/^Compatible versions:\$/,/^\$/p" | tail -n +2) vers=${ver}${NL} done <<<"$(list_args "$inc_sel")" - get_highest_ver <<<"$vers" - return + vers=$(xargs <<<"$vers") + if [ "$vers" ]; then + get_highest_ver <<<"$vers" + return + fi fi if ! op=$(java -jar "$rv_cli_jar" list-versions "$rv_patches_jar" -f "$pkg_name" 2>&1 | tail -n +3 | awk '{$1=$1}1'); then epr "list-versions: '$op'"