4e9f147e55
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.
32 lines
976 B
C++
32 lines
976 B
C++
/*
|
|
* Copyright (C) 2026 oxmc / PawletOS
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#pragma once
|
|
|
|
#include <me/pawlet/hardware/update/BnPawletHardwareUpdate.h>
|
|
|
|
#include "engine.h"
|
|
|
|
namespace pawlet::hwupdate {
|
|
|
|
// Binder front-end for the daemon; delegates to Engine. Registered as
|
|
// "pawlet_hwupdate".
|
|
class HwUpdateService : public me::pawlet::hardware::update::BnPawletHardwareUpdate {
|
|
public:
|
|
explicit HwUpdateService(Engine* engine) : engine_(engine) {}
|
|
|
|
::android::binder::Status getComponents(
|
|
::std::vector<::me::pawlet::hardware::update::HwComponent>* out) override;
|
|
::android::binder::Status getPendingUpdates(
|
|
::std::vector<::me::pawlet::hardware::update::HwUpdateInfo>* out) override;
|
|
::android::binder::Status checkNow() override;
|
|
::android::binder::Status isBusy(bool* out) override;
|
|
::android::binder::Status getLastResult(int32_t* out) override;
|
|
|
|
private:
|
|
Engine* engine_;
|
|
};
|
|
|
|
} // namespace pawlet::hwupdate
|