Skip to content

Commit f97aef1

Browse files
committed
Omit LineageOS version check & add support for dumpling
1 parent 4300b29 commit f97aef1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

boot-switcher/META-INF/com/google/android/update-binary

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# >>> TWRP init >>>
66

77
OUTFD="/proc/self/fd/$2" # e.g. "/proc/self/fd/28"
8-
ZIPFILE="$3" # e.g. "/sdcard/Switch-Boot-Target-SFOS-LOS-cheeseburger.zip"
8+
ZIPFILE="$3" # e.g. "/sdcard/Switch-Boot-Target-SFOS-LOS.zip"
99

1010
# Print some text ($1) on the screen
1111
ui_print() {
@@ -30,17 +30,15 @@ log() {
3030
# <<< Custom functions <<<
3131

3232
# Constants & variables
33-
LOS_VER=""
34-
TARGET_LOS_VER="15.1"
35-
TARGET_DEVICE="OnePlus 5"
36-
CURRENT_DEVICE=`getprop ro.display.series`
33+
TARGET_DEVICES="cheeseburger dumpling"
34+
CURRENT_DEVICE=`getprop ro.product.device`
3735
INIT_PERF="/vendor/etc/init/hw/init.target.performance.rc"
3836
ROOT="/data/.stowaways/sailfishos"
3937

4038
# >>> Sanity checks >>>
4139

4240
# Device
43-
[ "$CURRENT_DEVICE" != "$TARGET_DEVICE" ] && abort 7 "This package is for '$TARGET_DEVICE' devices; this is a '$CURRENT_DEVICE'."
41+
echo $TARGET_DEVICES | grep -q $CURRENT_DEVICE || abort 7 "This package is for '$TARGET_DEVICES' devices; this is a '$CURRENT_DEVICE'."
4442

4543
# Treble
4644
if [ ! -r /dev/block/bootdevice/by-name/vendor ]; then
@@ -52,8 +50,7 @@ umount /vendor &> /dev/null
5250
mount -o rw /vendor || abort 2 "Couldn't mount /vendor!"
5351
umount /system &> /dev/null
5452
mount /system || abort 3 "Couldn't mount /system!"
55-
LOS_VER=`cat /system/build.prop | grep lineage.build.version= | cut -d'=' -f2` # e.g. "16.0"
56-
[[ "$LOS_VER" = "$TARGET_LOS_VER" && -f $INIT_PERF ]] || abort 4 "Please factory reset & dirty flash LineageOS $TARGET_LOS_VER before this zip."
53+
[ -f $INIT_PERF ] || abort 4 "Please factory reset & dirty flash LineageOS before this zip."
5754
log "Android OS installation detected"
5855

5956
# Sailfish OS
@@ -114,6 +111,7 @@ else # LineageOS
114111

115112
[ ! -z $DROID_REL ] && DROID_REL=" ($DROID_REL)" # e.g. " (Pie)"
116113
TARGET_PRETTY="Android $DROID_VER$DROID_REL" # e.g. "Android 7.1.1 (Nougat)"
114+
LOS_VER=`cat /system/build.prop | grep lineage.build.version= | cut -d'=' -f2` # e.g. "16.0"
117115
[ ! -z $LOS_VER ] && TARGET_PRETTY="LineageOS $LOS_VER$DROID_REL" || TARGET_DROID_LOS=0 # e.g. "LineageOS 16.0 (Pie)"
118116
fi
119117

0 commit comments

Comments
 (0)