adebar-cli | 9 +++++---- lib/packagedata.lib | 2 +- lib/scriptgen.lib | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/adebar-cli b/adebar-cli index 593b095..ed69818 100755 --- a/adebar-cli +++ b/adebar-cli @@ -101,7 +101,7 @@ if [[ "$1" = "-a" || "$1" = "--auto" ]]; then fi declare -i trc=0 for serial in $(adb devices|tail -n +2|awk '{print $1}'); do - confi=$(egrep "^\s*SERIAL=.${serial}.\s*$" "${BINDIR}/config/"* |head -n 1|awk -F ':' '{print $1}') + confi=$(grep -E "^\s*SERIAL=.${serial}.\s*$" "${BINDIR}/config/"* |head -n 1|awk -F ':' '{print $1}') [[ -z "${confi}" ]] && continue # unknown device, i.e. serial not found in any config confi=${confi##*/} $0 $confi @@ -153,14 +153,15 @@ fi # Check whether a device is connected at all and, if configured, the serial matches # No device connected: ADBOPTS="" -if [ -z "$(adb devices|egrep "^[0-9A-Za-z.:]+\s+device$"|awk '{print $1}')" ]; then + +if [ -z "$(adb devices|grep -E "^[0-9A-Za-z]+[^ ]+device"|awk '{print $1}')" ]; then echo "No device found. Make sure you have connected your device with" echo "USB debugging enabled, and try again." echo exit 2 fi -serials=($(adb devices|egrep "^[0-9A-Za-z.:]+\s+device$"|awk '{print $1}')) +serials=($(adb devices|grep -E "^[0-9A-Za-z]+[^ ]+device"|awk '{print $1}')) # Multiple devices connected but no serial defined: if [ -z "${SERIAL}" -a ${#serials[*]} -ne 1 ]; then echo "There are currently multiple devices connected, and we don't know" @@ -221,7 +222,7 @@ fi # What Android version shall we assume (for specific features)? Do not evaluate if user has configured an override. [[ -z "${DEVICE_SDKVER}" ]] && DEVICE_SDKVER=$(adb shell "getprop ro.build.version.sdk") DEVICE_SDKVER=${DEVICE_SDKVER//[$'\t\r\n']} - +#DEVICE_SDKVER=23 # Load libraries if needed . "${BINDIR}/lib/common.lib" diff --git a/lib/packagedata.lib b/lib/packagedata.lib index cc1965b..3b4e50b 100644 --- a/lib/packagedata.lib +++ b/lib/packagedata.lib @@ -146,7 +146,7 @@ getAppDetails() { doProgress "Generating app detail info" doProgress "- collecting data via dumpsys" 2 - adb ${ADBOPTS} shell "dumpsys package" |egrep -A99999 "^Packages:" |egrep -B99999 "^Shared users:" > "${PKGDUMP}" + adb ${ADBOPTS} shell "dumpsys package" |grep -E -A99999 "^Packages:" |grep -E -B99999 "^Shared users:" > "${PKGDUMP}" # Parsing dump doProgress "- parsing package dump" 2 diff --git a/lib/scriptgen.lib b/lib/scriptgen.lib index c27d516..25283c3 100644 --- a/lib/scriptgen.lib +++ b/lib/scriptgen.lib @@ -50,7 +50,7 @@ getDisabled() { pkg=${pkg//[$'\t\r\n']} pkg=${pkg##*:} [[ "${pkg}" = "android" ]] && continue - comps=$(adb ${ADBOPTS} shell "dumpsys package ${pkg}" | egrep -A99999 "disabledComponents:" |egrep -B99999 "enabledComponents:") + comps=$(adb ${ADBOPTS} shell "dumpsys package ${pkg}" | grep -E -A99999 "disabledComponents:" |grep -E -B99999 "enabledComponents:") if [[ -n "${comps}" ]]; then echo >> "${scriptname}" echo "# ${pkg}" >> "${scriptname}"