Fix GMS crashes by aborting Java JSON read if a null/bad value is found

This commit is contained in:
osm0sis
2023-12-13 13:15:19 -04:00
parent 2a65fe624e
commit c925553198

View File

@@ -30,8 +30,9 @@ public final class EntryPoint {
map.put(reader.nextName(), reader.nextString());
}
reader.endObject();
} catch (IOException e) {
} catch (IOException|IllegalStateException e) {
LOG("Couldn't read JSON from Zygisk: " + e);
map.clear();
return;
}
}
@@ -84,8 +85,8 @@ public final class EntryPoint {
}
private static void setField(String name, String value) {
if (value == null || value.isEmpty()) {
LOG(String.format("%s is null, skipping...", name));
if (value.isEmpty()) {
LOG(String.format("%s is empty, skipping...", name));
return;
}