s/! -z/-n/g

merge-requests/33/head
Christopher Roy Bratusek 4 years ago
parent a595aaa672
commit 385cc98617

@ -79,7 +79,7 @@ get_config () {
}
is_mounted() {
if [ ! -z "$2" ]; then
if [ -n "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null

@ -168,7 +168,7 @@ set_perm () {
chown ${2}:${3} ${1} || error "failed change owner for ${1}"
chmod ${4} ${1} || error "failed to change mode for ${1}"
if [ ! -z "${5}" ]; then
if [ -n "${5}" ]; then
chcon ${5} ${1} 2>/dev/null
else chcon 'u:object_r:system_file:s0' ${1} 2>/dev/null
fi
@ -232,7 +232,7 @@ mount_partitions () {
if [ -z ${SLOT} ]; then
SLOT=$(grep_cmdline androidboot.slot)
echo " INFO: #2 [SLOT] ${SLOT}"
if [ ! -z ${SLOT} ]; then
if [ -n ${SLOT} ]; then
SLOT=_${SLOT}
echo " INFO: #3 [SLOT] ${SLOT}"
DEVICE_AB=TRUE
@ -389,7 +389,7 @@ detect_migrate_apk () {
USER_PATH=$(find /data/app -type d -name "${app_id}-*" &>/dev/null)
if [ ! -z ${USER_PATH} ]; then
if [ -n ${USER_PATH} ]; then
if ${UNZIP} -l "${MODPATH}/system/priv-app/${app_name}/${app_name}.apk" | grep META-INF/NANOLX.RSA &>/dev/null; then
BUILD_INST=Nanolx
else BUILD_INST=Official
@ -969,7 +969,7 @@ magisk_install_postinst () {
fi
if [ "${nanodroid_microg}" -ne 0 -o "${MODID}" = "NanoDroid_microG" ]; then
if [ ! -z $(grep_prop ro.setupwizard.mode) ]; then
if [ -n $(grep_prop ro.setupwizard.mode) ]; then
echo "ro.setupwizard.mode=DISABLED" >> ${MODPATH}/system.prop
fi
fi
@ -1592,7 +1592,7 @@ nanodroid_install_apk () {
fi
fi
if [ ! -z "${alias}" ]; then
if [ -n "${alias}" ]; then
dest_apk=${alias}.apk
else dest_apk=${app}.apk
fi
@ -1768,7 +1768,7 @@ VENDORBLOCK=${VENDORBLOCK}
df 2>/dev/null | sed '/^\//d' >> ${nanodroid_logfile}
if [ ! -z "${cfg_setup}" ]; then
if [ -n "${cfg_setup}" ]; then
echo "
### SETUP ###
@ -1780,7 +1780,7 @@ cat "${cfg_setup}" >> ${nanodroid_logfile}
fi
if [ ! -z "${cfg_apps}" ]; then
if [ -n "${cfg_apps}" ]; then
echo "
### APPS ###
@ -1792,7 +1792,7 @@ cat "${cfg_apps}" >> ${nanodroid_logfile}
fi
if [ ! -z "${cfg_overlay}" ]; then
if [ -n "${cfg_overlay}" ]; then
echo "
### OVERLAY ###

@ -43,13 +43,13 @@ case ${1} in
;;
-A | --add-prop )
if [ ! -z ${2} -a ! -z ${3} ]; then
if [ -n ${2} -a -n ${3} ]; then
add_prop "${2}" "${3}"
fi
;;
-R | --remove-prop )
if [ ! -z ${2} ]; then
if [ -n ${2} ]; then
remove_prop "${2}"
fi
;;

@ -183,7 +183,7 @@ increase_module_version () {
dalvikize_jar () {
[ -z "${ANDROID_HOME}" ] && error "ANDROID_HOME is not set!"
[ ! -f "${ANDROID_HOME}/build-tools/29.0.3/dx" ] && error "can't find 'dx' binary in \"${ANDROID_HOME}/build-tools/29.0.3\"!"
[ ! -z "${2}" ] && local dx_extra_arg="--min-sdk-version=${2}"
[ -n "${2}" ] && local dx_extra_arg="--min-sdk-version=${2}"
if [ -f "${1}" ]; then
${ANDROID_HOME}/build-tools/29.0.3/dx --dex \

@ -188,7 +188,7 @@ get_etc_info () {
| Origin: ${etc_path}
| SHA256: ${etc_sha}" >> ${report_file}
if [ ! -z "${etc_pkgs}" ]; then
if [ -n "${etc_pkgs}" ]; then
echo -e " | Packages:\n$(printf "\t|- %s\n" ${etc_pkgs})\n" >> ${report_file}
else echo "" >> ${report_file}
fi

@ -38,7 +38,7 @@ ui_print() {
}
is_mounted () {
if [ ! -z "$2" ]; then
if [ -n "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null
@ -116,7 +116,7 @@ mount_partitions () {
if [ -z ${SLOT} ]; then
SLOT=$(grep_cmdline androidboot.slot)
echo " INFO: #2 [SLOT] ${SLOT}"
if [ ! -z ${SLOT} ]; then
if [ -n ${SLOT} ]; then
SLOT=_${SLOT}
echo " INFO: #3 [SLOT] ${SLOT}"
DEVICE_AB=TRUE
@ -205,7 +205,7 @@ set_perm () {
chown ${2}:${3} ${1} || error "failed change owner for ${1}"
chmod ${4} ${1} || error "failed to change mode for ${1}"
if [ ! -z "${5}" ]; then
if [ -n "${5}" ]; then
chcon ${5} ${1} 2>/dev/null
else chcon 'u:object_r:system_file:s0' ${1} 2>/dev/null
fi

@ -30,7 +30,7 @@ ui_print() {
}
is_mounted () {
if [ ! -z "$2" ]; then
if [ -n "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null
@ -103,7 +103,7 @@ mount_partitions () {
SLOT=$(grep_cmdline androidboot.slot_suffix)
if [ -z ${SLOT} ]; then
SLOT=$(grep_cmdline androidboot.slot)
if [ ! -z ${SLOT} ]; then
if [ -n ${SLOT} ]; then
SLOT=_${SLOT}
DEVICE_AB=TRUE
fi

@ -27,7 +27,7 @@ grep_cmdline() {
}
is_mounted() {
if [ ! -z "$2" ]; then
if [ -n "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null
@ -39,7 +39,7 @@ set_perm () {
chown ${2}:${3} ${1} || error "failed change owner for ${1}"
chmod ${4} ${1} || error "failed to change mode for ${1}"
if [ ! -z "${5}" ]; then
if [ -n "${5}" ]; then
chcon ${5} ${1} 2>/dev/null
else chcon 'u:object_r:system_file:s0' ${1} 2>/dev/null
fi
@ -180,7 +180,7 @@ mount_partitions () {
if [ -z ${SLOT} ]; then
SLOT=$(grep_cmdline androidboot.slot)
echo " INFO: #2 [SLOT] ${SLOT}"
if [ ! -z ${SLOT} ]; then
if [ -n ${SLOT} ]; then
SLOT=_${SLOT}
echo " INFO: #3 [SLOT] ${SLOT}"
DEVICE_AB=TRUE

Loading…
Cancel
Save