Skip to content

Commit

Permalink
Add new verified boot error props deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
osm0sis authored Jan 18, 2025
1 parent df5d5b7 commit 9b3801a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions module/common_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ resetprop_hexpatch() {
| dd obs=1 count=93 seek=$((NAMEOFFSET-93)) conv=notrunc of="$PROPFILE"
}

# delprop_if_exist <prop name>
delprop_if_exist() {
local NAME="$1"

[ -n "$(resetprop "$NAME")" ] && resetprop --delete "$NAME"
}

# resetprop_if_diff <prop name> <expected value>
resetprop_if_diff() {
local NAME="$1"
Expand Down
5 changes: 5 additions & 0 deletions module/post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ for PROP in $(resetprop | grep -oE 'ro.*.build.type'); do
resetprop_if_diff $PROP user
done
resetprop_if_diff ro.adb.secure 1
if ! $SKIPDELPROP; then
delprop_if_exist ro.boot.verifiedbooterror
delprop_if_exist ro.boot.verifyerrorpart
fi
resetprop_if_diff ro.boot.veritymode.managed yes
resetprop_if_diff ro.debuggable 0
resetprop_if_diff ro.force.debuggable 0
resetprop_if_diff ro.secure 1
4 changes: 2 additions & 2 deletions module/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ resetprop_if_match vendor.boot.mode recovery unknown
# SELinux
resetprop_if_diff ro.boot.selinux enforcing
# use delete since it can be 0 or 1 for enforcing depending on OEM
if ! $SKIPDELPROP && [ -n "$(resetprop ro.build.selinux)" ]; then
resetprop --delete ro.build.selinux
if ! $SKIPDELPROP; then
delprop_if_exist ro.build.selinux
fi
# use toybox to protect stat access time reading
if [ "$(toybox cat /sys/fs/selinux/enforce)" = "0" ]; then
Expand Down

0 comments on commit 9b3801a

Please sign in to comment.