package com.foxx.androidcast.ota;

/*********************************************************************
 * OtaSignBundle.java
 * Created at: Wed 20 May 2026 14:31:55 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * class OtaSignBundle
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 26 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	eadf7b0d0c4a5c80e8faaa3519e4e7bc2885e931727eb66d362efb6a9fcbe3ae
**********************************************************************/
import org.json.JSONObject;

/** Checksums and digests for one OTA build ({@code *_sign.json}). */
public final class OtaSignBundle {
    public final String sha256Hex;

    public OtaSignBundle(String sha256Hex) {
        this.sha256Hex = sha256Hex != null ? sha256Hex.toLowerCase() : "";
    }

    public static OtaSignBundle fromJson(JSONObject root) {
        if (root == null) {
            return new OtaSignBundle("");
        }
        return new OtaSignBundle(root.optString("sha256", ""));
    }
}
