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>
54 lines
2.1 KiB
C++
54 lines
2.1 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 CrashReportCopyMobilePtr =
|
|
std::unique_ptr<CrashReportCopyMobileHandle,
|
|
FnDeleter<CrashReportCopyMobileHandle, crash_report_client_free>>;
|
|
|
|
class CrashReportCopyMobile {
|
|
public:
|
|
// Factory: connect via Provider
|
|
static Result<CrashReportCopyMobile, FfiError> connect(Provider& provider);
|
|
|
|
// Factory: connect via RSD tunnel
|
|
static Result<CrashReportCopyMobile, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
|
|
|
|
// Factory: wrap an existing Idevice socket (consumes it on success)
|
|
static Result<CrashReportCopyMobile, FfiError> from_socket(Idevice&& socket);
|
|
|
|
// Static: flush crash reports from system storage
|
|
static Result<void, FfiError> flush(Provider& provider);
|
|
|
|
// Ops
|
|
Result<std::vector<std::string>, FfiError> ls(const char* dir_path = nullptr);
|
|
Result<std::vector<char>, FfiError> pull(const std::string& log_name);
|
|
Result<void, FfiError> remove(const std::string& log_name);
|
|
|
|
// RAII / moves
|
|
~CrashReportCopyMobile() noexcept = default;
|
|
CrashReportCopyMobile(CrashReportCopyMobile&&) noexcept = default;
|
|
CrashReportCopyMobile& operator=(CrashReportCopyMobile&&) noexcept = default;
|
|
CrashReportCopyMobile(const CrashReportCopyMobile&) = delete;
|
|
CrashReportCopyMobile& operator=(const CrashReportCopyMobile&) = delete;
|
|
|
|
CrashReportCopyMobileHandle* raw() const noexcept { return handle_.get(); }
|
|
static CrashReportCopyMobile adopt(CrashReportCopyMobileHandle* h) noexcept {
|
|
return CrashReportCopyMobile(h);
|
|
}
|
|
|
|
private:
|
|
explicit CrashReportCopyMobile(CrashReportCopyMobileHandle* h) noexcept : handle_(h) {}
|
|
CrashReportCopyMobilePtr handle_{};
|
|
};
|
|
|
|
} // namespace IdeviceFFI
|