Пример #1
0
        /// <summary>
        /// Creates a new <see cref="HouseArrestClientHandle"/> 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 HouseArrestClientHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle)
        {
            HouseArrestClientHandle safeHandle = new HouseArrestClientHandle(ownsHandle);

            safeHandle.SetHandle(unsafeHandle);
            return(safeHandle);
        }
Пример #2
0
        /// <summary>
        /// Creates an AFC client using the given house_arrest client's connection
        /// allowing file access to a specific application directory requested by
        /// functions like house_arrest_request_vendor_documents().
        /// </summary>
        /// <param name="client">
        /// The house_arrest client to use.
        /// </param>
        /// <param name="afc_client">
        /// Pointer that will be set to a newly allocated afc_client_t
        /// upon successful return.
        /// </param>
        /// <returns>
        /// AFC_E_SUCCESS if the afc client was successfully created,
        /// AFC_E_INVALID_ARG if client is invalid or was already used to create
        /// an afc client, or an AFC_E_* error code returned by
        /// afc_client_new_with_service_client().
        /// </returns>
        /// <remarks>
        /// After calling this function the house_arrest client will go in an
        /// AFC mode that will only allow calling house_arrest_client_free().
        /// Only call house_arrest_client_free() if all AFC operations have
        /// completed since it will close the connection.
        /// </remarks>
        public virtual AfcError afc_client_new_from_house_arrest_client(HouseArrestClientHandle client, out AfcClientHandle afcClient)
        {
            AfcError returnValue;

            returnValue   = HouseArrestNativeMethods.afc_client_new_from_house_arrest_client(client, out afcClient);
            afcClient.Api = this.Parent;
            return(returnValue);
        }
Пример #3
0
        /// <summary>
        /// Retrieves the result of a previously sent house_arrest_request_* request.
        /// </summary>
        /// <param name="client">
        /// The house_arrest client to use
        /// </param>
        /// <param name="dict">
        /// Pointer that will be set to a plist containing the result to
        /// the last performed operation. It holds a key 'Status' with the value
        /// 'Complete' on success or a key 'Error' with an error description as
        /// value. The caller is responsible for freeing the returned plist.
        /// </param>
        /// <returns>
        /// HOUSE_ARREST_E_SUCCESS if a result plist was retrieved,
        /// HOUSE_ARREST_E_INVALID_ARG if client is invalid,
        /// HOUSE_ARREST_E_INVALID_MODE if the client is not in the correct mode,
        /// or HOUSE_ARREST_E_CONN_FAILED if a connection error occurred.
        /// </returns>
        public virtual HouseArrestError house_arrest_get_result(HouseArrestClientHandle client, out PlistHandle dict)
        {
            HouseArrestError returnValue;

            returnValue = HouseArrestNativeMethods.house_arrest_get_result(client, out dict);
            dict.Api    = this.Parent;
            return(returnValue);
        }
Пример #4
0
        /// <summary>
        /// Starts a new house_arrest 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
        /// house_arrest_client_t upon successful return. Must be freed using
        /// house_arrest_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>
        /// HOUSE_ARREST_E_SUCCESS on success, or an HOUSE_ARREST_E_* error
        /// code otherwise.
        /// </returns>
        public virtual HouseArrestError house_arrest_client_start_service(iDeviceHandle device, out HouseArrestClientHandle client, string label)
        {
            HouseArrestError returnValue;

            returnValue = HouseArrestNativeMethods.house_arrest_client_start_service(device, out client, label);
            client.Api  = this.Parent;
            return(returnValue);
        }
Пример #5
0
        /// <summary>
        /// Connects to the house_arrest 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
        /// housearrest_client_t upon successful return.
        /// </param>
        /// <returns>
        /// HOUSE_ARREST_E_SUCCESS on success, HOUSE_ARREST_E_INVALID_ARG when
        /// client is NULL, or an HOUSE_ARREST_E_* error code otherwise.
        /// </returns>
        public virtual HouseArrestError house_arrest_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out HouseArrestClientHandle client)
        {
            HouseArrestError returnValue;

            returnValue = HouseArrestNativeMethods.house_arrest_client_new(device, service, out client);
            client.Api  = this.Parent;
            return(returnValue);
        }
