示例#1
0
        /// <summary>
        /// Creates a new <see cref="MobileactivationClientHandle"/> 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 MobileactivationClientHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle)
        {
            MobileactivationClientHandle safeHandle = new MobileactivationClientHandle(ownsHandle);

            safeHandle.SetHandle(unsafeHandle);
            return(safeHandle);
        }
        /// <summary>
        /// Retrieves the device's activation state.
        /// </summary>
        /// <param name="client">
        /// The mobileactivation client.
        /// </param>
        /// <param name="state">
        /// Pointer to a plist_t variable that will be set to the
        /// activation state reported by the mobileactivation service. The
        /// consumer is responsible for freeing the returned object using
        /// plist_free().
        /// </param>
        /// <returns>
        /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
        /// error code otherwise.
        /// </returns>
        public virtual MobileactivationError mobileactivation_get_activation_state(MobileactivationClientHandle client, out PlistHandle state)
        {
            MobileactivationError returnValue;

            returnValue = MobileactivationNativeMethods.mobileactivation_get_activation_state(client, out state);
            state.Api   = this.Parent;
            return(returnValue);
        }
        /// <summary>
        /// Retrieves the activation info required for device activation.
        /// </summary>
        /// <param name="client">
        /// The mobileactivation client
        /// </param>
        /// <param name="info">
        /// Pointer to a plist_t variable that will be set to the
        /// activation info created by the mobileactivation service. The
        /// consumer is responsible for freeing the returned object using
        /// plist_free().
        /// </param>
        /// <returns>
        /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
        /// error code otherwise.
        /// </returns>
        public virtual MobileactivationError mobileactivation_create_activation_info(MobileactivationClientHandle client, out PlistHandle info)
        {
            MobileactivationError returnValue;

            returnValue = MobileactivationNativeMethods.mobileactivation_create_activation_info(client, out info);
            info.Api    = this.Parent;
            return(returnValue);
        }
 public static extern MobileactivationError mobileactivation_activate_with_session(MobileactivationClientHandle client, PlistHandle activationRecord, PlistHandle headers);
 public static extern MobileactivationError mobileactivation_activate(MobileactivationClientHandle client, PlistHandle activationRecord);
 public static extern MobileactivationError mobileactivation_create_activation_info_with_session(MobileactivationClientHandle client, PlistHandle handshakeResponse, out PlistHandle info);
 public static extern MobileactivationError mobileactivation_create_activation_info(MobileactivationClientHandle client, out PlistHandle info);
 public static extern MobileactivationError mobileactivation_get_activation_state(MobileactivationClientHandle client, out PlistHandle state);
 public static extern MobileactivationError mobileactivation_client_start_service(iDeviceHandle device, out MobileactivationClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string label);
        /// <summary>
        /// Connects to the mobileactivation 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">
        /// Reference that will point to a newly allocated
        /// mobileactivation_client_t upon successful return.
        /// </param>
        /// <returns>
        /// MOBILEACTIVATION_E_SUCCESS on success,
        /// MOBILEACTIVATION_E_INVALID_ARG when one of the parameters is invalid,
        /// or MOBILEACTIVATION_E_MUX_ERROR when the connection failed.
        /// </returns>
        public virtual MobileactivationError mobileactivation_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileactivationClientHandle client)
        {
            MobileactivationError returnValue;

            returnValue = MobileactivationNativeMethods.mobileactivation_client_new(device, service, out client);
            client.Api  = this.Parent;
            return(returnValue);
        }
 /// <summary>
 /// Deactivates the device.
 /// </summary>
 /// <param name="client">
 /// The mobileactivation client
 /// </param>
 public virtual MobileactivationError mobileactivation_deactivate(MobileactivationClientHandle client)
 {
     return(MobileactivationNativeMethods.mobileactivation_deactivate(client));
 }
 /// <summary>
 /// Activates the device with the given activation record in 'session' mode.
 /// The activation record plist must be obtained using the
 /// activation protocol requesting from Apple's https webservice.
 /// </summary>
 /// <param name="client">
 /// The mobileactivation client
 /// </param>
 /// <param name="activation_record">
 /// The activation record in plist format
 /// </param>
 /// <param name="headers">
 /// A plist dictionary with the activation response headers
 /// as returned from Apple's https webservice with the activation record
 /// </param>
 /// <returns>
 /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
 /// error code otherwise.
 /// </returns>
 public virtual MobileactivationError mobileactivation_activate_with_session(MobileactivationClientHandle client, PlistHandle activationRecord, PlistHandle headers)
 {
     return(MobileactivationNativeMethods.mobileactivation_activate_with_session(client, activationRecord, headers));
 }
 /// <summary>
 /// Activates the device with the given activation record.
 /// The activation record plist dictionary must be obtained using the
 /// activation protocol requesting from Apple's https webservice.
 /// </summary>
 /// <param name="client">
 /// The mobileactivation client
 /// </param>
 /// <param name="activation_record">
 /// The activation record plist dictionary
 /// </param>
 /// <returns>
 /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
 /// error code otherwise.
 /// </returns>
 public virtual MobileactivationError mobileactivation_activate(MobileactivationClientHandle client, PlistHandle activationRecord)
 {
     return(MobileactivationNativeMethods.mobileactivation_activate(client, activationRecord));
 }
        /// <summary>
        /// Retrieves the activation info required for device activation in 'session'
        /// mode. This function expects a handshake result retrieved from
        /// https://albert.apple.com/deviceservies/drmHandshake  with a blob
        /// provided by mobileactivation_create_activation_session_info().
        /// </summary>
        /// <param name="client">
        /// The mobileactivation client
        /// </param>
        /// <param name="handshake_result">
        /// The handshake result returned from drmHandshake
        /// </param>
        /// <param name="info">
        /// Pointer to a plist_t variable that will be set to the
        /// activation info created by the mobileactivation service. The
        /// consumer is responsible for freeing the returned object using
        /// plist_free().
        /// </param>
        /// <returns>
        /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
        /// error code otherwise.
        /// </returns>
        public virtual MobileactivationError mobileactivation_create_activation_info_with_session(MobileactivationClientHandle client, PlistHandle handshakeResult, out PlistHandle info)
        {
            MobileactivationError returnValue;

            returnValue = MobileactivationNativeMethods.mobileactivation_create_activation_info_with_session(client, handshakeResult, out info);
            info.Api    = this.Parent;
            return(returnValue);
        }
 public static extern MobileactivationError mobileactivation_deactivate(MobileactivationClientHandle client);
 public static extern MobileactivationError mobileactivation_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileactivationClientHandle client);
        /// <summary>
        /// Starts a new mobileactivation 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
        /// mobileactivation_client_t upon successful return. Must be freed using
        /// mobileactivation_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>
        /// MOBILEACTIVATION_E_SUCCESS on success, or an MOBILEACTIVATION_E_*
        /// error code otherwise.
        /// </returns>
        public virtual MobileactivationError mobileactivation_client_start_service(iDeviceHandle device, out MobileactivationClientHandle client, string label)
        {
            MobileactivationError returnValue;

            returnValue = MobileactivationNativeMethods.mobileactivation_client_start_service(device, out client, label);
            client.Api  = this.Parent;
            return(returnValue);
        }
示例#18
0
 public object MarshalNativeToManaged(System.IntPtr nativeData)
 {
     return(MobileactivationClientHandle.DangerousCreate(nativeData, false));
 }
示例#19
0
 /// <summary>
 /// Creates a new <see cref="MobileactivationClientHandle"/> from a <see cref="IntPtr"/>.
 /// </summary>
 /// <param name="unsafeHandle">
 /// The underlying <see cref="IntPtr"/>
 /// </param>
 /// <returns>
 /// </returns>
 public static MobileactivationClientHandle DangerousCreate(System.IntPtr unsafeHandle)
 {
     return(MobileactivationClientHandle.DangerousCreate(unsafeHandle, true));
 }