Commit 10e236ab authored by Chris Renshaw's avatar Chris Renshaw Committed by John Wu

scripts: fix remaining instances of && ||

Looks like I may have missed this in https://github.com/topjohnwu/Magisk/commit/ce84f1762c65e39b59b0677e7f50f1104afe78eb originally
parent 2248af00
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment