Files
Jackson Coxsonandse2crid 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

42 lines
1.4 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 ScreenshotrPtr = std::unique_ptr<ScreenshotrClientHandle,
FnDeleter<ScreenshotrClientHandle, screenshotr_client_free>>;
class Screenshotr {
public:
// Factory: connect via Provider
static Result<Screenshotr, FfiError> connect(Provider& provider);
// Factory: connect via RSD tunnel
static Result<Screenshotr, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
// Ops
Result<std::vector<uint8_t>, FfiError> take_screenshot();
// RAII / moves
~Screenshotr() noexcept = default;
Screenshotr(Screenshotr&&) noexcept = default;
Screenshotr& operator=(Screenshotr&&) noexcept = default;
Screenshotr(const Screenshotr&) = delete;
Screenshotr& operator=(const Screenshotr&) = delete;
ScreenshotrClientHandle* raw() const noexcept { return handle_.get(); }
static Screenshotr adopt(ScreenshotrClientHandle* h) noexcept { return Screenshotr(h); }
private:
explicit Screenshotr(ScreenshotrClientHandle* h) noexcept : handle_(h) {}
ScreenshotrPtr handle_{};
};
} // namespace IdeviceFFI