File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
boot-switcher/META-INF/com/google/android Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,23 @@ abort() { ui_print "E$1: $2"; cleanup; exit $1; }
23
23
24
24
# <<< TWRP init <<<
25
25
26
+ # >>> Custom functions >>>
27
+
28
+ # Verify device boardname validity (e.g. not unset, no spaces / uppercase chars)
29
+ invalid_device () { [[ -z " $CURRENT_DEVICE " || " $CURRENT_DEVICE " = * " " * || " $CURRENT_DEVICE " =~ [A-Z] ]]; }
30
+
31
+ # <<< Custom functions <<<
32
+
26
33
# Constants & variables
27
34
TARGET_DEVICES=" cheeseburger dumpling"
28
- CURRENT_DEVICE=` getprop ro.product .device`
35
+ CURRENT_DEVICE=` getprop ro.omni .device`
29
36
ROOT=" /data/.stowaways/sailfishos"
30
37
31
38
# >>> Sanity checks >>>
32
39
33
40
# Device
34
- [ -z " $CURRENT_DEVICE " ] && CURRENT_DEVICE=` getprop ro.build.product`
41
+ invalid_device && CURRENT_DEVICE=` getprop ro.product.device`
42
+ invalid_device && CURRENT_DEVICE=` getprop ro.build.product`
35
43
echo $TARGET_DEVICES | grep -q $CURRENT_DEVICE || abort 7 " This package is for '$TARGET_DEVICES ' devices; this is a '$CURRENT_DEVICE '."
36
44
37
45
# Treble
@@ -195,4 +203,4 @@ log "Boot target updated successfully."
195
203
ui_print " All done, enjoy your new OS!"
196
204
ui_print
197
205
cleanup
198
- exit 0
206
+ exit 0
You can’t perform that action at this time.
0 commit comments