mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-05-17 20:20:34 +00:00
bae57ec4d9
* 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>
63 lines
2.5 KiB
C++
63 lines
2.5 KiB
C++
// Jackson Coxson
|
|
|
|
#pragma once
|
|
#include <idevice++/bindings.hpp>
|
|
#include <idevice++/ffi.hpp>
|
|
#include <idevice++/provider.hpp>
|
|
#include <idevice++/result.hpp>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace IdeviceFFI {
|
|
|
|
using DiagnosticsRelayPtr =
|
|
std::unique_ptr<DiagnosticsRelayClientHandle,
|
|
FnDeleter<DiagnosticsRelayClientHandle, diagnostics_relay_client_free>>;
|
|
|
|
class DiagnosticsRelay {
|
|
public:
|
|
// Factory: connect via Provider
|
|
static Result<DiagnosticsRelay, FfiError> connect(Provider& provider);
|
|
|
|
// Factory: connect via RSD tunnel
|
|
static Result<DiagnosticsRelay, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
|
|
|
|
// Factory: wrap an existing Idevice socket (consumes it on success)
|
|
static Result<DiagnosticsRelay, FfiError> from_socket(Idevice&& socket);
|
|
|
|
// API Methods - queries returning optional plist
|
|
Result<Option<plist_t>, FfiError> ioregistry(Option<std::string> current_plane,
|
|
Option<std::string> entry_name,
|
|
Option<std::string> entry_class) const;
|
|
|
|
Result<Option<plist_t>, FfiError> mobilegestalt(Option<std::vector<char*>> keys) const;
|
|
|
|
Result<Option<plist_t>, FfiError> gasguage() const;
|
|
Result<Option<plist_t>, FfiError> nand() const;
|
|
Result<Option<plist_t>, FfiError> all() const;
|
|
Result<Option<plist_t>, FfiError> wifi() const;
|
|
|
|
// API Methods - actions
|
|
Result<void, FfiError> restart();
|
|
Result<void, FfiError> shutdown();
|
|
Result<void, FfiError> sleep();
|
|
Result<void, FfiError> goodbye();
|
|
|
|
// RAII / moves
|
|
~DiagnosticsRelay() noexcept = default;
|
|
DiagnosticsRelay(DiagnosticsRelay&&) noexcept = default;
|
|
DiagnosticsRelay& operator=(DiagnosticsRelay&&) noexcept = default;
|
|
DiagnosticsRelay(const DiagnosticsRelay&) = delete;
|
|
DiagnosticsRelay& operator=(const DiagnosticsRelay&) = delete;
|
|
|
|
DiagnosticsRelayClientHandle* raw() const noexcept { return handle_.get(); }
|
|
static DiagnosticsRelay adopt(DiagnosticsRelayClientHandle* h) noexcept {
|
|
return DiagnosticsRelay(h);
|
|
}
|
|
|
|
private:
|
|
explicit DiagnosticsRelay(DiagnosticsRelayClientHandle* h) noexcept : handle_(h) {}
|
|
DiagnosticsRelayPtr handle_{};
|
|
};
|
|
|
|
} // namespace IdeviceFFI
|