Skip to content

Commit

Permalink
Check ro.product.device instead of ro.omni.device
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiKettunen committed Nov 20, 2020
1 parent 4ac9961 commit f0db010
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions boot-switcher/META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,9 @@ abort() { ui_print "E$1: $2"; exit $1; }

# <<< TWRP init <<<

# >>> Custom functions >>>

# Verify device boardname validity (e.g. not unset, no spaces / uppercase chars)
invalid_device() { [[ -z "$CURRENT_DEVICE" || "$CURRENT_DEVICE" = *" "* || `echo "$CURRENT_DEVICE" | grep -q [A-Z]` ]]; }

# <<< Custom functions <<<

# Constants & variables
TARGET_DEVICES="cheeseburger dumpling"
CURRENT_DEVICE=`getprop ro.omni.device`
CURRENT_DEVICE=`getprop ro.product.device`
ROOT="/data/.stowaways/sailfishos"
PARTITION_PREFIX="/dev/block/bootdevice/by-name"
PARTITION_BOOT="$PARTITION_PREFIX/boot"
Expand All @@ -38,8 +31,6 @@ PARTITION_VENDOR="$PARTITION_PREFIX/vendor"
# >>> Sanity checks >>>

# Device
invalid_device && CURRENT_DEVICE=`getprop ro.product.device`
invalid_device && CURRENT_DEVICE=`getprop ro.build.product`
echo $TARGET_DEVICES | grep -q $CURRENT_DEVICE || abort 7 "This package is for '$TARGET_DEVICES' devices; this is a '$CURRENT_DEVICE'."

# Treble
Expand Down

0 comments on commit f0db010

Please sign in to comment.