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
This is better for hybrid recoveries where ro.omni.device is a codename
for just one of the models.
  • Loading branch information
JamiKettunen committed Sep 20, 2020
1 parent ba27695 commit c99310d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions hybris-installer/META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,11 @@ abort() { ui_print "E$1: $2"; cleanup; 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
VERSION="%VERSION%" # e.g. "3.2.0.12 (Torronsuo)"
TARGET_LOS_VER="%LOS_VER%" # e.g. "16.0"
TARGET_DEVICE="%DEVICE%" # e.g. "cheeseburger"
CURRENT_DEVICE=`getprop ro.omni.device`
CURRENT_DEVICE=`getprop ro.product.device`
START_SECS=`date +'%s'`
ROOT="/data/.stowaways/sailfishos"
FORCE_REINSTALL=0
Expand All @@ -54,8 +47,6 @@ PARTITION_PERSIST="$PARTITION_PREFIX/persist"
# >>> Sanity checks >>>

# Device
invalid_device && CURRENT_DEVICE=`getprop ro.product.device`
invalid_device && CURRENT_DEVICE=`getprop ro.build.product`
[ "$CURRENT_DEVICE" != "$TARGET_DEVICE" ] && abort 7 "This package is for '$TARGET_DEVICE' devices; this is a '$CURRENT_DEVICE'."

# ext4 check for /data (& /cache)
Expand Down

0 comments on commit c99310d

Please sign in to comment.