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: IdeviceThe underlying device connection with established SpringBoard services
Implementations§
Source§impl SpringBoardServicesClient
impl SpringBoardServicesClient
Sourcepub fn new(idevice: Idevice) -> Self
pub fn new(idevice: Idevice) -> Self
Creates a new SpringBoard services client from an existing device connection
§Arguments
idevice- Pre-established device connection
Sourcepub async fn get_icon_pngdata(
&mut self,
bundle_identifier: String,
) -> Result<Vec<u8>, IdeviceError>
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)?;Sourcepub async fn get_icon_state(
&mut self,
format_version: Option<&str>,
) -> Result<Value, IdeviceError>
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.
Sourcepub async fn set_icon_state(
&mut self,
icon_state: Value,
) -> Result<(), IdeviceError>
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
Sourcepub async fn set_icon_state_with_version(
&mut self,
icon_state: Value,
format_version: Option<&str>,
) -> Result<(), IdeviceError>
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 structureformat_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
Sourcepub async fn get_home_screen_wallpaper_preview_pngdata(
&mut self,
) -> Result<Vec<u8>, IdeviceError>
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)?;Sourcepub async fn get_lock_screen_wallpaper_preview_pngdata(
&mut self,
) -> Result<Vec<u8>, IdeviceError>
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)?;Sourcepub async fn get_interface_orientation(
&mut self,
) -> Result<InterfaceOrientation, IdeviceError>
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);Sourcepub async fn get_homescreen_icon_metrics(
&mut self,
) -> Result<Dictionary, IdeviceError>
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
impl Debug for SpringBoardServicesClient
Source§impl IdeviceService for SpringBoardServicesClient
impl IdeviceService for SpringBoardServicesClient
Source§fn service_name() -> Cow<'static, str>
fn service_name() -> Cow<'static, str>
Returns the SpringBoard services name as registered with lockdownd
async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>
Source§async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
Source§impl RsdService for SpringBoardServicesClient
Available on crate feature rsd only.
impl RsdService for SpringBoardServicesClient
rsd only.