Skip to content

Instantly share code, notes, and snippets.

@leminlimez
leminlimez / Domains.md
Last active April 23, 2025 18:56
A deep dive into the iOS backup/restore system

Domains.plist

Documentation of /System/Library/Backup/Domains.plist. File taken from iOS 16.4 iPhone SE 3. The file was removed in iOS 17.0

Values

Values in the plist. Other than SystemDomains, these are not really important and are just here for preservation sake.

A domain in domains.plist contains keys that determine what gets backed up for what types of devices and where (i.e. iCloud vs iTunes). Not all domains have each key. The only 2 keys that must be in every domain are RootPath and RelativePathsToBackupAndRestore. Some domains have the value ShouldDigest. I am not sure exactly what it means but I have included it for documentation purposes.

  • Version: "24.0"
  • SystemDomains: (Dictionary), see below
@leminlimez
leminlimez / BatteryInfo.m
Created October 7, 2023 16:03
Get iOS Battery Info and Temperature
/*
Note: Requires systemgroup.com.apple.powerlog entitlement in order to work.
*/
// get a dictionary of the battery info
NSDictionary* getBatteryInfo()
{
CFDictionaryRef matching = IOServiceMatching("IOPMPowerSource");
io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, matching);
CFMutableDictionaryRef prop = NULL;