Example #1
0
        /// <summary>
        /// Creates a new <see cref="MisagentClientHandle"/> from a <see cref="IntPtr"/>.
        /// </summary>
        /// <param name="unsafeHandle">
        /// The underlying <see cref="IntPtr"/>
        /// </param>
        /// <param name="ownsHandle">
        /// <see langword="true"/> to reliably release the handle during the finalization phase; <see langword="false"/> to prevent reliable release (not recommended).
        /// </param>
        /// <returns>
        /// </returns>
        public static MisagentClientHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle)
        {
            MisagentClientHandle safeHandle = new MisagentClientHandle(ownsHandle);

            safeHandle.SetHandle(unsafeHandle);
            return(safeHandle);
        }
Example #2
0
        /// <summary>
        /// Retrieves all installed provisioning profiles (iOS 9.3 or higher).
        /// </summary>
        /// <param name="client">
        /// The connected misagent to use.
        /// </param>
        /// <param name="profiles">
        /// Pointer to a plist_t that will be set to a PLIST_ARRAY
        /// if the function is successful.
        /// </param>
        /// <returns>
        /// MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
        /// client is invalid, or an MISAGENT_E_* error code otherwise.
        /// </returns>
        /// <remarks>
        /// This API call only works with iOS 9.3 or higher.
        /// For older iOS versions use misagent_copy() instead.
        /// If no provisioning profiles are installed on the device, this function
        /// still returns MISAGENT_E_SUCCESS and profiles will just point to an
        /// empty array.
        /// </remarks>
        public virtual MisagentError misagent_copy_all(MisagentClientHandle client, out PlistHandle profiles)
        {
            MisagentError returnValue;

            returnValue  = MisagentNativeMethods.misagent_copy_all(client, out profiles);
            profiles.Api = this.Parent;
            return(returnValue);
        }
 public object MarshalNativeToManaged(System.IntPtr nativeData)
 {
     return(MisagentClientHandle.DangerousCreate(nativeData, false));
 }
Example #4
0
        /// <summary>
        /// Starts a new misagent service on the specified device and connects to it.
        /// </summary>
        /// <param name="device">
        /// The device to connect to.
        /// </param>
        /// <param name="client">
        /// Pointer that will point to a newly allocated
        /// misagent_client_t upon successful return. Must be freed using
        /// misagent_client_free() after use.
        /// </param>
        /// <param name="label">
        /// The label to use for communication. Usually the program name.
        /// Pass NULL to disable sending the label in requests to lockdownd.
        /// </param>
        /// <returns>
        /// MISAGENT_E_SUCCESS on success, or an MISAGENT_E_* error
        /// code otherwise.
        /// </returns>
        public virtual MisagentError misagent_client_start_service(iDeviceHandle device, out MisagentClientHandle client, string label)
        {
            MisagentError returnValue;

            returnValue = MisagentNativeMethods.misagent_client_start_service(device, out client, label);
            client.Api  = this.Parent;
            return(returnValue);
        }
Example #5
0
        /// <summary>
        /// Connects to the misagent service on the specified device.
        /// </summary>
        /// <param name="device">
        /// The device to connect to.
        /// </param>
        /// <param name="service">
        /// The service descriptor returned by lockdownd_start_service.
        /// </param>
        /// <param name="client">
        /// Pointer that will point to a newly allocated
        /// misagent_client_t upon successful return.
        /// </param>
        /// <returns>
        /// MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
        /// client is NULL, or an MISAGENT_E_* error code otherwise.
        /// </returns>
        public virtual MisagentError misagent_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MisagentClientHandle client)
        {
            MisagentError returnValue;

            returnValue = MisagentNativeMethods.misagent_client_new(device, service, out client);
            client.Api  = this.Parent;
            return(returnValue);
        }
Example #6
0
 /// <summary>
 /// Retrieves the status code from the last operation.
 /// </summary>
 /// <param name="client">
 /// The misagent to use.
 /// </param>
 /// <returns>
 /// -1 if client is invalid, or the status code from the last operation
 /// </returns>
 public virtual int misagent_get_status_code(MisagentClientHandle client)
 {
     return(MisagentNativeMethods.misagent_get_status_code(client));
 }
Example #7
0
 /// <summary>
 /// Removes a given provisioning profile.
 /// </summary>
 /// <param name="client">
 /// The connected misagent to use.
 /// </param>
 /// <param name="profileID">
 /// Identifier of the provisioning profile to remove.
 /// This is a UUID that can be obtained from the provisioning profile data.
 /// </param>
 /// <returns>
 /// MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
 /// client is invalid, or an MISAGENT_E_* error code otherwise.
 /// </returns>
 public virtual MisagentError misagent_remove(MisagentClientHandle client, string profileid)
 {
     return(MisagentNativeMethods.misagent_remove(client, profileid));
 }
Example #8
0
 /// <summary>
 /// Installs the given provisioning profile. Only works with valid profiles.
 /// </summary>
 /// <param name="client">
 /// The connected misagent to use for installation
 /// </param>
 /// <param name="profile">
 /// The valid provisioning profile to install. This has to be
 /// passed as a PLIST_DATA, otherwise the function will fail.
 /// </param>
 /// <returns>
 /// MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
 /// client is invalid, or an MISAGENT_E_* error code otherwise.
 /// </returns>
 public virtual MisagentError misagent_install(MisagentClientHandle client, PlistHandle profile)
 {
     return(MisagentNativeMethods.misagent_install(client, profile));
 }
Example #9
0
 /// <summary>
 /// Creates a new <see cref="MisagentClientHandle"/> from a <see cref="IntPtr"/>.
 /// </summary>
 /// <param name="unsafeHandle">
 /// The underlying <see cref="IntPtr"/>
 /// </param>
 /// <returns>
 /// </returns>
 public static MisagentClientHandle DangerousCreate(System.IntPtr unsafeHandle)
 {
     return(MisagentClientHandle.DangerousCreate(unsafeHandle, true));
 }
Example #10
0
 public static extern MisagentError misagent_install(MisagentClientHandle client, PlistHandle profile);
Example #11
0
 public static extern MisagentError misagent_client_start_service(iDeviceHandle device, out MisagentClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string label);
Example #12
0
 public static extern MisagentError misagent_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MisagentClientHandle client);
Example #13
0
 public static extern int misagent_get_status_code(MisagentClientHandle client);
Example #14
0
 public static extern MisagentError misagent_remove(MisagentClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string profileid);
Example #15
0
 public static extern MisagentError misagent_copy_all(MisagentClientHandle client, out PlistHandle profiles);