From adcdd80d65d0b30424caaaa6980d6c379f758ffc Mon Sep 17 00:00:00 2001 From: osm0sis Date: Wed, 7 Aug 2024 11:48:06 -0300 Subject: [PATCH] migrate.sh: tidy up now that functions are multi-line --- module/migrate.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/module/migrate.sh b/module/migrate.sh index 83d6197..61edb11 100644 --- a/module/migrate.sh +++ b/module/migrate.sh @@ -15,8 +15,17 @@ esac; item() { echo "- $@"; } die() { [ "$INSTALL" ] || echo "$N$N! $@"; exit 1; } -grep_get_json() { local target="$FILE"; [ -n "$2" ] && target="$2"; eval set -- "$(cat "$target" | tr -d '\r\n' | grep -m1 -o "$1"'".*' | cut -d: -f2-)"; echo "$1" | sed -e 's|"|\\\\\\"|g' -e 's|[,}]*$||'; } -grep_check_json() { local target="$FILE"; [ -n "$2" ] && target="$2"; grep -q "$1" "$target" && [ "$(grep_get_json $1 "$target")" ]; } +grep_get_json() { + local target="$FILE"; + [ -n "$2" ] && target="$2"; + eval set -- "$(cat "$target" | tr -d '\r\n' | grep -m1 -o "$1"'".*' | cut -d: -f2-)"; + echo "$1" | sed -e 's|"|\\\\\\"|g' -e 's|[,}]*$||'; +} +grep_check_json() { + local target="$FILE"; + [ -n "$2" ] && target="$2"; + grep -q "$1" "$target" && [ "$(grep_get_json $1 "$target")" ]; +} case "$1" in -f|--force|force) FORCE=1; shift;; @@ -110,7 +119,12 @@ if [ -z "$DEVICE_INITIAL_SDK_INT" -o "$DEVICE_INITIAL_SDK_INT" = "null" ]; then fi; ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature verboseLogs"; -spoofBuild=1; spoofProps=1; spoofProvider=1; spoofSignature=0; verboseLogs=0; + +spoofBuild=1; +spoofProps=1; +spoofProvider=1; +spoofSignature=0; +verboseLogs=0; if [ -f "$OUT" ]; then item "Renaming old file to $(basename "$OUT").bak ...";