Skip to content

Commit c3cefc5

Browse files
committed
fix(props): skip non-existent props to prevent bootloader detection
check_reset_prop was unconditionally creating props via resetprop even when they didn't exist on the device. On a Xiaomi, this injected Realme/OnePlus-specific props (ro.boot.realmebootstate, ro.is_ever_orange) that attestor apps flag as tampering evidence. Now returns early when the prop value is empty, matching stock device behavior. Also fixes ro.boot.vbmeta.avb_version 1.3→1.0, removes three Rust-only props that don't exist on most devices, and moves ro.oem_unlock_supported and ro.secureboot.devicelock inside the ZeroMount guard.
1 parent 8078a79 commit c3cefc5

4 files changed

Lines changed: 23 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## v5.24.0 (2026-03-11)
4+
5+
### Bug Fixes
6+
- **Bootloader detection by TrustAttestor**`check_reset_prop` was creating props on devices where they don't naturally exist (e.g. Realme/OnePlus-specific props on Xiaomi), giving attestor apps a clear tampering signal. Now skips non-existent props instead of blindly injecting them, matching stock behavior
7+
- **AVB version mismatch**`ro.boot.vbmeta.avb_version` was set to `1.3` (non-standard) instead of `1.0`, creating a detectable inconsistency with the actual AVB stack
8+
- **Extra props in Rust backend** — removed `ro.bootimage.build.tags`, `ro.boot.verifiedbooterror`, and `ro.boot.veritymode.managed` from the Rust prop list since they don't exist on most devices and would be created unnecessarily
9+
- **Unconditional prop injection**`ro.oem_unlock_supported` and `ro.secureboot.devicelock` were set outside the ZeroMount guard, now properly gated
10+
11+
---
12+
313
## v5.23.0 (2026-03-11)
414

515
### Features

common/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ check_reset_prop() {
9999
local name="$1" expected="$2"
100100
local val
101101
val=$(resetprop "$name")
102+
[ -z "$val" ] && return 0
102103
[ "$val" = "$expected" ] && return 0
103104
if resetprop -n "$name" "$expected" 2>/dev/null; then
104105
_PROP_SPOOF_COUNT=$((_PROP_SPOOF_COUNT + 1))

prop.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ if [ "$_ZEROMOUNT_ACTIVE" != "true" ]; then
6161

6262
check_reset_prop "ro.crypto.state" "encrypted"
6363
check_reset_prop "ro.is_ever_orange" "0"
64-
fi
6564

66-
check_reset_prop "ro.oem_unlock_supported" "0"
67-
check_reset_prop "ro.secureboot.devicelock" "1"
65+
check_reset_prop "ro.oem_unlock_supported" "0"
66+
check_reset_prop "ro.secureboot.devicelock" "1"
67+
fi
6868

6969
# MIUI region enforcement — restore device-snapshotted values from config
7070
_region_enabled=$(read_config region.enabled true)
@@ -126,7 +126,7 @@ if [ "$_ZEROMOUNT_ACTIVE" != "true" ]; then
126126

127127
ensure_prop "ro.boot.vbmeta.device_state" "locked"
128128
ensure_prop "ro.boot.vbmeta.invalidate_on_error" "yes"
129-
ensure_prop "ro.boot.vbmeta.avb_version" "1.3"
129+
ensure_prop "ro.boot.vbmeta.avb_version" "1.0"
130130
ensure_prop "ro.boot.vbmeta.hash_alg" "sha256"
131131

132132
slot_suffix=$(getprop ro.boot.slot_suffix 2>/dev/null)

rust/src/props/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ const BOOT_PROPS: &[(&str, &str)] = &[
3030
("ro.boot.realme.lockstate", "1"),
3131
("ro.crypto.state", "encrypted"),
3232
("ro.is_ever_orange", "0"),
33-
("ro.bootimage.build.tags", "release-keys"),
34-
("ro.boot.verifiedbooterror", ""),
35-
("ro.boot.veritymode.managed", "yes"),
3633
];
3734

3835
const VBMETA_PROPS: &[(&str, &str)] = &[
3936
("ro.boot.vbmeta.device_state", "locked"),
4037
("ro.boot.vbmeta.invalidate_on_error", "yes"),
41-
("ro.boot.vbmeta.avb_version", "1.3"),
38+
("ro.boot.vbmeta.avb_version", "1.0"),
4239
("ro.boot.vbmeta.hash_alg", "sha256"),
4340
];
4441

@@ -151,10 +148,13 @@ fn zeromount_active() -> bool {
151148
}
152149

153150
fn check_reset_prop(sys: &PropSystem, name: &str, expected: &str) -> Result<bool> {
154-
if let Some(current) = getprop(sys, name) {
155-
if current == expected {
156-
return Ok(false);
157-
}
151+
let current = match getprop(sys, name) {
152+
Some(v) if v.is_empty() => return Ok(false),
153+
Some(v) => v,
154+
None => return Ok(false),
155+
};
156+
if current == expected {
157+
return Ok(false);
158158
}
159159
set(sys, name, expected)?;
160160
debug!("spoofed {name} = {expected}");

0 commit comments

Comments
 (0)