From 10e236abdfd74bd6747be5c67e6538cb8ee9fda3 Mon Sep 17 00:00:00 2001 From: Chris Renshaw Date: Sun, 12 Jun 2022 09:56:03 -0300 Subject: [PATCH] scripts: fix remaining instances of && || Looks like I may have missed this in https://github.com/topjohnwu/Magisk/commit/ce84f1762c65e39b59b0677e7f50f1104afe78eb originally --- app/src/main/res/raw/manager.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/raw/manager.sh b/app/src/main/res/raw/manager.sh index 92e7830e4..368d87c86 100644 --- a/app/src/main/res/raw/manager.sh +++ b/app/src/main/res/raw/manager.sh @@ -99,7 +99,8 @@ post_ota() { rm -f $1 chmod 755 bootctl ./bootctl hal-info || return - [ $(./bootctl get-current-slot) -eq 0 ] && SLOT_NUM=1 || SLOT_NUM=0 + SLOT_NUM=0 + [ $(./bootctl get-current-slot) -eq 0 ] && SLOT_NUM=1 ./bootctl set-active-boot-slot $SLOT_NUM cat << EOF > post-fs-data.d/post_ota.sh /data/adb/bootctl mark-boot-successful @@ -142,7 +143,8 @@ adb_pm_install() { check_boot_ramdisk() { # Create boolean ISAB - [ -z $SLOT ] && ISAB=false || ISAB=true + ISAB=true + [ -z $SLOT ] && ISAB=false # If we are A/B, then we must have ramdisk $ISAB && return 0 @@ -170,7 +172,8 @@ check_encryption() { CRYPTOTYPE="file" else # We are either FDE or metadata encryption (which is also FBE) - grep -q ' /metadata ' /proc/mounts && CRYPTOTYPE="file" || CRYPTOTYPE="block" + CRYPTOTYPE="block" + grep -q ' /metadata ' /proc/mounts && CRYPTOTYPE="file" fi fi fi @@ -186,12 +189,14 @@ check_encryption() { mount_partitions() { [ "$(getprop ro.build.ab_update)" = "true" ] && SLOT=$(getprop ro.boot.slot_suffix) # Check whether non rootfs root dir exists - grep ' / ' /proc/mounts | grep -qv 'rootfs' && SYSTEM_ROOT=true || SYSTEM_ROOT=false + SYSTEM_ROOT=false + grep ' / ' /proc/mounts | grep -qv 'rootfs' && SYSTEM_ROOT=true } get_flags() { KEEPVERITY=$SYSTEM_ROOT - [ "$(getprop ro.crypto.state)" = "encrypted" ] && ISENCRYPTED=true || ISENCRYPTED=false + ISENCRYPTED=false + [ "$(getprop ro.crypto.state)" = "encrypted" ] && ISENCRYPTED=true KEEPFORCEENCRYPT=$ISENCRYPTED # Although this most certainly won't work without root, keep it just in case if [ -e /dev/block/by-name/vbmeta_a ] || [ -e /dev/block/by-name/vbmeta ]; then