resetprop overrides for ro.boot.* props don't survive reboots. On devices where the kernel doesn't set ro.boot.vbmeta.public_key_digest, the fallback chain hit random generation on every boot, producing a different RootOfTrust hash each time. Added file-based persistence (boot_hash.bin, boot_key.bin) as a fallback layer between TEE cache and random generation. Once a value is determined from any source, it's written to disk and reused on subsequent boots. Verified on Redmi 14C: second boot reads from persistent file instead of regenerating random bytes.
13 lines
339 B
Bash
13 lines
339 B
Bash
#!/system/bin/sh
|
|
MODDIR=${0%/*}
|
|
CONFIG_DIR=/data/adb/tricky_store
|
|
|
|
# Kill daemon and supervisor
|
|
for pid in $(pidof TEESimulator) $(pidof supervisor) $(pidof daemon); do
|
|
kill -9 "$pid" 2>/dev/null
|
|
done
|
|
|
|
rm -rf "$CONFIG_DIR/persistent_keys"
|
|
rm -f "$CONFIG_DIR/tee_status.txt"
|
|
rm -f "$CONFIG_DIR/boot_hash.bin" "$CONFIG_DIR/boot_key.bin"
|