Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit b201d29f authored by Rohit Sekhar's avatar Rohit Sekhar Committed by Nicolas Gelot
Browse files

FP4: Rely on ro.build.flavor to assert stock ROM

* We need to depend on a prop that:
 a) Remains unlikely to change on stock ROM
 b) Won't be spoofed elsewhere

* This seems to be the most sane prop, satisfying these conditions
parent 5a616ed8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ curl -o $MURENA_ROM_INFO https://images.ecloud.global/stable/FP4/e-latest-FP4.zi
MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"

# For FP4 on stock ROM the key [ro.build.device] is [FP4] let's use this to check if we are on stock ROM
# On Murena OS the return is empty
# For FP4 on stock ROM the key [ro.build.flavor] returns [qssi_user].
# On Murena OS: returns [lineage_FP4-userdebug]
# This seems to be the most sane way to assert if we are on stock ROM
echo "" > $SECURITY_PATCH
if "$ADB_PATH" shell getprop ro.build.device 2>&1 | grep "$device_model"
if "$ADB_PATH" shell getprop ro.build.flavor 2>&1 | grep "qssi_user"
then
	if "$ADB_PATH" shell getprop ro.boot.vbmeta.device_state 2>&1 | grep "unlocked"
	then