Files
idevice/cpp/include/idevice++/preboard_service.hpp
T
Jackson Coxson bae57ec4d9 Implement rppairing (#79)
* Initial rppairing support

* Use idevice-srp crate

* Add more debug logging to rppairing

* Create pair_rsd_ios tool

* Start work on iOS rppairing

* Set RemoteXPC initial root ID to 0

* Send weird flags after opening reply stream

* Allow rppairing with underlying RemoteXPC connection

* fix(pair_rsd_ios): handle Linux mDNS link-local fallback (#73)

* Implement CDTunnel via rppairing

* Add example to rppair over CoreDeviceProxy

* Implement shim and FFI for RSD services

* Implement C++ RSD connect factories

---------

Co-authored-by: se2crid <151872490+se2crid@users.noreply.github.com>
2026-03-26 23:22:40 -06:00

49 lines
1.8 KiB
C++

// Jackson Coxson
#pragma once
#include <idevice++/bindings.hpp>
#include <idevice++/ffi.hpp>
#include <idevice++/provider.hpp>
#include <memory>
#include <vector>
namespace IdeviceFFI {
using PreboardServicePtr =
std::unique_ptr<PreboardServiceClientHandle,
FnDeleter<PreboardServiceClientHandle, preboard_service_client_free>>;
class PreboardService {
public:
// Factory: connect via Provider
static Result<PreboardService, FfiError> connect(Provider& provider);
// Factory: connect via RSD tunnel
static Result<PreboardService, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
// Factory: wrap an existing Idevice socket (consumes it on success)
static Result<PreboardService, FfiError> from_socket(Idevice&& socket);
// Ops
Result<void, FfiError> create_stashbag(const std::vector<uint8_t>& manifest);
Result<void, FfiError> commit_stashbag(const std::vector<uint8_t>& manifest);
// RAII / moves
~PreboardService() noexcept = default;
PreboardService(PreboardService&&) noexcept = default;
PreboardService& operator=(PreboardService&&) noexcept = default;
PreboardService(const PreboardService&) = delete;
PreboardService& operator=(const PreboardService&) = delete;
PreboardServiceClientHandle* raw() const noexcept { return handle_.get(); }
static PreboardService adopt(PreboardServiceClientHandle* h) noexcept {
return PreboardService(h);
}
private:
explicit PreboardService(PreboardServiceClientHandle* h) noexcept : handle_(h) {}
PreboardServicePtr handle_{};
};
} // namespace IdeviceFFI