pymobiledevice3 5.0.0__py3-none-any.whl → 5.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymobiledevice3 might be problematic. Click here for more details.
- misc/plist_sniffer.py +15 -15
- misc/remotexpc_sniffer.py +29 -28
- pymobiledevice3/__main__.py +128 -102
- pymobiledevice3/_version.py +2 -2
- pymobiledevice3/bonjour.py +26 -49
- pymobiledevice3/ca.py +32 -24
- pymobiledevice3/cli/activation.py +7 -7
- pymobiledevice3/cli/afc.py +19 -19
- pymobiledevice3/cli/amfi.py +4 -4
- pymobiledevice3/cli/apps.py +51 -39
- pymobiledevice3/cli/backup.py +58 -32
- pymobiledevice3/cli/bonjour.py +25 -18
- pymobiledevice3/cli/cli_common.py +112 -81
- pymobiledevice3/cli/companion_proxy.py +4 -4
- pymobiledevice3/cli/completions.py +10 -10
- pymobiledevice3/cli/crash.py +37 -31
- pymobiledevice3/cli/developer.py +602 -520
- pymobiledevice3/cli/diagnostics.py +38 -33
- pymobiledevice3/cli/lockdown.py +79 -74
- pymobiledevice3/cli/mounter.py +85 -68
- pymobiledevice3/cli/notification.py +10 -10
- pymobiledevice3/cli/pcap.py +19 -14
- pymobiledevice3/cli/power_assertion.py +12 -10
- pymobiledevice3/cli/processes.py +10 -10
- pymobiledevice3/cli/profile.py +88 -77
- pymobiledevice3/cli/provision.py +17 -17
- pymobiledevice3/cli/remote.py +186 -110
- pymobiledevice3/cli/restore.py +43 -40
- pymobiledevice3/cli/springboard.py +30 -28
- pymobiledevice3/cli/syslog.py +85 -58
- pymobiledevice3/cli/usbmux.py +21 -20
- pymobiledevice3/cli/version.py +3 -2
- pymobiledevice3/cli/webinspector.py +157 -79
- pymobiledevice3/common.py +1 -1
- pymobiledevice3/exceptions.py +154 -60
- pymobiledevice3/irecv.py +49 -53
- pymobiledevice3/irecv_devices.py +1489 -492
- pymobiledevice3/lockdown.py +394 -241
- pymobiledevice3/lockdown_service_provider.py +5 -7
- pymobiledevice3/osu/os_utils.py +18 -9
- pymobiledevice3/osu/posix_util.py +28 -15
- pymobiledevice3/osu/win_util.py +14 -8
- pymobiledevice3/pair_records.py +19 -19
- pymobiledevice3/remote/common.py +4 -4
- pymobiledevice3/remote/core_device/app_service.py +94 -67
- pymobiledevice3/remote/core_device/core_device_service.py +17 -14
- pymobiledevice3/remote/core_device/device_info.py +5 -5
- pymobiledevice3/remote/core_device/diagnostics_service.py +10 -8
- pymobiledevice3/remote/core_device/file_service.py +47 -33
- pymobiledevice3/remote/remote_service_discovery.py +53 -35
- pymobiledevice3/remote/remotexpc.py +62 -41
- pymobiledevice3/remote/tunnel_service.py +371 -293
- pymobiledevice3/remote/utils.py +12 -11
- pymobiledevice3/remote/xpc_message.py +145 -125
- pymobiledevice3/resources/dsc_uuid_map.py +19 -19
- pymobiledevice3/resources/firmware_notifications.py +16 -16
- pymobiledevice3/restore/asr.py +27 -27
- pymobiledevice3/restore/base_restore.py +90 -47
- pymobiledevice3/restore/consts.py +87 -66
- pymobiledevice3/restore/device.py +11 -11
- pymobiledevice3/restore/fdr.py +46 -46
- pymobiledevice3/restore/ftab.py +19 -19
- pymobiledevice3/restore/img4.py +130 -133
- pymobiledevice3/restore/mbn.py +35 -54
- pymobiledevice3/restore/recovery.py +125 -135
- pymobiledevice3/restore/restore.py +524 -523
- pymobiledevice3/restore/restore_options.py +122 -115
- pymobiledevice3/restore/restored_client.py +25 -22
- pymobiledevice3/restore/tss.py +378 -270
- pymobiledevice3/service_connection.py +50 -46
- pymobiledevice3/services/accessibilityaudit.py +136 -126
- pymobiledevice3/services/afc.py +350 -291
- pymobiledevice3/services/amfi.py +21 -18
- pymobiledevice3/services/companion.py +23 -19
- pymobiledevice3/services/crash_reports.py +60 -46
- pymobiledevice3/services/debugserver_applist.py +3 -3
- pymobiledevice3/services/device_arbitration.py +8 -8
- pymobiledevice3/services/device_link.py +55 -47
- pymobiledevice3/services/diagnostics.py +971 -968
- pymobiledevice3/services/dtfetchsymbols.py +8 -8
- pymobiledevice3/services/dvt/dvt_secure_socket_proxy.py +4 -4
- pymobiledevice3/services/dvt/dvt_testmanaged_proxy.py +4 -4
- pymobiledevice3/services/dvt/instruments/activity_trace_tap.py +85 -74
- pymobiledevice3/services/dvt/instruments/application_listing.py +2 -3
- pymobiledevice3/services/dvt/instruments/condition_inducer.py +7 -6
- pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py +466 -384
- pymobiledevice3/services/dvt/instruments/device_info.py +11 -11
- pymobiledevice3/services/dvt/instruments/energy_monitor.py +1 -1
- pymobiledevice3/services/dvt/instruments/graphics.py +1 -1
- pymobiledevice3/services/dvt/instruments/location_simulation.py +1 -1
- pymobiledevice3/services/dvt/instruments/location_simulation_base.py +10 -10
- pymobiledevice3/services/dvt/instruments/network_monitor.py +17 -17
- pymobiledevice3/services/dvt/instruments/notifications.py +1 -1
- pymobiledevice3/services/dvt/instruments/process_control.py +25 -10
- pymobiledevice3/services/dvt/instruments/screenshot.py +2 -2
- pymobiledevice3/services/dvt/instruments/sysmontap.py +15 -15
- pymobiledevice3/services/dvt/testmanaged/xcuitest.py +40 -50
- pymobiledevice3/services/file_relay.py +10 -10
- pymobiledevice3/services/heartbeat.py +8 -7
- pymobiledevice3/services/house_arrest.py +12 -15
- pymobiledevice3/services/installation_proxy.py +119 -100
- pymobiledevice3/services/lockdown_service.py +12 -5
- pymobiledevice3/services/misagent.py +22 -19
- pymobiledevice3/services/mobile_activation.py +84 -72
- pymobiledevice3/services/mobile_config.py +330 -301
- pymobiledevice3/services/mobile_image_mounter.py +137 -116
- pymobiledevice3/services/mobilebackup2.py +188 -150
- pymobiledevice3/services/notification_proxy.py +11 -11
- pymobiledevice3/services/os_trace.py +69 -51
- pymobiledevice3/services/pcapd.py +306 -306
- pymobiledevice3/services/power_assertion.py +10 -9
- pymobiledevice3/services/preboard.py +4 -4
- pymobiledevice3/services/remote_fetch_symbols.py +16 -14
- pymobiledevice3/services/remote_server.py +176 -146
- pymobiledevice3/services/restore_service.py +16 -16
- pymobiledevice3/services/screenshot.py +13 -10
- pymobiledevice3/services/simulate_location.py +7 -7
- pymobiledevice3/services/springboard.py +15 -15
- pymobiledevice3/services/syslog.py +5 -5
- pymobiledevice3/services/web_protocol/alert.py +3 -3
- pymobiledevice3/services/web_protocol/automation_session.py +180 -176
- pymobiledevice3/services/web_protocol/cdp_screencast.py +44 -36
- pymobiledevice3/services/web_protocol/cdp_server.py +19 -19
- pymobiledevice3/services/web_protocol/cdp_target.py +411 -373
- pymobiledevice3/services/web_protocol/driver.py +47 -45
- pymobiledevice3/services/web_protocol/element.py +74 -63
- pymobiledevice3/services/web_protocol/inspector_session.py +106 -102
- pymobiledevice3/services/web_protocol/selenium_api.py +2 -2
- pymobiledevice3/services/web_protocol/session_protocol.py +15 -10
- pymobiledevice3/services/web_protocol/switch_to.py +11 -12
- pymobiledevice3/services/webinspector.py +127 -116
- pymobiledevice3/tcp_forwarder.py +35 -22
- pymobiledevice3/tunneld/api.py +20 -15
- pymobiledevice3/tunneld/server.py +212 -133
- pymobiledevice3/usbmux.py +183 -138
- pymobiledevice3/utils.py +14 -11
- {pymobiledevice3-5.0.0.dist-info → pymobiledevice3-5.0.2.dist-info}/METADATA +1 -1
- pymobiledevice3-5.0.2.dist-info/RECORD +173 -0
- pymobiledevice3-5.0.0.dist-info/RECORD +0 -173
- {pymobiledevice3-5.0.0.dist-info → pymobiledevice3-5.0.2.dist-info}/WHEEL +0 -0
- {pymobiledevice3-5.0.0.dist-info → pymobiledevice3-5.0.2.dist-info}/entry_points.txt +0 -0
- {pymobiledevice3-5.0.0.dist-info → pymobiledevice3-5.0.2.dist-info}/licenses/LICENSE +0 -0
- {pymobiledevice3-5.0.0.dist-info → pymobiledevice3-5.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,123 +1,130 @@
|
|
|
1
1
|
# extracted from ac2
|
|
2
2
|
import logging
|
|
3
3
|
import uuid
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from ipsw_parser.build_identity import BuildIdentity
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(__name__)
|
|
8
9
|
|
|
9
10
|
SUPPORTED_DATA_TYPES = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
11
|
+
"BasebandBootData": False,
|
|
12
|
+
"BasebandData": False,
|
|
13
|
+
"BasebandStackData": False,
|
|
14
|
+
"BasebandUpdaterOutputData": False,
|
|
15
|
+
"BootabilityBundle": False,
|
|
16
|
+
"BuildIdentityDict": False,
|
|
17
|
+
"BuildIdentityDictV2": False,
|
|
18
|
+
"DataType": False,
|
|
19
|
+
"DiagData": False,
|
|
20
|
+
"EANData": False,
|
|
21
|
+
"FDRMemoryCommit": False,
|
|
22
|
+
"FDRTrustData": False,
|
|
23
|
+
"FUDData": False,
|
|
24
|
+
"FileData": False,
|
|
25
|
+
"FileDataDone": False,
|
|
26
|
+
"FirmwareUpdaterData": False,
|
|
27
|
+
"GrapeFWData": False,
|
|
28
|
+
"HPMFWData": False,
|
|
29
|
+
"HostSystemTime": True,
|
|
30
|
+
"KernelCache": False,
|
|
31
|
+
"NORData": False,
|
|
32
|
+
"NitrogenFWData": True,
|
|
33
|
+
"OpalFWData": False,
|
|
34
|
+
"OverlayRootDataCount": False,
|
|
35
|
+
"OverlayRootDataForKey": True,
|
|
36
|
+
"PeppyFWData": True,
|
|
37
|
+
"PersonalizedBootObjectV3": False,
|
|
38
|
+
"PersonalizedData": True,
|
|
39
|
+
"ProvisioningData": False,
|
|
40
|
+
"RamdiskFWData": True,
|
|
41
|
+
"RecoveryOSASRImage": True,
|
|
42
|
+
"RecoveryOSAppleLogo": True,
|
|
43
|
+
"RecoveryOSDeviceTree": True,
|
|
44
|
+
"RecoveryOSFileAssetImage": True,
|
|
45
|
+
"RecoveryOSIBEC": True,
|
|
46
|
+
"RecoveryOSIBootFWFilesImages": True,
|
|
47
|
+
"RecoveryOSImage": True,
|
|
48
|
+
"RecoveryOSKernelCache": True,
|
|
49
|
+
"RecoveryOSLocalPolicy": True,
|
|
50
|
+
"RecoveryOSOverlayRootDataCount": False,
|
|
51
|
+
"RecoveryOSRootTicketData": True,
|
|
52
|
+
"RecoveryOSStaticTrustCache": True,
|
|
53
|
+
"RecoveryOSVersionData": True,
|
|
54
|
+
"RootData": False,
|
|
55
|
+
"RootTicket": False,
|
|
56
|
+
"S3EOverride": False,
|
|
57
|
+
"SourceBootObjectV3": False,
|
|
58
|
+
"SourceBootObjectV4": False,
|
|
59
|
+
"SsoServiceTicket": False,
|
|
60
|
+
"StockholmPostflight": False,
|
|
61
|
+
"SystemImageCanonicalMetadata": False,
|
|
62
|
+
"SystemImageData": False,
|
|
63
|
+
"SystemImageRootHash": False,
|
|
64
|
+
"USBCFWData": False,
|
|
65
|
+
"USBCOverride": False,
|
|
66
|
+
"FirmwareUpdaterPreflight": True,
|
|
67
|
+
"ReceiptManifest": True,
|
|
68
|
+
"FirmwareUpdaterDataV2": False,
|
|
69
|
+
"RestoreLocalPolicy": True,
|
|
70
|
+
"AuthInstallCACert": True,
|
|
71
|
+
"OverlayRootDataForKeyIndex": True,
|
|
72
72
|
# Added in iOS 18.0 beta1
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
"FirmwareUpdaterDataV3": True,
|
|
74
|
+
"MessageUseStreamedImageFile": True,
|
|
75
|
+
"UpdateVolumeOverlayRootDataCount": True,
|
|
76
|
+
"URLAsset": True,
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
# extracted from ac2
|
|
80
80
|
SUPPORTED_MESSAGE_TYPES = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
"BBUpdateStatusMsg": False,
|
|
82
|
+
"CheckpointMsg": True,
|
|
83
|
+
"CrashLog": True,
|
|
84
|
+
"DataRequestMsg": False,
|
|
85
|
+
"FDRSubmit": True,
|
|
86
|
+
"MsgType": False,
|
|
87
|
+
"PreviousRestoreLogMsg": False,
|
|
88
|
+
"ProgressMsg": False,
|
|
89
|
+
"ProvisioningAck": False,
|
|
90
|
+
"ProvisioningInfo": False,
|
|
91
|
+
"ProvisioningStatusMsg": False,
|
|
92
|
+
"ReceivedFinalStatusMsg": False,
|
|
93
|
+
"RestoredCrash": True,
|
|
94
|
+
"StatusMsg": False,
|
|
96
95
|
# Added in iOS 18.0 beta1
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
"AsyncDataRequestMsg": True,
|
|
97
|
+
"AsyncWait": True,
|
|
98
|
+
"RestoreAttestation": True,
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
|
|
103
102
|
class RestoreOptions:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
def __init__(
|
|
104
|
+
self,
|
|
105
|
+
firmware_preflight_info=None,
|
|
106
|
+
sep=None,
|
|
107
|
+
macos_variant=None,
|
|
108
|
+
build_identity: BuildIdentity = None,
|
|
109
|
+
restore_boot_args=None,
|
|
110
|
+
spp=None,
|
|
111
|
+
restore_behavior: Optional[str] = None,
|
|
112
|
+
msp=None,
|
|
113
|
+
):
|
|
107
114
|
self.AutoBootDelay = 0
|
|
108
115
|
|
|
109
116
|
try:
|
|
110
117
|
if firmware_preflight_info is not None:
|
|
111
118
|
bbus = dict(firmware_preflight_info)
|
|
112
|
-
bbus.pop(
|
|
113
|
-
bbus.pop(
|
|
119
|
+
bbus.pop("FusingStatus")
|
|
120
|
+
bbus.pop("PkHash")
|
|
114
121
|
self.BBUpdaterState = bbus
|
|
115
122
|
|
|
116
|
-
nonce = firmware_preflight_info.get(
|
|
123
|
+
nonce = firmware_preflight_info.get("Nonce")
|
|
117
124
|
if nonce is not None:
|
|
118
125
|
self.BasebandNonce = nonce
|
|
119
126
|
except KeyError as e:
|
|
120
|
-
logger.warning(f
|
|
127
|
+
logger.warning(f"Skipping addition of firmware_preflight_info due to: {e}")
|
|
121
128
|
|
|
122
129
|
self.SupportedDataTypes = SUPPORTED_DATA_TYPES
|
|
123
130
|
self.SupportedMessageTypes = SUPPORTED_MESSAGE_TYPES
|
|
@@ -159,33 +166,33 @@ class RestoreOptions:
|
|
|
159
166
|
if msp:
|
|
160
167
|
self.SystemPartitionSize = msp
|
|
161
168
|
else:
|
|
162
|
-
self.BootImageType =
|
|
163
|
-
self.DFUFileType =
|
|
169
|
+
self.BootImageType = "UserOrInternal"
|
|
170
|
+
self.DFUFileType = "RELEASE"
|
|
164
171
|
self.DataImage = False
|
|
165
|
-
self.FirmwareDirectory =
|
|
172
|
+
self.FirmwareDirectory = "."
|
|
166
173
|
self.FlashNOR = True
|
|
167
|
-
self.KernelCacheType =
|
|
168
|
-
self.NORImageType =
|
|
169
|
-
self.RestoreBundlePath =
|
|
170
|
-
self.SystemImageType =
|
|
174
|
+
self.KernelCacheType = "Release"
|
|
175
|
+
self.NORImageType = "production"
|
|
176
|
+
self.RestoreBundlePath = "/tmp/Per2.tmp"
|
|
177
|
+
self.SystemImageType = "User"
|
|
171
178
|
self.UpdateBaseband = False
|
|
172
179
|
|
|
173
180
|
# Added for iOS 18.0 beta1
|
|
174
181
|
self.HostHasFixFor99053849 = True
|
|
175
|
-
self.SystemImageFormat =
|
|
182
|
+
self.SystemImageFormat = "AEAWrappedDiskImage"
|
|
176
183
|
self.WaitForDeviceConnectionToFinishStateMachine = False
|
|
177
184
|
self.SupportedAsyncDataTypes = {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
"BasebandData": False,
|
|
186
|
+
"RecoveryOSASRImage": False,
|
|
187
|
+
"StreamedImageDecryptionKey": False,
|
|
188
|
+
"SystemImageData": False,
|
|
189
|
+
"URLAsset": True,
|
|
183
190
|
}
|
|
184
191
|
|
|
185
192
|
if sep is not None:
|
|
186
|
-
required_capacity = sep.get(
|
|
193
|
+
required_capacity = sep.get("RequiredCapacity")
|
|
187
194
|
if required_capacity:
|
|
188
|
-
logger.debug(f
|
|
195
|
+
logger.debug(f"TZ0RequiredCapacity: {required_capacity}")
|
|
189
196
|
self.TZ0RequiredCapacity = required_capacity
|
|
190
197
|
|
|
191
198
|
self.PersonalizedDuringPreflight = True
|
|
@@ -202,15 +209,15 @@ class RestoreOptions:
|
|
|
202
209
|
spp = dict(spp)
|
|
203
210
|
else:
|
|
204
211
|
spp = {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
"1024": 1280,
|
|
213
|
+
"128": 1280,
|
|
214
|
+
"16": 160,
|
|
215
|
+
"256": 1280,
|
|
216
|
+
"32": 320,
|
|
217
|
+
"512": 1280,
|
|
218
|
+
"64": 640,
|
|
219
|
+
"768": 1280,
|
|
220
|
+
"8": 80,
|
|
214
221
|
}
|
|
215
222
|
self.SystemPartitionPadding = spp
|
|
216
223
|
|
|
@@ -12,23 +12,24 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class RestoredClient:
|
|
15
|
-
DEFAULT_CLIENT_NAME =
|
|
15
|
+
DEFAULT_CLIENT_NAME = "pymobiledevice3"
|
|
16
16
|
SERVICE_PORT = 62078
|
|
17
17
|
|
|
18
18
|
@classmethod
|
|
19
|
-
async def create(cls, ecid: str) ->
|
|
20
|
-
for mux_device in select_devices_by_connection_type(
|
|
21
|
-
logger.debug(f
|
|
22
|
-
service = ServiceConnection.create_using_usbmux(
|
|
23
|
-
|
|
19
|
+
async def create(cls, ecid: str) -> "RestoredClient":
|
|
20
|
+
for mux_device in select_devices_by_connection_type("USB"):
|
|
21
|
+
logger.debug(f"Iterating: {mux_device}")
|
|
22
|
+
service = ServiceConnection.create_using_usbmux(
|
|
23
|
+
mux_device.serial, cls.SERVICE_PORT, connection_type=mux_device.connection_type
|
|
24
|
+
)
|
|
24
25
|
await service.aio_start()
|
|
25
26
|
|
|
26
|
-
query_type = await service.aio_send_recv_plist({
|
|
27
|
-
version = query_type.get(
|
|
28
|
-
logger.debug(f
|
|
27
|
+
query_type = await service.aio_send_recv_plist({"Request": "QueryType"})
|
|
28
|
+
version = query_type.get("RestoreProtocolVersion")
|
|
29
|
+
logger.debug(f"RestoreProtocolVersion: {version}")
|
|
29
30
|
|
|
30
|
-
if query_type.get(
|
|
31
|
-
logger.debug(f
|
|
31
|
+
if query_type.get("Type") != "com.apple.mobile.restored":
|
|
32
|
+
logger.debug(f"Skipping: {mux_device.serial} as its not a restored device")
|
|
32
33
|
await service.aio_close()
|
|
33
34
|
continue
|
|
34
35
|
|
|
@@ -36,8 +37,10 @@ class RestoredClient:
|
|
|
36
37
|
await restored_client._connect()
|
|
37
38
|
|
|
38
39
|
if restored_client.ecid != ecid:
|
|
39
|
-
logger.debug(
|
|
40
|
-
|
|
40
|
+
logger.debug(
|
|
41
|
+
f"Skipping: {restored_client.ecid} as its not the right ECID ({restored_client.ecid} "
|
|
42
|
+
f"instead of {ecid})"
|
|
43
|
+
)
|
|
41
44
|
await service.aio_close()
|
|
42
45
|
continue
|
|
43
46
|
|
|
@@ -51,9 +54,9 @@ class RestoredClient:
|
|
|
51
54
|
self.label = DEFAULT_LABEL
|
|
52
55
|
|
|
53
56
|
async def _connect(self) -> None:
|
|
54
|
-
self.hardware_info = (await self.query_value(
|
|
55
|
-
self.ecid = self.hardware_info[
|
|
56
|
-
self.saved_debug_info = (await self.query_value(
|
|
57
|
+
self.hardware_info = (await self.query_value("HardwareInfo"))["HardwareInfo"]
|
|
58
|
+
self.ecid = self.hardware_info["UniqueChipID"]
|
|
59
|
+
self.saved_debug_info = (await self.query_value("SavedDebugInfo"))["SavedDebugInfo"]
|
|
57
60
|
|
|
58
61
|
@staticmethod
|
|
59
62
|
def _get_or_verify_udid(udid: Optional[str] = None) -> str:
|
|
@@ -66,25 +69,25 @@ class RestoredClient:
|
|
|
66
69
|
return device.serial
|
|
67
70
|
|
|
68
71
|
async def query_value(self, key: Optional[str] = None) -> Any:
|
|
69
|
-
req = {
|
|
72
|
+
req = {"Request": "QueryValue", "Label": self.label}
|
|
70
73
|
|
|
71
74
|
if key:
|
|
72
|
-
req[
|
|
75
|
+
req["QueryKey"] = key
|
|
73
76
|
|
|
74
77
|
return await self.service.aio_send_recv_plist(req)
|
|
75
78
|
|
|
76
79
|
async def start_restore(self, opts: Optional[RestoreOptions] = None) -> None:
|
|
77
|
-
req = {
|
|
80
|
+
req = {"Request": "StartRestore", "Label": self.label, "RestoreProtocolVersion": self.version}
|
|
78
81
|
|
|
79
82
|
if opts is not None:
|
|
80
|
-
req[
|
|
83
|
+
req["RestoreOptions"] = opts.to_dict()
|
|
81
84
|
|
|
82
|
-
logger.debug(f
|
|
85
|
+
logger.debug(f"start_restore request: {req}")
|
|
83
86
|
|
|
84
87
|
return await self.service.aio_send_plist(req)
|
|
85
88
|
|
|
86
89
|
async def reboot(self) -> dict:
|
|
87
|
-
return await self.service.aio_send_recv_plist({
|
|
90
|
+
return await self.service.aio_send_recv_plist({"Request": "Reboot", "Label": self.label})
|
|
88
91
|
|
|
89
92
|
async def send(self, message: dict) -> None:
|
|
90
93
|
await self.service.aio_send_plist(message)
|