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>
45 lines
1.5 KiB
C++
45 lines
1.5 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 MisagentPtr =
|
|
std::unique_ptr<MisagentClientHandle, FnDeleter<MisagentClientHandle, misagent_client_free>>;
|
|
|
|
class Misagent {
|
|
public:
|
|
// Factory: connect via Provider
|
|
static Result<Misagent, FfiError> connect(Provider& provider);
|
|
|
|
// Factory: connect via RSD tunnel
|
|
static Result<Misagent, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
|
|
|
|
// Ops
|
|
Result<void, FfiError> install(const uint8_t* profile_data, size_t profile_len);
|
|
Result<void, FfiError> remove(const std::string& profile_id);
|
|
Result<std::vector<std::vector<uint8_t>>, FfiError> copy_all();
|
|
|
|
// RAII / moves
|
|
~Misagent() noexcept = default;
|
|
Misagent(Misagent&&) noexcept = default;
|
|
Misagent& operator=(Misagent&&) noexcept = default;
|
|
Misagent(const Misagent&) = delete;
|
|
Misagent& operator=(const Misagent&) = delete;
|
|
|
|
MisagentClientHandle* raw() const noexcept { return handle_.get(); }
|
|
static Misagent adopt(MisagentClientHandle* h) noexcept { return Misagent(h); }
|
|
|
|
private:
|
|
explicit Misagent(MisagentClientHandle* h) noexcept : handle_(h) {}
|
|
MisagentPtr handle_{};
|
|
};
|
|
|
|
} // namespace IdeviceFFI
|