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:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user