5
5
# >>> TWRP init >>>
6
6
7
7
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"
9
9
10
10
# Print some text ($1) on the screen
11
11
ui_print () {
@@ -30,17 +30,15 @@ log() {
30
30
# <<< Custom functions <<<
31
31
32
32
# 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`
37
35
INIT_PERF=" /vendor/etc/init/hw/init.target.performance.rc"
38
36
ROOT=" /data/.stowaways/sailfishos"
39
37
40
38
# >>> Sanity checks >>>
41
39
42
40
# 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 '."
44
42
45
43
# Treble
46
44
if [ ! -r /dev/block/bootdevice/by-name/vendor ]; then
@@ -52,8 +50,7 @@ umount /vendor &> /dev/null
52
50
mount -o rw /vendor || abort 2 " Couldn't mount /vendor!"
53
51
umount /system & > /dev/null
54
52
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."
57
54
log " Android OS installation detected"
58
55
59
56
# Sailfish OS
@@ -114,6 +111,7 @@ else # LineageOS
114
111
115
112
[ ! -z $DROID_REL ] && DROID_REL=" ($DROID_REL )" # e.g. " (Pie)"
116
113
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"
117
115
[ ! -z $LOS_VER ] && TARGET_PRETTY=" LineageOS $LOS_VER$DROID_REL " || TARGET_DROID_LOS=0 # e.g. "LineageOS 16.0 (Pie)"
118
116
fi
119
117
0 commit comments