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

Verified Commit 407dd730 authored by Frank Preel's avatar Frank Preel Committed by Nicolas Gelot
Browse files

Verify lock status

parent e0a7016b
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -49,10 +49,21 @@ DEVICE_STATE=${ARCHIVE_FOLDER_PATH}""${device_model}"-device-state"
# The command below may provide  empty result if the key does not exists
# In that case the process will use for compare.
"$ADB_PATH" shell getprop ro.build.version.security_patch> $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

if "$ADB_PATH" shell getprop ro.build.device 2>&1 | grep "$device_model"
then
	if "$ADB_PATH" shell getprop ro.boot.vbmeta.device_state 2>&1 | grep "unlocked"
	then
		echo "Device is unlocked"
		exit 0
	else
		echo "Device is locked"
		exit 2
	fi
fi

exit 2
 No newline at end of file
#We are NOT on a stock ROM let's assume the job (unlock) is done and continue the process.
exit 0
 No newline at end of file