From 4755f881802748ec76bdb12702249a00681e2483 Mon Sep 17 00:00:00 2001 From: Chris Renshaw Date: Wed, 11 Jun 2025 23:05:58 -0300 Subject: [PATCH] Promote autopif2 --match to documented feature -m or --match will attempt to match the print to your current device if run on a Pixel, and will otherwise fall back to random - make matching the Action button default since there was some evidence that matching your actual Pixel device may be important for accessing the Pixel exclusive features for your device --- module/action.sh | 2 +- module/autopif2.sh | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/module/action.sh b/module/action.sh index 426be15..2b2c653 100644 --- a/module/action.sh +++ b/module/action.sh @@ -4,7 +4,7 @@ MODPATH="${0%/*}" set +o standalone unset ASH_STANDALONE -sh $MODPATH/autopif2.sh -a -p || exit 1 +sh $MODPATH/autopif2.sh -a -m -p || exit 1 echo -e "\nDone!" diff --git a/module/autopif2.sh b/module/autopif2.sh index bbb1ff9..fd22d11 100644 --- a/module/autopif2.sh +++ b/module/autopif2.sh @@ -10,9 +10,10 @@ esac; FORCE_DEPTH=1; until [ -z "$1" ]; do case "$1" in - -h|--help|help) echo "sh autopif2.sh [-a|-s] [-p] [-d #]"; exit 0;; + -h|--help|help) echo "sh autopif2.sh [-a|-s] [-m] [-p] [-d #]"; exit 0;; -a|--advanced|advanced) ARGS="-a"; shift;; -s|--strong|strong) ARGS="-a"; PATCH_COMMENT=1; spoofProvider=0; shift;; + -m|--match|match) FORCE_MATCH=1; shift;; -p|--preview|preview) FORCE_PREVIEW=1; shift;; -d|--depth|depth) echo "$2" | grep -q '^[1-9]$' || exit 1; FORCE_DEPTH=$2; shift 2;; *) break;; @@ -98,18 +99,16 @@ MODEL_LIST="$(grep -A1 'tr id=' PIXEL_OTA_HTML | grep 'td' | sed 's;.*\(.*\) PRODUCT_LIST="$(grep -o 'ota/.*_beta' PIXEL_OTA_HTML | cut -d\/ -f2)"; OTA_LIST="$(grep 'ota/.*_beta' PIXEL_OTA_HTML | cut -d\" -f2)"; -case "$1" in - -m) - DEVICE="$(getprop ro.product.device)"; - case "$PRODUCT_LIST" in - *${DEVICE}_beta*) - MODEL="$(getprop ro.product.model)"; - PRODUCT="${DEVICE}_beta"; - OTA="$(echo "$OTA_LIST" | grep "$PRODUCT")"; - ;; - esac; - ;; -esac; +if [ "$FORCE_MATCH" ]; then + DEVICE="$(getprop ro.product.device)"; + case "$PRODUCT_LIST" in + *${DEVICE}_beta*) + MODEL="$(getprop ro.product.model)"; + PRODUCT="${DEVICE}_beta"; + OTA="$(echo "$OTA_LIST" | grep "$PRODUCT")"; + ;; + esac; +fi; item "Selecting Pixel Beta device ..."; if [ -z "$PRODUCT" ]; then set_random_beta() {