Update device state detection

This commit is contained in:
topjohnwu
2020-09-23 04:40:44 -07:00
parent b59e05c63e
commit ca9f9fee9a
5 changed files with 70 additions and 26 deletions

View File

@ -364,10 +364,11 @@ get_flags() {
fi
fi
if [ -z $KEEPFORCEENCRYPT ]; then
grep ' /data ' /proc/mounts | grep -q 'dm-' && FDE=true || FDE=false
[ -d /data/unencrypted ] && FBE=true || FBE=false
ISENCRYPTED=false
grep ' /data ' /proc/mounts | grep -q 'dm-' && ISENCRYPTED=true
[ -d /data/unencrypted ] && ISENCRYPTED=true
# No data access means unable to decrypt in recovery
if $FDE || $FBE || ! $DATA; then
if $ISENCRYPTED || ! $DATA; then
KEEPFORCEENCRYPT=true
ui_print "- Encrypted data, keep forceencrypt"
else