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.
This commit is contained in:
@@ -170,8 +170,8 @@ object PatchLevelManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun isGlobalKeyAssignment(trimmed: String): Boolean {
|
private fun isGlobalKeyAssignment(trimmed: String): Boolean {
|
||||||
if (trimmed.isEmpty() || trimmed.startsWith("#")) return false
|
if (trimmed.isEmpty() || trimmed.startsWith("#") || '=' !in trimmed) return false
|
||||||
val key = trimmed.substringBefore("=").trim().lowercase()
|
val key = trimmed.substringBefore('=').trim().lowercase()
|
||||||
return key in GLOBAL_KEYS
|
return key in GLOBAL_KEYS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user