Skip to main content

Session

Struct Session 

Source
pub struct Session<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Session<'a>

Source

pub unsafe fn mound_disk_with_callback<T>( &self, image: &String, options: &Dictionary, callback: *const MountCallback<T>, ctx: *mut T, ) -> Error

Source

pub fn mount_developer_image(&self) -> Result<(), Error>

Source

pub fn mound_disk( &self, image_path: &String, options: &Dictionary, ) -> Result<(), Error>

Source

pub fn relay_file(&self, source: &String, options: &Dictionary) -> Error

Copy a file from the relay service. Options must contain:

kAMDRelayTypeKey: one of kAMDRelayTypeFileDescriptor kAMDRelayTypeData

Source§

impl<'a> Session<'a>

Source

pub fn lookup_apps(&self, options: &Dictionary) -> Result<R<Dictionary>, Error>

Lookup the set of installed applications on the device.

The info argument will point to a cf::Dictionary. Each key in the dictionary is an application identifier and the value is the Info.plist of the installed application.

The client can specify options to filter the results. If the value of kLookupAttributeKey is: IMPORTANT NOTE: You should specify kLookupReturnAttributesKey in the options dictionary with an array value containing those keys you would like returned. If you do not specify this attribute, MobileDevice will log every time you make an offending call and performance will be poor. When specifying this key, you MUST include at least kCFBundleIdentifierKey in the array of keys to be returned or the call will not work properly.

Source

