mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Update FFI for app launch arguments
This commit is contained in:
@@ -14,6 +14,7 @@ tokio = { version = "1.44.1", features = ["full"] }
|
||||
libc = "0.2.171"
|
||||
plist = "1.7.1"
|
||||
plist_ffi = { version = "0.1.5" }
|
||||
uuid = { version = "1.12", features = ["v4"], optional = true }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
windows-sys = { version = "0.60", features = ["Win32_Networking_WinSock"] }
|
||||
@@ -25,7 +26,7 @@ ring = ["idevice/ring"]
|
||||
|
||||
afc = ["idevice/afc"]
|
||||
amfi = ["idevice/amfi"]
|
||||
core_device = ["idevice/core_device", "dep:futures"]
|
||||
core_device = ["idevice/core_device", "dep:futures", "dep:uuid"]
|
||||
core_device_proxy = ["idevice/core_device_proxy"]
|
||||
crashreportcopymobile = ["idevice/crashreportcopymobile"]
|
||||
debug_proxy = ["idevice/debug_proxy"]
|
||||
|
||||
@@ -299,6 +299,7 @@ pub unsafe extern "C" fn app_service_free_app_list(apps: *mut AppListEntryC, cou
|
||||
/// * [`argc`] - Number of arguments
|
||||
/// * [`kill_existing`] - Whether to kill existing instances
|
||||
/// * [`start_suspended`] - Whether to start suspended
|
||||
/// * [`stdio_uuid`] - The UUID received from openstdiosocket, null for none
|
||||
/// * [`response`] - Pointer to store the launch response (caller must free)
|
||||
///
|
||||
/// # Returns
|
||||
@@ -314,6 +315,7 @@ pub unsafe extern "C" fn app_service_launch_app(
|
||||
argc: usize,
|
||||
kill_existing: c_int,
|
||||
start_suspended: c_int,
|
||||
stdio_uuid: *const u8,
|
||||
response: *mut *mut LaunchResponseC,
|
||||
) -> *mut IdeviceFfiError {
|
||||
if handle.is_null() || bundle_id.is_null() || response.is_null() {
|
||||
@@ -337,6 +339,13 @@ pub unsafe extern "C" fn app_service_launch_app(
|
||||
}
|
||||
}
|
||||
|
||||
let stdio_uuid = if stdio_uuid.is_null() {
|
||||
None
|
||||
} else {
|
||||
let stdio_uuid = unsafe { std::slice::from_raw_parts(stdio_uuid, 16) };
|
||||
Some(uuid::Uuid::from_bytes(stdio_uuid.try_into().unwrap()))
|
||||
};
|
||||
|
||||
let client = unsafe { &mut (*handle).0 };
|
||||
let res = RUNTIME.block_on(async move {
|
||||
client
|
||||
@@ -347,6 +356,7 @@ pub unsafe extern "C" fn app_service_launch_app(
|
||||
start_suspended != 0,
|
||||
None, // environment
|
||||
None, // platform_options
|
||||
stdio_uuid,
|
||||
)
|
||||
.await
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user