From d146ad82343c20c6f5f3af71a354e3f2bdb8a147 Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 05:34:59 +0100 Subject: [PATCH] fix(spoof): require = in global key-assignment check isGlobalKeyAssignment treated any bare line whose first token matched system/boot/vendor/all as a global assignment and stripped it. A user line of literally "all" or "system" written without a value (malformed config but reachable) thus got eaten on the next atomicWrite. Require '=' in the trimmed line before treating it as a key=value assignment. --- .../java/org/matrix/TEESimulator/config/PatchLevelManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt b/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt index 03ca5ae..c00bf7c 100644 --- a/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt +++ b/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt @@ -170,8 +170,8 @@ object PatchLevelManager { } private fun isGlobalKeyAssignment(trimmed: String): Boolean { - if (trimmed.isEmpty() || trimmed.startsWith("#")) return false - val key = trimmed.substringBefore("=").trim().lowercase() + if (trimmed.isEmpty() || trimmed.startsWith("#") || '=' !in trimmed) return false + val key = trimmed.substringBefore('=').trim().lowercase() return key in GLOBAL_KEYS }