pub fn apps_lookup(&'a self) -> AppsLookupBuilder<'a>

Source§

impl<'a> Session<'a>

Source

pub fn secure_start_service( &self, name: &String, ) -> Result<R<ServiceConnection>, Error>

Securely start a service on the device specifying options.

Starts a service on the device. Requires that a session with the device be active. Attempting to start a service without an active session will result in kAMDInvalidArgumentError. Fails with kAMDNoWifiSyncSupportError if the device side service does not support SSL. Fails with kAMDServiceProhibitedError if the service is not allowed to run. Some services are only allowed to run when a device has been activated.

The device may request that a connection be encrypted. If so, this call will also perform the initial SSL handshake. See <MobileDevice/AMDServiceConnection.h> for more information on using the service connection.

§Options

kAMDServiceOptionTimeoutConnection - The service connection will have SO_SNDTIMEO and SO_RCVTIMEO set. It will be closed if either input or output operations fail to complete within 25 seconds (use carefully if you expect your service to perform long-lived operations on your behalf). Valid values are boolean true or false. This is off by default.

kAMDServiceOptionUnlockEscrowBag - Attempt the passcode-unlock the device when starting a service.

kAMDOptionCloseOnInvalidate - The returned service connection will take ownership of the underlying file descriptor and SSL context. Manually closing the fd or SSL_free()’ing the ssl context will result in an double free()s and close()s when the service connection object is invalidate or ultimately released. Valid values are boolean true or false. This is on by default.

On success, the AMDServiceConnection returned in service_out must be CFRelease()’d by the caller.

Source

pub fn start_debug_server(&self) -> Result<R<ServiceConnection>, Error>

Source

pub fn battery_level(&self) -> Option<R<Number>>

Methods from Deref<Target = Connected<'a>>§

Source

pub fn device_support_path(&self) -> Option<PathBuf>

Source

pub unsafe fn copy_value( &self, domain: Option<&String>, key: Option<&String>, ) -> Option<R<Type>>

Source

pub unsafe fn copy_value_with_err( &self, domain: Option<&String>, key: Option<&String>, error_out: &mut Error, ) -> Option<R<Plist>>

Copy a value from the device @param device The device to copy from @param domain The domain to query. May be NULL. @param key The key to query. May be NULL. @param error_out On return, an error code describing the result of the operation. May be NULL. @result A new plist value, or NULL.

Copies a value from the lockdown property store. A key argument of NULL asks for the contents of the whole domain. A domain argument of NULL asks for the global domain. Some properties are unavailable outside of a session.

Returns kAMDDeviceDisconnectedError is the device is no longer attached. Returns kAMDInvalidArgumentError if device is not a valid device ref, or if domain or key arguments are non-NULL and not string.

Source

pub fn try_value( &self, domain: Option<&String>, key: Option<&String>, ) -> Result<R<Plist>, Error>

Source

pub fn domain_value(&self, domain: &String) -> Option<R<Type>>

Source

pub fn value(&self, key: &String) -> Option<R<Type>>

Source

pub fn name(&self) -> R<String>

Source

pub fn cpu_arch(&self) -> R<String>

Source

pub fn hardware_model(&self) -> R<String>

Source

pub fn product_name(&self) -> R<String>

Source

pub fn product_type(&self) -> R<String>

Source

pub fn product_version(&self) -> R<String>

Source

pub fn start_session(&'a self) -> Result<Session<'a>, Error>

Start a session with the device.

You must have paired with the device before you can start a session. A return value of kAMDInvalidPairRecordError is possible if the pair records have been damaged. In this case the pairing records will be discarded and the device connection will be shut down.

To recover: AMDeviceConnect(), AMDeviceUnpair(), AMDevicePair() and try to start a session again.

Methods from Deref<Target = Device>§

Source

pub fn retained(&self) -> R<Self>

Source

pub fn connection_id(&self) -> u32

Source

pub fn id(&self) -> R<String>

Source

pub fn connected<'a>(&'a self) -> Result<Connected<'a>, Error>

Connect to the mobile device.

If you are already connected, this function will attempt to verify that the connection is still open.

Returns Error::WRONG_DROID if the device is in the restore OS.

Source

pub fn is_paired(&self) -> bool

Checks to see whether or not we are paired with the device.

Only checks locally. May return true even if not paired. This may happen if the device has recently been restored. Use AMDeviceValidatePair() to confer with device about pair-ed-ness. Can be done without having a session.

FOR ALMOST ALL USAGES, am::Device::validate_pairing() IS BETTER!

Source

pub fn pair(&self) -> Result<(), Error>

Create a pairing relationship with an iOS device This is equivalent to calling AMDevicePairWithOptions with options set to NULL

Source

pub fn validate_pairing(&self) -> Result<(), Error>

Validate the pairing with the device.

Checks to see if the host and device are paired. Prefer this to am::Device::is_paired(). On success, the device will also be notified that it is attached to a Trusted Host.

Source

pub fn secure_install_app(&self, url: &Url, options: &Dictionary) -> Result

Source

pub fn secure_transfer_path(&self, url: &Url, options: &Dictionary) -> Result

Source

pub fn iface_type(&self) -> IfaceConnectionType

Methods from Deref<Target = Type>§

Source

pub fn get_type_id(&self) -> TypeId

Source

pub unsafe fn as_type_ptr(&self) -> *const c_void

Source

pub fn as_type_ref(&self) -> &Type

Source

pub fn is_tagged_ptr(&self) -> bool

Source

pub fn try_as_number(&self) -> Option<&Number>

Source

pub fn try_as_string(&self) -> Option<&String>

Source

pub fn show(&self)

Source

pub fn allocator(&self) -> Option<&Allocator>

Source

pub fn retain_count(&self) -> isize

Source

pub fn equal(&self, other: &Type) -> bool

use cidre::cf;

let n1 = cf::Number::from_i8(4);
let n2 = cf::Number::from_i32(4);
let n3 = cf::Number::from_f64(3.0);

assert!(n1.equal(&n2));
assert_eq!(false, n1.equal(&n3));
Source

pub fn hash(&self) -> usize

Source

pub fn desc(&self) -> R<String>

Trait Implementations§

Source§

impl<'a> Deref for Session<'a>

Source§

type Target = Connected<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> Drop for Session<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !Send for Session<'a>

§

impl<'a> !Sync for Session<'a>

§

impl<'a> Freeze for Session<'a>

§

impl<'a> RefUnwindSafe for Session<'a>

§

impl<'a> Unpin for Session<'a>

§

impl<'a> UnsafeUnpin for Session<'a>

§

impl<'a> UnwindSafe for Session<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.