Files
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

45 lines
1.4 KiB
C++

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