Files
android_vendor_pawlet/hwupdate/daemon/catalog.h
T
oxmc 4e9f147e55 hwupdate: PawletOS hardware/peripheral firmware update subsystem
Adds pawlethwd, a native C++ system_ext daemon (coredomain) that detects
peripherals, checks the hardware update catalog (ota.php?mode=hardware),
verifies payloads, and flashes firmware via authorized handler plugins.

- daemon/: manifest parse, libcurl HTTP + sha256, sysfs USB detection,
  catalog client, dlopen handler registry (fixed path + ABI + allowlist),
  state persistence, orchestration engine, AIDL service, main.
- aidl/: IPawletHardwareUpdate (getComponents/getPendingUpdates/checkNow/...).
- include/pawlet/hwh_abi.h: stable C plugin ABI.
- handlers/usbdfu/: libpawlethwh_usbdfu.so, DFU 1.1 download over libusb.
- sepolicy/: pawlethwd domain, pawlet_hw_data_file, service type.
- schemas/, etc/supported_hardware.default.json, README design doc.
- hwupdate.mk wires packages + ro.pawlet.hardware.manifest + sepolicy dir;
  inherited from config/common.mk.

Trust: a server-named installer handler is honored only if allowlisted in
the immutable supported_hardware.json, maps to a fixed dm-verity-protected
.so path, is ABI/id-checked, and every payload is sha256-verified before a
handler runs.
2026-07-18 01:11:15 -07:00

30 lines
806 B
C++

/*
* Copyright (C) 2026 oxmc / PawletOS
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <optional>
#include <string>
#include "types.h"
namespace pawlet::hwupdate {
struct CheckRequest {
std::string device;
std::string pawletVersion;
std::string hardwareId;
std::string componentId;
std::string hardwareRevision;
std::string currentVersion;
std::string bootloaderVersion; // optional
};
// Query ota.php?mode=hardware&target=update for the newest compatible update.
// Returns the update on HTTP 200, nullopt on 204 (up to date) or any error. The
// server performs compatibility/version filtering; the daemon re-checks trust.
std::optional<UpdateEntry> CheckUpdate(const std::string& baseUrl, const CheckRequest& req);
} // namespace pawlet::hwupdate