Пример #6
0
 /// <summary>
 /// Send a command to the connected house_arrest service.
 /// Calls house_arrest_send_request() internally.
 /// </summary>
 /// <param name="client">
 /// The house_arrest client to use.
 /// </param>
 /// <param name="command">
 /// The command to send. Currently, only VendContainer and
 /// VendDocuments are known.
 /// </param>
 /// <param name="appid">
 /// The application identifier to pass along with the .
 /// </param>
 /// <returns>
 /// HOUSE_ARREST_E_SUCCESS if the command was successfully sent,
 /// HOUSE_ARREST_E_INVALID_ARG if client, command, or appid is invalid,
 /// HOUSE_ARREST_E_INVALID_MODE if the client is not in the correct mode,
 /// or HOUSE_ARREST_E_CONN_FAILED if a connection error occurred.
 /// </returns>
 /// <remarks>
 /// If this function returns HOUSE_ARREST_E_SUCCESS it does not mean
 /// that the command was successful. To check for success or failure you
 /// need to call house_arrest_get_result().
 /// </remarks>
 public virtual HouseArrestError house_arrest_send_command(HouseArrestClientHandle client, string command, string appid)
 {
     return(HouseArrestNativeMethods.house_arrest_send_command(client, command, appid));
 }
Пример #7
0
 /// <summary>
 /// Sends a generic request to the connected house_arrest service.
 /// </summary>
 /// <param name="client">
 /// The house_arrest client to use.
 /// </param>
 /// <param name="dict">
 /// The request to send as a plist of type PLIST_DICT.
 /// </param>
 /// <returns>
 /// HOUSE_ARREST_E_SUCCESS if the request was successfully sent,
 /// HOUSE_ARREST_E_INVALID_ARG if client or dict is invalid,
 /// HOUSE_ARREST_E_PLIST_ERROR if dict is not a plist of type PLIST_DICT,
 /// HOUSE_ARREST_E_INVALID_MODE if the client is not in the correct mode,
 /// or HOUSE_ARREST_E_CONN_FAILED if a connection error occurred.
 /// </returns>
 /// <remarks>
 /// If this function returns HOUSE_ARREST_E_SUCCESS it does not mean
 /// that the request was successful. To check for success or failure you
 /// need to call house_arrest_get_result().
 /// </remarks>
 public virtual HouseArrestError house_arrest_send_request(HouseArrestClientHandle client, PlistHandle dict)
 {
     return(HouseArrestNativeMethods.house_arrest_send_request(client, dict));
 }
Пример #8
0
 public static extern HouseArrestError house_arrest_client_start_service(iDeviceHandle device, out HouseArrestClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string label);
Пример #9
0
 public static extern HouseArrestError house_arrest_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out HouseArrestClientHandle client);
Пример #10
0
 public static extern AfcError afc_client_new_from_house_arrest_client(HouseArrestClientHandle client, out AfcClientHandle afcClient);
Пример #11
0
 public static extern HouseArrestError house_arrest_get_result(HouseArrestClientHandle client, out PlistHandle dict);
Пример #12
0
 public static extern HouseArrestError house_arrest_send_command(HouseArrestClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string command, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string appid);
Пример #13
0
 public static extern HouseArrestError house_arrest_send_request(HouseArrestClientHandle client, PlistHandle dict);
Пример #14
0
 public object MarshalNativeToManaged(System.IntPtr nativeData)
 {
     return(HouseArrestClientHandle.DangerousCreate(nativeData, false));
 }
Пример #15
0
 /// <summary>
 /// Creates a new <see cref="HouseArrestClientHandle"/> from a <see cref="IntPtr"/>.
 /// </summary>
 /// <param name="unsafeHandle">
 /// The underlying <see cref="IntPtr"/>
 /// </param>
 /// <returns>
 /// </returns>
 public static HouseArrestClientHandle DangerousCreate(System.IntPtr unsafeHandle)
 {
     return(HouseArrestClientHandle.DangerousCreate(unsafeHandle, true));
 }