autopif2.sh: add test and busybox fallback for broken ROM toybox grep

- outdated/broken toybox grep would ignore -A1 if -m1 was present
This commit is contained in:
Chris Renshaw
2024-10-22 23:14:18 -03:00
committed by GitHub
parent b83de28f0b
commit 3f346f3735

View File

@@ -54,6 +54,14 @@ if date -D '%s' -d "$(date '+%s')" 2>&1 | grep -qE "bad date|invalid option"; th
fi;
fi;
if ! echo "A\nB" | grep -m1 -A1 "A" | grep -q "B"; then
if ! find_busybox; then
die "grep broken";
else
grep() { $BUSYBOX grep "$@"; }
fi;
fi;
if [ "$DIR" = /data/adb/modules/playintegrityfix ]; then
DIR=$DIR/autopif2;
mkdir -p $DIR;