mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-06-16 20:24:31 +00:00
* 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>
51 lines
1.8 KiB
C++
51 lines
1.8 KiB
C++
// Jackson Coxson
|
|
|
|
#pragma once
|
|
#include <idevice++/bindings.hpp>
|
|
#include <idevice++/ffi.hpp>
|
|
#include <idevice++/provider.hpp>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace IdeviceFFI {
|
|
|
|
using CompanionProxyPtr =
|
|
std::unique_ptr<CompanionProxyClientHandle,
|
|
FnDeleter<CompanionProxyClientHandle, companion_proxy_client_free>>;
|
|
|
|
class CompanionProxy {
|
|
public:
|
|
// Factory: connect via Provider
|
|
static Result<CompanionProxy, FfiError> connect(Provider& provider);
|
|
|
|
// Factory: connect via RSD tunnel
|
|
static Result<CompanionProxy, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
|
|
|
|
// Factory: wrap an existing Idevice socket (consumes it on success)
|
|
static Result<CompanionProxy, FfiError> from_socket(Idevice&& socket);
|
|
|
|
// Ops
|
|
Result<std::vector<std::string>, FfiError> get_device_registry();
|
|
Result<uint16_t, FfiError> start_forwarding_service_port(uint16_t port);
|
|
Result<void, FfiError> stop_forwarding_service_port(uint16_t port);
|
|
|
|
// RAII / moves
|
|
~CompanionProxy() noexcept = default;
|
|
CompanionProxy(CompanionProxy&&) noexcept = default;
|
|
CompanionProxy& operator=(CompanionProxy&&) noexcept = default;
|
|
CompanionProxy(const CompanionProxy&) = delete;
|
|
CompanionProxy& operator=(const CompanionProxy&) = delete;
|
|
|
|
CompanionProxyClientHandle* raw() const noexcept { return handle_.get(); }
|
|
static CompanionProxy adopt(CompanionProxyClientHandle* h) noexcept {
|
|
return CompanionProxy(h);
|
|
}
|
|
|
|
private:
|
|
explicit CompanionProxy(CompanionProxyClientHandle* h) noexcept : handle_(h) {}
|
|
CompanionProxyPtr handle_{};
|
|
};
|
|
|
|
} // namespace IdeviceFFI
|