fix(spoof): skip empty PIF source files

resolvePifPatch selected the last existing file regardless of
size. A 0-byte file picked up by lastOrNull caused JSONObject("")
to throw, the catch silently fell back to SystemProperties, and a
preceding non-empty PIF was ignored. Filter out zero-length files
so the lookup walks past them to the next valid candidate.
This commit is contained in:
Enginex0
2026-05-19 05:10:59 +01:00
parent 864c8841c1
commit bbeab27f11
@@ -93,7 +93,9 @@ object PatchLevelManager {
}
private fun resolvePifPatch(): String? {
val source = PIF_SOURCES.map(::File).lastOrNull { it.exists() } ?: return null
val source =
PIF_SOURCES.map(::File).lastOrNull { it.exists() && it.length() > 0 }
?: return null
return try {
val text = source.readText()
val parsed =