Skip to main content

SpringBoardServicesClient

Struct SpringBoardServicesClient 

Source
pub struct SpringBoardServicesClient {
    pub idevice: Idevice,
}
Expand description

Client for interacting with the iOS SpringBoard services

This service provides access to home screen and app icon functionality, such as retrieving app icons.

Fields§

§idevice: Idevice

The underlying device connection with established SpringBoard services

Implementations§

Source§

impl SpringBoardServicesClient

Source

pub fn new(idevice: Idevice) -> Self

Creates a new SpringBoard services client from an existing device connection

§Arguments
  • idevice - Pre-established device connection
Source

pub async fn get_icon_pngdata( &mut self, bundle_identifier: String, ) -> Result<Vec<u8>, IdeviceError>

Retrieves the PNG icon data for a specified app

§Arguments
  • bundle_identifier - The bundle identifier of the app (e.g., “com.apple.Maps”)
§Returns

The raw PNG data of the app icon

§Errors

Returns IdeviceError if:

  • Communication fails
  • The app doesn’t exist
  • The response is malformed
§Example
let icon_data = client.get_icon_pngdata("com.apple.Maps".to_string()).await?;
std::fs::write("maps_icon.png", icon_data)?;
Source

pub async fn get_icon_state( &mut self, format_version: Option<&str>, ) -> Result<Value, IdeviceError>

Retrieves the current icon state from the device

The icon state contains the layout and organization of all apps on the home screen, including folder structures and icon positions. This is a read-only operation.

§Arguments
  • format_version - Optional format version string for the icon state format
§Returns

A plist Value containing the complete icon state structure

§Errors

Returns IdeviceError if:

  • Communication fails
  • The response is malformed
§Example
use idevice::services::springboardservices::SpringBoardServicesClient;

let mut client = SpringBoardServicesClient::connect(&provider).await?;
let icon_state = client.get_icon_state(None).await?;
println!("Icon state: {:?}", icon_state);
§Notes

This method successfully reads the home screen layout on all iOS versions.

Source

pub async fn set_icon_state( &mut self, icon_state: Value, ) -> Result<(), IdeviceError>

Sets the icon state on the device

This method allows you to modify the home screen layout by providing a new icon state. The icon state structure should match the format returned by get_icon_state.

§Arguments
  • icon_state - A plist Value containing the complete icon state structure
§Returns

Ok(()) if the icon state was successfully set

§Errors

Returns IdeviceError if:

  • Communication fails
  • The icon state format is invalid
  • The device rejects the new layout
§Example
use idevice::services::springboardservices::SpringBoardServicesClient;

let mut client = SpringBoardServicesClient::connect(&provider).await?;
let mut icon_state = client.get_icon_state(None).await?;

// Modify the icon state (e.g., swap two icons)
// ... modify icon_state ...

client.set_icon_state(icon_state).await?;
println!("Icon state updated successfully");
§Notes
  • Changes take effect immediately
  • The device may validate the icon state structure before applying
  • Invalid icon states will be rejected by the device
Source

pub async fn set_icon_state_with_version( &mut self, icon_state: Value, format_version: Option<&str>, ) -> Result<(), IdeviceError>

Sets the icon state with a specific format version

This is similar to set_icon_state but allows specifying a format version.

§Arguments
  • icon_state - A plist Value containing the complete icon state structure
  • format_version - Optional format version string
§Returns

Ok(()) if the icon state was successfully set

§Errors

Returns IdeviceError if:

  • Communication fails
  • The icon state format is invalid
  • The device rejects the new layout
Source

pub async fn get_home_screen_wallpaper_preview_pngdata( &mut self, ) -> Result<Vec<u8>, IdeviceError>

Gets the home screen wallpaper preview as PNG data

This gets a rendered preview of the home screen wallpaper.

§Returns

The raw PNG data of the home screen wallpaper preview

§Errors

Returns IdeviceError if:

  • Communication fails
  • The device rejects the request
  • The image is malformed/corupted
§Example
let wallpaper = client.get_home_screen_wallpaper_preview_pngdata().await?;
std::fs::write("home.png", wallpaper)?;
Source

pub async fn get_lock_screen_wallpaper_preview_pngdata( &mut self, ) -> Result<Vec<u8>, IdeviceError>

Gets the lock screen wallpaper preview as PNG data

This gets a rendered preview of the lock screen wallpaper.

§Returns

The raw PNG data of the lock screen wallpaper preview

§Errors

Returns IdeviceError if:

  • Communication fails
  • The device rejects the request
  • The image is malformed/corupted
§Example
let wallpaper = client.get_lock_screen_wallpaper_preview_pngdata().await?;
std::fs::write("lock.png", wallpaper)?;
Source

pub async fn get_interface_orientation( &mut self, ) -> Result<InterfaceOrientation, IdeviceError>

Gets the current interface orientation of the device

This gets which way the device is currently facing

§Returns

The current InterfaceOrientation of the device

§Errors

Returns IdeviceError if:

  • Communication fails
  • The device doesn’t support this command
  • The response format is unexpected
§Example
let orientation = client.get_interface_orientation().await?;
println!("Device orientation: {:?}", orientation);
Source

pub async fn get_homescreen_icon_metrics( &mut self, ) -> Result<Dictionary, IdeviceError>

Gets the home screen icon layout metrics

Returns icon spacing, size, and positioning information

§Returns

A plist::Dictionary containing the icon layout metrics

§Errors

Returns IdeviceError if:

  • Communication fails
  • The response is malformed
§Example
let metrics = client.get_homescreen_icon_metrics().await?;
println!("{:?}", metrics);

Trait Implementations§

Source§

impl Debug for SpringBoardServicesClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IdeviceService for SpringBoardServicesClient

Source§

fn service_name() -> Cow<'static, str>

Returns the SpringBoard services name as registered with lockdownd

Source§

async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>

Source§

async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>

Establishes a connection to this service Read more
Source§

impl RsdService for SpringBoardServicesClient

Available on crate feature rsd only.
Source§

fn rsd_service_name() -> Cow<'static, str>

Source§

async fn from_stream(stream: Box<dyn ReadWrite>) -> Result<Self, IdeviceError>

Source§

fn connect_rsd( provider: &mut impl RsdProvider, handshake: &mut RsdHandshake, ) -> impl Future<Output = Result<Self, IdeviceError>>
where Self: RsdService,

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more