Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e0adb66 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Updater: validate update object early

parent 295dc902
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -201,10 +201,14 @@ public class Utils {
                continue;
            }
            try {
                UpdateInfo update = parseJsonUpdate(updatesList.getJSONObject(i));
                boolean isValidated = JsonValidator.validateResponseObject(
                        updatesList.getJSONObject(i));
                if (isValidated && (!compatibleOnly || isCompatible(update))) {
                if (!isValidated) {
                    Log.d(TAG, "Ignoring incompatible update");
                    continue;
                }
                UpdateInfo update = parseJsonUpdate(updatesList.getJSONObject(i));
                if (!compatibleOnly || isCompatible(update)) {
                    updates.add(update);
                } else {
                    Log.d(TAG, "Ignoring incompatible update " + update.getName());