From 12b60aafa570b398b052f91e11e1a5f84785b31a Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 1 Sep 2018 19:14:09 +0200 Subject: [PATCH] update detect_bootmode --- CommonInstaller | 5 ++--- patcher/CommonPatcher | 5 ++--- uninstaller/META-INF/com/google/android/update-binary | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CommonInstaller b/CommonInstaller index 0d00bca..d47fa87 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -53,9 +53,8 @@ org.microg.unifiednlp" ########################################################################################## detect_bootmode () { - ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false - ${BOOTMODE} || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true - ${BOOTMODE} || id | grep -q 'uid=0' || BOOTMODE=true + ps | grep zygote | grep -qv grep && BOOTMODE=true || BOOTMODE=false + ${BOOTMODE} || ps -A | grep zygote | grep -qv grep && BOOTMODE=true } ui_print() { diff --git a/patcher/CommonPatcher b/patcher/CommonPatcher index 67e3a51..ce77f7a 100644 --- a/patcher/CommonPatcher +++ b/patcher/CommonPatcher @@ -151,9 +151,8 @@ detect_outfd () { } detect_bootmode () { - ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false - ${BOOTMODE} || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true - ${BOOTMODE} || id | grep -q 'uid=0' || BOOTMODE=true + ps | grep zygote | grep -qv grep && BOOTMODE=true || BOOTMODE=false + ${BOOTMODE} || ps -A | grep zygote | grep -qv grep && BOOTMODE=true } grep_prop() { diff --git a/uninstaller/META-INF/com/google/android/update-binary b/uninstaller/META-INF/com/google/android/update-binary index b5f8f66..f1709ee 100644 --- a/uninstaller/META-INF/com/google/android/update-binary +++ b/uninstaller/META-INF/com/google/android/update-binary @@ -37,9 +37,8 @@ WhisperPush YouTube" detect_bootmode () { - ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false - ${BOOTMODE} || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true - ${BOOTMODE} || id | grep -q 'uid=0' || BOOTMODE=true + ps | grep zygote | grep -qv grep && BOOTMODE=true || BOOTMODE=false + ${BOOTMODE} || ps -A | grep zygote | grep -qv grep && BOOTMODE=true } ui_print() {