+
+
+
+
+
+
diff --git a/StikJIT/StikJIT-Bridging-Header.h b/StikJIT/StikJIT-Bridging-Header.h
index 7ce5a25c..1cc9a940 100644
--- a/StikJIT/StikJIT-Bridging-Header.h
+++ b/StikJIT/StikJIT-Bridging-Header.h
@@ -6,3 +6,4 @@
#include "idevice/idevice.h"
#include "idevice/em_proxy.h"
#include "idevice/heartbeat.h"
+#include "JSSupport/JSSupport.h"
diff --git a/StikJIT/Utilities/mountDDI.swift b/StikJIT/Utilities/mountDDI.swift
index 3cd06f9e..612712a9 100644
--- a/StikJIT/Utilities/mountDDI.swift
+++ b/StikJIT/Utilities/mountDDI.swift
@@ -173,7 +173,7 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac
}
var uniqueChipIDPlist: plist_t?
- guard lockdownd_get_value(lockdownClient, "UniqueChipID".cString(using: .utf8), &uniqueChipIDPlist) == IdeviceSuccess else {
+ guard lockdownd_get_value(lockdownClient, "UniqueChipID".cString(using: .utf8), nil, &uniqueChipIDPlist) == IdeviceSuccess else {
print("Failed to get UniqueChipID")
return 8 // EC: 8
}
diff --git a/StikJIT/Views/MainTabView.swift b/StikJIT/Views/MainTabView.swift
index 57b98f45..02c5ddf6 100644
--- a/StikJIT/Views/MainTabView.swift
+++ b/StikJIT/Views/MainTabView.swift
@@ -28,6 +28,10 @@ struct MainTabView: View {
.tabItem {
Label("Settings", systemImage: "gearshape.fill")
}
+ RunJSView()
+ .tabItem {
+ Label("Scripts", systemImage: "gamecontroller.fill")
+ }
}
.accentColor(accentColor)
.environment(\.accentColor, accentColor)
diff --git a/StikJIT/Views/RunJSView.swift b/StikJIT/Views/RunJSView.swift
new file mode 100644
index 00000000..a53c1ffc
--- /dev/null
+++ b/StikJIT/Views/RunJSView.swift
@@ -0,0 +1,65 @@
+//
+// RunJSView.swift
+// StikJIT
+//
+// Created by s s on 2025/4/24.
+//
+
+import SwiftUI
+
+
+struct RunJSWebView: UIViewControllerRepresentable {
+ @Binding var scriptPath: String
+
+ func makeUIViewController(context: Context) -> IDeviceWebViewController {
+ return IDeviceWebViewController()
+ }
+
+ func updateUIViewController(_ vc: IDeviceWebViewController, context: Context) {
+ vc.loadScript(scriptPath)
+ }
+}
+
+struct RunJSView : View {
+ @State var selectedScript = ""
+ @State var webViewShow = false
+
+
+
+ var body: some View {
+ List {
+ Section {
+ Button("Enable JIT") {
+ selectScript(path: "test.html")
+ }
+ Button("Install App") {
+ selectScript(path: "test2.html")
+ }
+ Button("Location Simulation") {
+ selectScript(path: "test3.html")
+ }
+ }
+ }
+ .sheet(isPresented: $webViewShow) {
+ NavigationView {
+ RunJSWebView(scriptPath:$selectedScript)
+ .toolbar {
+ ToolbarItem(placement: .topBarTrailing) {
+ Button("Done") {
+ selectedScript = ""
+ webViewShow = false
+ }
+ }
+ }
+ .navigationTitle(selectedScript)
+ .navigationBarTitleDisplayMode(.inline)
+ }
+
+ }
+ }
+
+ func selectScript(path: String) {
+ selectedScript = path
+ webViewShow = true
+ }
+}
diff --git a/StikJIT/idevice/JITEnableContext.h b/StikJIT/idevice/JITEnableContext.h
index a3d1870d..c0f84999 100644
--- a/StikJIT/idevice/JITEnableContext.h
+++ b/StikJIT/idevice/JITEnableContext.h
@@ -19,4 +19,5 @@ typedef void (^LogFunc)(NSString *message);
- (BOOL)debugAppWithBundleID:(NSString*)bundleID logger:(LogFunc)logger;
- (NSDictionary*)getAppListWithError:(NSError**)error;
- (UIImage*)getAppIconWithBundleId:(NSString*)bundleId error:(NSError**)error;
+- (TcpProviderHandle*)getTcpProviderHandle;
@end
diff --git a/StikJIT/idevice/JITEnableContext.m b/StikJIT/idevice/JITEnableContext.m
index 243a47a8..b42b8c8c 100644
--- a/StikJIT/idevice/JITEnableContext.m
+++ b/StikJIT/idevice/JITEnableContext.m
@@ -88,6 +88,10 @@ - (IdevicePairingFile*)getPairingFileWithError:(NSError**)error {
return pairingFile;
}
+- (TcpProviderHandle*)getTcpProviderHandle {
+ return provider;
+}
+
- (void)startHeartbeatWithCompletionHandler:(HeartbeatCompletionHandler)completionHandler
logger:(LogFunc)logger
{
diff --git a/StikJIT/idevice/heartbeat.c b/StikJIT/idevice/heartbeat.c
index d2ee11a2..9ff22230 100644
--- a/StikJIT/idevice/heartbeat.c
+++ b/StikJIT/idevice/heartbeat.c
@@ -55,7 +55,7 @@ void startHeartbeat(IdevicePairingFile* pairing_file, TcpProviderHandle** provid
completion(0, "Heartbeat Completed");
- u_int64_t current_interval = 15;
+ u_int64_t current_interval = 10;
while (1) {
if(*heartbeatSessionId != currentSessionId) {
break;
diff --git a/StikJIT/idevice/idevice.h b/StikJIT/idevice/idevice.h
index 6dab1c6f..6915f029 100644
--- a/StikJIT/idevice/idevice.h
+++ b/StikJIT/idevice/idevice.h
@@ -14,12 +14,28 @@
#define LOCKDOWN_PORT 62078
+typedef enum AfcFopenMode {
+ AfcRdOnly = 1,
+ AfcRw = 2,
+ AfcWrOnly = 3,
+ AfcWr = 4,
+ AfcAppend = 5,
+ AfcRdAppend = 6,
+} AfcFopenMode;
+
+/**
+ * Link type for creating hard or symbolic links
+ */
+typedef enum AfcLinkType {
+ Hard = 1,
+ Symbolic = 2,
+} AfcLinkType;
typedef enum IdeviceErrorCode {
IdeviceSuccess = 0,
Socket = -1,
- Ssl = -2,
- SslSetup = -3,
+ Tls = -2,
+ TlsBuilderFailed = -3,
Plist = -4,
Utf8 = -5,
UnexpectedResponse = -6,
@@ -54,6 +70,13 @@ typedef enum IdeviceErrorCode {
Utf8Error = -35,
InvalidArgument = -36,
UnknownErrorType = -37,
+ PemParseFailed = -38,
+ MisagentFailure = -39,
+ InstallationProxyOperationFailed = -40,
+ Afc = -41,
+ UnknownAfcOpcode = -42,
+ InvalidAfcMagic = -43,
+ AfcMissingAttribute = -44,
AdapterIOFailed = -996,
ServiceNotFound = -997,
BufferTooSmall = -998,
@@ -79,6 +102,15 @@ typedef enum IdeviceLoggerError {
typedef struct AdapterHandle AdapterHandle;
+typedef struct AfcClientHandle AfcClientHandle;
+
+/**
+ * Handle for an open file on the device
+ */
+typedef struct AfcFileHandle AfcFileHandle;
+
+typedef struct AmfiClientHandle AmfiClientHandle;
+
typedef struct CoreDeviceProxyHandle CoreDeviceProxyHandle;
/**
@@ -104,8 +136,15 @@ typedef struct ImageMounterHandle ImageMounterHandle;
typedef struct InstallationProxyClientHandle InstallationProxyClientHandle;
+/**
+ * Opaque handle to a ProcessControlClient
+ */
+typedef struct LocationSimulationAdapterHandle LocationSimulationAdapterHandle;
+
typedef struct LockdowndClientHandle LockdowndClientHandle;
+typedef struct MisagentClientHandle MisagentClientHandle;
+
/**
* Opaque handle to a ProcessControlClient
*/
@@ -133,6 +172,29 @@ typedef struct XPCDeviceAdapterHandle XPCDeviceAdapterHandle;
typedef struct sockaddr sockaddr;
+/**
+ * File information structure for C bindings
+ */
+typedef struct AfcFileInfo {
+ size_t size;
+ size_t blocks;
+ int64_t creation;
+ int64_t modified;
+ char *st_nlink;
+ char *st_ifmt;
+ char *st_link_target;
+} AfcFileInfo;
+
+/**
+ * Device information structure for C bindings
+ */
+typedef struct AfcDeviceInfo {
+ char *model;
+ size_t total_bytes;
+ size_t free_bytes;
+ size_t block_size;
+} AfcDeviceInfo;
+
/**
* Represents a debugserver command
*/
@@ -353,6 +415,409 @@ enum IdeviceErrorCode adapter_recv(struct AdapterHandle *handle,
uintptr_t *length,
uintptr_t max_length);
+/**
+ * Connects to the AFC service using a TCP provider
+ *
+ * # Arguments
+ * * [`provider`] - A TcpProvider
+ * * [`client`] - On success, will be set to point to a newly allocated AfcClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode afc_client_connect_tcp(struct TcpProviderHandle *provider,
+ struct AfcClientHandle **client);
+
+/**
+ * Connects to the AFC service using a Usbmuxd provider
+ *
+ * # Arguments
+ * * [`provider`] - A UsbmuxdProvider
+ * * [`client`] - On success, will be set to point to a newly allocated AfcClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode afc_client_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
+ struct AfcClientHandle **client);
+
+/**
+ * Creates a new AfcClient from an existing Idevice connection
+ *
+ * # Arguments
+ * * [`socket`] - An IdeviceSocket handle
+ * * [`client`] - On success, will be set to point to a newly allocated AfcClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `socket` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode afc_client_new(struct IdeviceHandle *socket, struct AfcClientHandle **client);
+
+/**
+ * Frees an AfcClient handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to the handle that was allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void afc_client_free(struct AfcClientHandle *handle);
+
+/**
+ * Lists the contents of a directory on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path to the directory to list (UTF-8 null-terminated)
+ * * [`entries`] - Will be set to point to an array of directory entries
+ * * [`count`] - Will be set to the number of entries
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ * `path` must be a valid null-terminated C string
+ */
+enum IdeviceErrorCode afc_list_directory(struct AfcClientHandle *client,
+ const char *path,
+ char ***entries,
+ size_t *count);
+
+/**
+ * Creates a new directory on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path of the directory to create (UTF-8 null-terminated)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `path` must be a valid null-terminated C string
+ */
+enum IdeviceErrorCode afc_make_directory(struct AfcClientHandle *client, const char *path);
+
+/**
+ * Retrieves information about a file or directory
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path to the file or directory (UTF-8 null-terminated)
+ * * [`info`] - Will be populated with file information
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` and `path` must be valid pointers
+ * `info` must be a valid pointer to an AfcFileInfo struct
+ */
+enum IdeviceErrorCode afc_get_file_info(struct AfcClientHandle *client,
+ const char *path,
+ struct AfcFileInfo *info);
+
+/**
+ * Frees memory allocated by afc_get_file_info
+ *
+ * # Arguments
+ * * [`info`] - Pointer to AfcFileInfo struct to free
+ *
+ * # Safety
+ * `info` must be a valid pointer to an AfcFileInfo struct previously returned by afc_get_file_info
+ */
+void afc_file_info_free(struct AfcFileInfo *info);
+
+/**
+ * Retrieves information about the device's filesystem
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`info`] - Will be populated with device information
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` and `info` must be valid pointers
+ */
+enum IdeviceErrorCode afc_get_device_info(struct AfcClientHandle *client,
+ struct AfcDeviceInfo *info);
+
+/**
+ * Frees memory allocated by afc_get_device_info
+ *
+ * # Arguments
+ * * [`info`] - Pointer to AfcDeviceInfo struct to free
+ *
+ * # Safety
+ * `info` must be a valid pointer to an AfcDeviceInfo struct previously returned by afc_get_device_info
+ */
+void afc_device_info_free(struct AfcDeviceInfo *info);
+
+/**
+ * Removes a file or directory
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path to the file or directory to remove (UTF-8 null-terminated)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `path` must be a valid null-terminated C string
+ */
+enum IdeviceErrorCode afc_remove_path(struct AfcClientHandle *client, const char *path);
+
+/**
+ * Recursively removes a directory and all its contents
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path to the directory to remove (UTF-8 null-terminated)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `path` must be a valid null-terminated C string
+ */
+enum IdeviceErrorCode afc_remove_path_and_contents(struct AfcClientHandle *client,
+ const char *path);
+
+/**
+ * Opens a file on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`path`] - Path to the file to open (UTF-8 null-terminated)
+ * * [`mode`] - File open mode
+ * * [`handle`] - Will be set to a new file handle on success
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ * `path` must be a valid null-terminated C string
+ */
+enum IdeviceErrorCode afc_file_open(struct AfcClientHandle *client,
+ const char *path,
+ enum AfcFopenMode mode,
+ struct AfcFileHandle **handle);
+
+/**
+ * Closes a file handle
+ *
+ * # Arguments
+ * * [`handle`] - File handle to close
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `handle` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode afc_file_close(struct AfcFileHandle *handle);
+
+/**
+ * Reads data from an open file
+ *
+ * # Arguments
+ * * [`handle`] - File handle to read from
+ * * [`data`] - Will be set to point to the read data
+ * * [`length`] - Will be set to the length of the read data
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ */
+enum IdeviceErrorCode afc_file_read(struct AfcFileHandle *handle, uint8_t **data, size_t *length);
+
+/**
+ * Writes data to an open file
+ *
+ * # Arguments
+ * * [`handle`] - File handle to write to
+ * * [`data`] - Data to write
+ * * [`length`] - Length of data to write
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ * `data` must point to at least `length` bytes
+ */
+enum IdeviceErrorCode afc_file_write(struct AfcFileHandle *handle,
+ const uint8_t *data,
+ size_t length);
+
+/**
+ * Creates a hard or symbolic link
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`target`] - Target path of the link (UTF-8 null-terminated)
+ * * [`source`] - Path where the link should be created (UTF-8 null-terminated)
+ * * [`link_type`] - Type of link to create
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ * `target` and `source` must be valid null-terminated C strings
+ */
+enum IdeviceErrorCode afc_make_link(struct AfcClientHandle *client,
+ const char *target,
+ const char *source,
+ enum AfcLinkType link_type);
+
+/**
+ * Renames a file or directory
+ *
+ * # Arguments
+ * * [`client`] - A valid AfcClient handle
+ * * [`source`] - Current path of the file/directory (UTF-8 null-terminated)
+ * * [`target`] - New path for the file/directory (UTF-8 null-terminated)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * All pointers must be valid and non-null
+ * `source` and `target` must be valid null-terminated C strings
+ */
+enum IdeviceErrorCode afc_rename_path(struct AfcClientHandle *client,
+ const char *source,
+ const char *target);
+
+/**
+ * Automatically creates and connects to AMFI service, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A TcpProvider
+ * * [`client`] - On success, will be set to point to a newly allocated AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode amfi_connect_tcp(struct TcpProviderHandle *provider,
+ struct AmfiClientHandle **client);
+
+/**
+ * Automatically creates and connects to AMFI service, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A UsbmuxdProvider
+ * * [`client`] - On success, will be set to point to a newly allocated AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode amfi_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
+ struct AmfiClientHandle **client);
+
+/**
+ * Automatically creates and connects to AMFI service, returning a client handle
+ *
+ * # Arguments
+ * * [`socket`] - An IdeviceSocket handle
+ * * [`client`] - On success, will be set to point to a newly allocated AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `socket` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode amfi_new(struct IdeviceHandle *socket, struct AmfiClientHandle **client);
+
+/**
+ * Shows the option in the settings UI
+ *
+ * # Arguments
+ * * `client` - A valid AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode amfi_reveal_developer_mode_option_in_ui(struct AmfiClientHandle *client);
+
+/**
+ * Enables developer mode on the device
+ *
+ * # Arguments
+ * * `client` - A valid AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode amfi_enable_developer_mode(struct AmfiClientHandle *client);
+
+/**
+ * Accepts developer mode on the device
+ *
+ * # Arguments
+ * * `client` - A valid AmfiClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode amfi_accept_developer_mode(struct AmfiClientHandle *client);
+
+/**
+ * Frees a handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to the handle that was allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void amfi_client_free(struct AmfiClientHandle *handle);
+
/**
* Automatically creates and connects to Core Device Proxy, returning a client handle
*
@@ -775,151 +1240,394 @@ enum IdeviceErrorCode heartbeat_connect_usbmuxd(struct UsbmuxdProviderHandle *pr
struct HeartbeatClientHandle **client);
/**
- * Automatically creates and connects to Installation Proxy, returning a client handle
+ * Automatically creates and connects to Installation Proxy, returning a client handle
+ *
+ * # Arguments
+ * * [`socket`] - An IdeviceSocket handle
+ * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `socket` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode heartbeat_new(struct IdeviceHandle *socket,
+ struct HeartbeatClientHandle **client);
+
+/**
+ * Sends a polo to the device
+ *
+ * # Arguments
+ * * `client` - A valid HeartbeatClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode heartbeat_send_polo(struct HeartbeatClientHandle *client);
+
+/**
+ * Sends a polo to the device
+ *
+ * # Arguments
+ * * `client` - A valid HeartbeatClient handle
+ * * `interval` - The time to wait for a marco
+ * * `new_interval` - A pointer to set the requested marco
+ *
+ * # Returns
+ * An error code indicating success or failure.
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ */
+enum IdeviceErrorCode heartbeat_get_marco(struct HeartbeatClientHandle *client,
+ uint64_t interval,
+ uint64_t *new_interval);
+
+/**
+ * Frees a handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to the handle that was allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void heartbeat_client_free(struct HeartbeatClientHandle *handle);
+
+/**
+ * Automatically creates and connects to Installation Proxy, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A TcpProvider
+ * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode installation_proxy_connect_tcp(struct TcpProviderHandle *provider,
+ struct InstallationProxyClientHandle **client);
+
+/**
+ * Automatically creates and connects to Installation Proxy, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A UsbmuxdProvider
+ * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode installation_proxy_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
+ struct InstallationProxyClientHandle **client);
+
+/**
+ * Automatically creates and connects to Installation Proxy, returning a client handle
+ *
+ * # Arguments
+ * * [`socket`] - An IdeviceSocket handle
+ * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `socket` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode installation_proxy_new(struct IdeviceHandle *socket,
+ struct InstallationProxyClientHandle **client);
+
+/**
+ * Gets installed apps on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`application_type`] - The application type to filter by (optional, NULL for "Any")
+ * * [`bundle_identifiers`] - The identifiers to filter by (optional, NULL for all apps)
+ * * [`out_result`] - On success, will be set to point to a newly allocated array of PlistRef
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `out_result` must be a valid, non-null pointer to a location where the result will be stored
+ */
+enum IdeviceErrorCode installation_proxy_get_apps(struct InstallationProxyClientHandle *client,
+ const char *application_type,
+ const char *const *bundle_identifiers,
+ size_t bundle_identifiers_len,
+ void **out_result,
+ size_t *out_result_len);
+
+/**
+ * Frees a handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to the handle that was allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void installation_proxy_client_free(struct InstallationProxyClientHandle *handle);
+
+/**
+ * Installs an application package on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`package_path`] - Path to the .ipa package in the AFC jail
+ * * [`options`] - Optional installation options as a plist dictionary (can be NULL)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `package_path` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
+ */
+enum IdeviceErrorCode installation_proxy_install(struct InstallationProxyClientHandle *client,
+ const char *package_path,
+ void *options);
+
+/**
+ * Installs an application package on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`package_path`] - Path to the .ipa package in the AFC jail
+ * * [`options`] - Optional installation options as a plist dictionary (can be NULL)
+ * * [`callback`] - Progress callback function
+ * * [`context`] - User context to pass to callback
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `package_path` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
+ */
+enum IdeviceErrorCode installation_proxy_install_with_callback(struct InstallationProxyClientHandle *client,
+ const char *package_path,
+ void *options,
+ void (*callback)(uint64_t progress,
+ void *context),
+ void *context);
+
+/**
+ * Upgrades an existing application on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`package_path`] - Path to the .ipa package in the AFC jail
+ * * [`options`] - Optional upgrade options as a plist dictionary (can be NULL)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `package_path` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
+ */
+enum IdeviceErrorCode installation_proxy_upgrade(struct InstallationProxyClientHandle *client,
+ const char *package_path,
+ void *options);
+
+/**
+ * Upgrades an existing application on the device
*
* # Arguments
- * * [`socket`] - An IdeviceSocket handle
- * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`package_path`] - Path to the .ipa package in the AFC jail
+ * * [`options`] - Optional upgrade options as a plist dictionary (can be NULL)
+ * * [`callback`] - Progress callback function
+ * * [`context`] - User context to pass to callback
*
* # Returns
* An error code indicating success or failure
*
* # Safety
- * `socket` must be a valid pointer to a handle allocated by this library
- * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `package_path` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
*/
-enum IdeviceErrorCode heartbeat_new(struct IdeviceHandle *socket,
- struct HeartbeatClientHandle **client);
+enum IdeviceErrorCode installation_proxy_upgrade_with_callback(struct InstallationProxyClientHandle *client,
+ const char *package_path,
+ void *options,
+ void (*callback)(uint64_t progress,
+ void *context),
+ void *context);
/**
- * Sends a polo to the device
+ * Uninstalls an application from the device
*
* # Arguments
- * * `client` - A valid HeartbeatClient handle
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`bundle_id`] - Bundle identifier of the application to uninstall
+ * * [`options`] - Optional uninstall options as a plist dictionary (can be NULL)
*
* # Returns
* An error code indicating success or failure
*
* # Safety
* `client` must be a valid pointer to a handle allocated by this library
+ * `bundle_id` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
*/
-enum IdeviceErrorCode heartbeat_send_polo(struct HeartbeatClientHandle *client);
+enum IdeviceErrorCode installation_proxy_uninstall(struct InstallationProxyClientHandle *client,
+ const char *bundle_id,
+ void *options);
/**
- * Sends a polo to the device
+ * Uninstalls an application from the device
*
* # Arguments
- * * `client` - A valid HeartbeatClient handle
- * * `interval` - The time to wait for a marco
- * * `new_interval` - A pointer to set the requested marco
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`bundle_id`] - Bundle identifier of the application to uninstall
+ * * [`options`] - Optional uninstall options as a plist dictionary (can be NULL)
+ * * [`callback`] - Progress callback function
+ * * [`context`] - User context to pass to callback
*
* # Returns
- * An error code indicating success or failure.
+ * An error code indicating success or failure
*
* # Safety
* `client` must be a valid pointer to a handle allocated by this library
+ * `bundle_id` must be a valid C string
+ * `options` must be a valid plist dictionary or NULL
*/
-enum IdeviceErrorCode heartbeat_get_marco(struct HeartbeatClientHandle *client,
- uint64_t interval,
- uint64_t *new_interval);
+enum IdeviceErrorCode installation_proxy_uninstall_with_callback(struct InstallationProxyClientHandle *client,
+ const char *bundle_id,
+ void *options,
+ void (*callback)(uint64_t progress,
+ void *context),
+ void *context);
/**
- * Frees a handle
+ * Checks if the device capabilities match the required capabilities
*
* # Arguments
- * * [`handle`] - The handle to free
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`capabilities`] - Array of plist values representing required capabilities
+ * * [`capabilities_len`] - Length of the capabilities array
+ * * [`options`] - Optional check options as a plist dictionary (can be NULL)
+ * * [`out_result`] - Will be set to true if all capabilities are supported, false otherwise
+ *
+ * # Returns
+ * An error code indicating success or failure
*
* # Safety
- * `handle` must be a valid pointer to the handle that was allocated by this library,
- * or NULL (in which case this function does nothing)
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `capabilities` must be a valid array of plist values or NULL
+ * `options` must be a valid plist dictionary or NULL
+ * `out_result` must be a valid pointer to a bool
*/
-void heartbeat_client_free(struct HeartbeatClientHandle *handle);
+enum IdeviceErrorCode installation_proxy_check_capabilities_match(struct InstallationProxyClientHandle *client,
+ void *const *capabilities,
+ size_t capabilities_len,
+ void *options,
+ bool *out_result);
/**
- * Automatically creates and connects to Installation Proxy, returning a client handle
+ * Browses installed applications on the device
*
* # Arguments
- * * [`provider`] - A TcpProvider
- * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ * * [`client`] - A valid InstallationProxyClient handle
+ * * [`options`] - Optional browse options as a plist dictionary (can be NULL)
+ * * [`out_result`] - On success, will be set to point to a newly allocated array of PlistRef
+ * * [`out_result_len`] - Will be set to the length of the result array
*
* # Returns
* An error code indicating success or failure
*
* # Safety
- * `provider` must be a valid pointer to a handle allocated by this library
- * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `options` must be a valid plist dictionary or NULL
+ * `out_result` must be a valid, non-null pointer to a location where the result will be stored
+ * `out_result_len` must be a valid, non-null pointer to a location where the length will be stored
*/
-enum IdeviceErrorCode installation_proxy_connect_tcp(struct TcpProviderHandle *provider,
- struct InstallationProxyClientHandle **client);
+enum IdeviceErrorCode installation_proxy_browse(struct InstallationProxyClientHandle *client,
+ void *options,
+ void **out_result,
+ size_t *out_result_len);
/**
- * Automatically creates and connects to Installation Proxy, returning a client handle
+ * Creates a new ProcessControlClient from a RemoteServerClient
*
* # Arguments
- * * [`provider`] - A UsbmuxdProvider
- * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
+ * * [`server`] - The RemoteServerClient to use
+ * * [`handle`] - Pointer to store the newly created ProcessControlClient handle
*
* # Returns
* An error code indicating success or failure
*
* # Safety
- * `provider` must be a valid pointer to a handle allocated by this library
- * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ * `server` must be a valid pointer to a handle allocated by this library
+ * `handle` must be a valid pointer to a location where the handle will be stored
*/
-enum IdeviceErrorCode installation_proxy_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
- struct InstallationProxyClientHandle **client);
+enum IdeviceErrorCode location_simulation_new(struct RemoteServerAdapterHandle *server,
+ struct LocationSimulationAdapterHandle **handle);
/**
- * Automatically creates and connects to Installation Proxy, returning a client handle
+ * Frees a ProcessControlClient handle
*
* # Arguments
- * * [`socket`] - An IdeviceSocket handle
- * * [`client`] - On success, will be set to point to a newly allocated InstallationProxyClient handle
- *
- * # Returns
- * An error code indicating success or failure
+ * * [`handle`] - The handle to free
*
* # Safety
- * `socket` must be a valid pointer to a handle allocated by this library
- * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ * `handle` must be a valid pointer to a handle allocated by this library or NULL
*/
-enum IdeviceErrorCode installation_proxy_new(struct IdeviceHandle *socket,
- struct InstallationProxyClientHandle **client);
+void location_simulation_free(struct LocationSimulationAdapterHandle *handle);
/**
- * Gets installed apps on the device
+ * Clears the location set
*
* # Arguments
- * * `client` - A valid InstallationProxyClient handle
- * * `application_type` - The application type to filter by (optional, NULL for "Any")
- * * `bundle_identifiers` - The identifiers to filter by (optional, NULL for all apps)
- * * `out_result` - On success, will be set to point to a newly allocated array of PlistRef
+ * * [`handle`] - The LocationSimulation handle
*
* # Returns
* An error code indicating success or failure
*
* # Safety
- * `client` must be a valid pointer to a handle allocated by this library
- * `out_result` must be a valid, non-null pointer to a location where the result will be stored
+ * All pointers must be valid or NULL where appropriate
*/
-enum IdeviceErrorCode installation_proxy_get_apps(struct InstallationProxyClientHandle *client,
- const char *application_type,
- const char *const *bundle_identifiers,
- size_t bundle_identifiers_len,
- void **out_result,
- size_t *out_result_len);
+enum IdeviceErrorCode location_simulation_clear(struct LocationSimulationAdapterHandle *handle);
/**
- * Frees a handle
+ * Sets the location
*
* # Arguments
- * * [`handle`] - The handle to free
+ * * [`handle`] - The LocationSimulation handle
+ * * [`latitude`] - The latitude to set
+ * * [`longitude`] - The longitude to set
+ *
+ * # Returns
+ * An error code indicating success or failure
*
* # Safety
- * `handle` must be a valid pointer to the handle that was allocated by this library,
- * or NULL (in which case this function does nothing)
+ * All pointers must be valid or NULL where appropriate
*/
-void installation_proxy_client_free(struct InstallationProxyClientHandle *handle);
+enum IdeviceErrorCode location_simulation_set(struct LocationSimulationAdapterHandle *handle,
+ double latitude,
+ double longitude);
/**
* Connects to lockdownd service using TCP provider
@@ -1016,7 +1724,8 @@ enum IdeviceErrorCode lockdownd_start_service(struct LockdowndClientHandle *clie
*
* # Arguments
* * `client` - A valid LockdowndClient handle
- * * `value` - The value to get (null-terminated string)
+ * * `key` - The value to get (null-terminated string)
+ * * `domain` - The value to get (null-terminated string)
* * `out_plist` - Pointer to store the returned plist value
*
* # Returns
@@ -1028,7 +1737,8 @@ enum IdeviceErrorCode lockdownd_start_service(struct LockdowndClientHandle *clie
* `out_plist` must be a valid pointer to store the plist
*/
enum IdeviceErrorCode lockdownd_get_value(struct LockdowndClientHandle *client,
- const char *value,
+ const char *key,
+ const char *domain,
void **out_plist);
/**
@@ -1086,6 +1796,121 @@ enum IdeviceLoggerError idevice_init_logger(enum IdeviceLogLevel console_level,
enum IdeviceLogLevel file_level,
char *file_path);
+/**
+ * Automatically creates and connects to Misagent, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A TcpProvider
+ * * [`client`] - On success, will be set to point to a newly allocated MisagentClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode misagent_connect_tcp(struct TcpProviderHandle *provider,
+ struct MisagentClientHandle **client);
+
+/**
+ * Automatically creates and connects to Misagent, returning a client handle
+ *
+ * # Arguments
+ * * [`provider`] - A UsbmuxdProvider
+ * * [`client`] - On success, will be set to point to a newly allocated MisagentClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode misagent_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
+ struct MisagentClientHandle **client);
+
+/**
+ * Installs a provisioning profile on the device
+ *
+ * # Arguments
+ * * [`client`] - A valid MisagentClient handle
+ * * [`profile_data`] - The provisioning profile data to install
+ * * [`profile_len`] - Length of the profile data
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `profile_data` must be a valid pointer to profile data of length `profile_len`
+ */
+enum IdeviceErrorCode misagent_install(struct MisagentClientHandle *client,
+ const uint8_t *profile_data,
+ size_t profile_len);
+
+/**
+ * Removes a provisioning profile from the device
+ *
+ * # Arguments
+ * * [`client`] - A valid MisagentClient handle
+ * * [`profile_id`] - The UUID of the profile to remove (C string)
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `profile_id` must be a valid C string
+ */
+enum IdeviceErrorCode misagent_remove(struct MisagentClientHandle *client, const char *profile_id);
+
+/**
+ * Retrieves all provisioning profiles from the device
+ *
+ * # Arguments
+ * * [`client`] - A valid MisagentClient handle
+ * * [`out_profiles`] - On success, will be set to point to an array of profile data
+ * * [`out_profiles_len`] - On success, will be set to the number of profiles
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `out_profiles` must be a valid pointer to store the resulting array
+ * `out_profiles_len` must be a valid pointer to store the array length
+ */
+enum IdeviceErrorCode misagent_copy_all(struct MisagentClientHandle *client,
+ uint8_t ***out_profiles,
+ size_t **out_profiles_len,
+ size_t *out_count);
+
+/**
+ * Frees profiles array returned by misagent_copy_all
+ *
+ * # Arguments
+ * * [`profiles`] - Array of profile data pointers
+ * * [`lens`] - Array of profile lengths
+ * * [`count`] - Number of profiles in the array
+ *
+ * # Safety
+ * Must only be called with values returned from misagent_copy_all
+ */
+void misagent_free_profiles(uint8_t **profiles, size_t *lens, size_t count);
+
+/**
+ * Frees a misagent client handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to a handle allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void misagent_client_free(struct MisagentClientHandle *handle);
+
/**
* Connects to the Image Mounter service using a TCP provider
*
@@ -1911,6 +2736,89 @@ enum IdeviceErrorCode xpc_device_get_service_names(struct XPCDeviceAdapterHandle
*/
void xpc_device_free_service_names(char **names, uintptr_t count);
+/**
+ * Connects to the Springboard service using a TCP provider
+ *
+ * # Arguments
+ * * [`provider`] - A TcpProvider
+ * * [`client`] - On success, will be set to point to a newly allocated SpringBoardServicesClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode springboard_services_connect_tcp(struct TcpProviderHandle *provider,
+ struct SpringBoardServicesClientHandle **client);
+
+/**
+ * Connects to the Springboard service using a usbmuxd provider
+ *
+ * # Arguments
+ * * [`provider`] - A UsbmuxdProvider
+ * * [`client`] - On success, will be set to point to a newly allocated SpringBoardServicesClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `provider` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode springboard_services_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
+ struct SpringBoardServicesClientHandle **client);
+
+/**
+ * Creates a new SpringBoardServices client from an existing Idevice connection
+ *
+ * # Arguments
+ * * [`socket`] - An IdeviceSocket handle
+ * * [`client`] - On success, will be set to point to a newly allocated SpringBoardServicesClient handle
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `socket` must be a valid pointer to a handle allocated by this library
+ * `client` must be a valid, non-null pointer to a location where the handle will be stored
+ */
+enum IdeviceErrorCode springboard_services_new(struct IdeviceHandle *socket,
+ struct SpringBoardServicesClientHandle **client);
+
+/**
+ * Gets the icon of the specified app by bundle identifier
+ *
+ * # Arguments
+ * * `client` - A valid SpringBoardServicesClient handle
+ * * `bundle_identifier` - The identifiers of the app to get icon
+ * * `out_result` - On success, will be set to point to a newly allocated png data
+ *
+ * # Returns
+ * An error code indicating success or failure
+ *
+ * # Safety
+ * `client` must be a valid pointer to a handle allocated by this library
+ * `out_result` must be a valid, non-null pointer to a location where the result will be stored
+ */
+enum IdeviceErrorCode springboard_services_get_icon(struct SpringBoardServicesClientHandle *client,
+ const char *bundle_identifier,
+ void **out_result,
+ size_t *out_result_len);
+
+/**
+ * Frees an SpringBoardServicesClient handle
+ *
+ * # Arguments
+ * * [`handle`] - The handle to free
+ *
+ * # Safety
+ * `handle` must be a valid pointer to the handle that was allocated by this library,
+ * or NULL (in which case this function does nothing)
+ */
+void springboard_services_free(struct SpringBoardServicesClientHandle *handle);
+
/**
* Connects to a usbmuxd instance over TCP
*
@@ -2011,35 +2919,4 @@ enum IdeviceErrorCode idevice_usbmuxd_unix_addr_new(const char *addr,
*/
void idevice_usbmuxd_addr_free(struct UsbmuxdAddrHandle *usbmuxd_addr);
-enum IdeviceErrorCode springboard_services_connect_tcp(struct TcpProviderHandle *provider,
- struct SpringBoardServicesClientHandle **client);
-
-enum IdeviceErrorCode springboard_services_connect_usbmuxd(struct UsbmuxdProviderHandle *provider,
- struct SpringBoardServicesClientHandle **client);
-
-enum IdeviceErrorCode springboard_services_new(struct IdeviceHandle *socket,
- struct SpringBoardServicesClientHandle **client);
-
-/**
- * Gets the icon of the specified app by bundle identifier
- *
- * # Arguments
- * * `client` - A valid SpringBoardServicesClient handle
- * * `bundle_identifier` - The identifiers of the app to get icon
- * * `out_result` - On success, will be set to point to a newly allocated png data
- *
- * # Returns
- * An error code indicating success or failure
- *
- * # Safety
- * `client` must be a valid pointer to a handle allocated by this library
- * `out_result` must be a valid, non-null pointer to a location where the result will be stored
- */
-enum IdeviceErrorCode springboard_services_get_icon(struct SpringBoardServicesClientHandle *client,
- const char *bundle_identifier,
- void **out_result,
- size_t *out_result_len);
-
-void springboard_services_free(struct SpringBoardServicesClientHandle *handle);
-
#endif
diff --git a/StikJIT/idevice/libidevice_ffi.a b/StikJIT/idevice/libidevice_ffi.a
index 594e0ef9..c84186c8 100644
Binary files a/StikJIT/idevice/libidevice_ffi.a and b/StikJIT/idevice/libidevice_ffi.a differ