@@ -87,37 +87,20 @@ if [ -f "$TARGET_FILE" ]; then # Sailfish OS
87
87
rm " $TARGET_FILE "
88
88
89
89
TARGET=" sfos"
90
- SFOS_REL=` cat /data/.stowaways/sailfishos/etc/os-release | grep VERSION = | cut -d' =' -f2 | cut -d' "' -f2` # e.g. '3.0.3.10 (Hossa) '
91
- TARGET_PRETTY=" SailfishOS $SFOS_REL " # e.g. "SailfishOS 3.0.3.10 (Hossa) "
90
+ SFOS_REL=` cat /data/.stowaways/sailfishos/etc/os-release | grep VERSION_ID = | cut -d' =' -f2 | cut -d' "' -f2` # e.g. '3.0.3.10'
91
+ TARGET_PRETTY=" SailfishOS $SFOS_REL " # e.g. "SailfishOS 3.0.3.10"
92
92
else # LineageOS
93
93
touch " $TARGET_FILE "
94
94
95
- DROID_VER=` cat /system/build.prop | grep ro.build.version.release | cut -d' =' -f2 | cut -d' .' -f1` # e.g. "8"
96
- DROID_REL=" " # e.g. "Oreo"
97
-
98
- if [ " $DROID_VER " = " 9" ]; then
99
- DROID_REL=" Pie"
100
- elif [ " $DROID_VER " = " 8" ]; then
101
- DROID_REL=" Oreo"
102
- elif [ " $DROID_VER " = " 7" ]; then
103
- DROID_REL=" Nougat"
104
- elif [ " $DROID_VER " = " 6" ]; then
105
- DROID_REL=" Marshmellow"
106
- elif [ " $DROID_VER " = " 5" ]; then
107
- DROID_REL=" Lollipop"
108
- elif [ " $DROID_VER " = " 4" ]; then
109
- DROID_REL=" KitKat"
110
- fi
111
-
112
- [ ! -z $DROID_REL ] && DROID_REL=" ($DROID_REL )" # e.g. " (Oreo)"
95
+ DROID_VER=` cat /system/build.prop | grep ro.build.version.release | cut -d' =' -f2 | sed -r ' s/^.0+|.0+$//g' ` # e.g. "8.1"
113
96
114
97
LOS_VER=` cat /system/build.prop | grep ro.lineage.build.version= | cut -d' =' -f' 2' ` # e.g. "15.1"
115
- TARGET_PRETTY=" Android $DROID_VER$DROID_REL " # e.g. "Android 7.1.1 (Nougat) "
116
- [ ! -z $LOS_VER ] && TARGET_PRETTY=" LineageOS $LOS_VER$DROID_REL " || TARGET_DROID_LOS=" 0" # e.g. "LineageOS 15.1 (Oreo )"
98
+ TARGET_PRETTY=" Android $DROID_VER " # e.g. "Android 7.1.1"
99
+ [ ! -z $LOS_VER ] && TARGET_PRETTY=" LineageOS $LOS_VER ( $DROID_VER ) " || TARGET_DROID_LOS=" 0" # e.g. "LineageOS 15.1 (8.1 )"
117
100
fi
118
101
119
102
# Calculate centering offset indent on left
120
- target_len=` echo -n $TARGET_PRETTY | wc -m` # e.g. 21 for "LineageOS 15.1 (Oreo )"
103
+ target_len=` echo -n $TARGET_PRETTY | wc -m` # e.g. 21 for "LineageOS 15.1 (8.1 )"
121
104
start=` expr 52 - 25 - $target_len ` # e.g. 7
122
105
start=` expr $start / 2` # e.g. 3
123
106
log " indent offset is $start for '$TARGET_PRETTY '"
0 commit comments