pymobiledevice3 4.27.4__py3-none-any.whl → 5.1.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.
Files changed (143) hide show
  1. misc/plist_sniffer.py +15 -15
  2. misc/remotexpc_sniffer.py +29 -28
  3. pymobiledevice3/__main__.py +123 -98
  4. pymobiledevice3/_version.py +2 -2
  5. pymobiledevice3/bonjour.py +351 -117
  6. pymobiledevice3/ca.py +32 -24
  7. pymobiledevice3/cli/activation.py +7 -7
  8. pymobiledevice3/cli/afc.py +19 -19
  9. pymobiledevice3/cli/amfi.py +4 -4
  10. pymobiledevice3/cli/apps.py +51 -39
  11. pymobiledevice3/cli/backup.py +58 -32
  12. pymobiledevice3/cli/bonjour.py +27 -20
  13. pymobiledevice3/cli/cli_common.py +112 -81
  14. pymobiledevice3/cli/companion_proxy.py +4 -4
  15. pymobiledevice3/cli/completions.py +10 -10
  16. pymobiledevice3/cli/crash.py +37 -31
  17. pymobiledevice3/cli/developer.py +601 -519
  18. pymobiledevice3/cli/diagnostics.py +38 -33
  19. pymobiledevice3/cli/lockdown.py +82 -72
  20. pymobiledevice3/cli/mounter.py +84 -67
  21. pymobiledevice3/cli/notification.py +10 -10
  22. pymobiledevice3/cli/pcap.py +19 -14
  23. pymobiledevice3/cli/power_assertion.py +12 -10
  24. pymobiledevice3/cli/processes.py +10 -10
  25. pymobiledevice3/cli/profile.py +88 -77
  26. pymobiledevice3/cli/provision.py +17 -17
  27. pymobiledevice3/cli/remote.py +188 -111
  28. pymobiledevice3/cli/restore.py +43 -40
  29. pymobiledevice3/cli/springboard.py +30 -28
  30. pymobiledevice3/cli/syslog.py +85 -58
  31. pymobiledevice3/cli/usbmux.py +21 -20
  32. pymobiledevice3/cli/version.py +3 -2
  33. pymobiledevice3/cli/webinspector.py +156 -78
  34. pymobiledevice3/common.py +1 -1
  35. pymobiledevice3/exceptions.py +154 -60
  36. pymobiledevice3/irecv.py +49 -53
  37. pymobiledevice3/irecv_devices.py +1489 -492
  38. pymobiledevice3/lockdown.py +400 -251
  39. pymobiledevice3/lockdown_service_provider.py +5 -7
  40. pymobiledevice3/osu/os_utils.py +18 -9
  41. pymobiledevice3/osu/posix_util.py +28 -15
  42. pymobiledevice3/osu/win_util.py +14 -8
  43. pymobiledevice3/pair_records.py +19 -19
  44. pymobiledevice3/remote/common.py +4 -4
  45. pymobiledevice3/remote/core_device/app_service.py +94 -67
  46. pymobiledevice3/remote/core_device/core_device_service.py +17 -14
  47. pymobiledevice3/remote/core_device/device_info.py +5 -5
  48. pymobiledevice3/remote/core_device/diagnostics_service.py +10 -8
  49. pymobiledevice3/remote/core_device/file_service.py +47 -33
  50. pymobiledevice3/remote/remote_service_discovery.py +53 -35
  51. pymobiledevice3/remote/remotexpc.py +64 -42
  52. pymobiledevice3/remote/tunnel_service.py +383 -297
  53. pymobiledevice3/remote/utils.py +14 -13
  54. pymobiledevice3/remote/xpc_message.py +145 -125
  55. pymobiledevice3/resources/dsc_uuid_map.py +19 -19
  56. pymobiledevice3/resources/firmware_notifications.py +16 -16
  57. pymobiledevice3/restore/asr.py +27 -27
  58. pymobiledevice3/restore/base_restore.py +90 -47
  59. pymobiledevice3/restore/consts.py +87 -66
  60. pymobiledevice3/restore/device.py +11 -11
  61. pymobiledevice3/restore/fdr.py +46 -46
  62. pymobiledevice3/restore/ftab.py +19 -19
  63. pymobiledevice3/restore/img4.py +130 -133
  64. pymobiledevice3/restore/mbn.py +587 -0
  65. pymobiledevice3/restore/recovery.py +125 -135
  66. pymobiledevice3/restore/restore.py +535 -523
  67. pymobiledevice3/restore/restore_options.py +122 -115
  68. pymobiledevice3/restore/restored_client.py +25 -22
  69. pymobiledevice3/restore/tss.py +378 -270
  70. pymobiledevice3/service_connection.py +50 -46
  71. pymobiledevice3/services/accessibilityaudit.py +137 -127
  72. pymobiledevice3/services/afc.py +352 -292
  73. pymobiledevice3/services/amfi.py +21 -18
  74. pymobiledevice3/services/companion.py +23 -19
  75. pymobiledevice3/services/crash_reports.py +61 -47
  76. pymobiledevice3/services/debugserver_applist.py +3 -3
  77. pymobiledevice3/services/device_arbitration.py +8 -8
  78. pymobiledevice3/services/device_link.py +56 -48
  79. pymobiledevice3/services/diagnostics.py +971 -968
  80. pymobiledevice3/services/dtfetchsymbols.py +8 -8
  81. pymobiledevice3/services/dvt/dvt_secure_socket_proxy.py +4 -4
  82. pymobiledevice3/services/dvt/dvt_testmanaged_proxy.py +4 -4
  83. pymobiledevice3/services/dvt/instruments/activity_trace_tap.py +85 -74
  84. pymobiledevice3/services/dvt/instruments/application_listing.py +2 -3
  85. pymobiledevice3/services/dvt/instruments/condition_inducer.py +7 -6
  86. pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py +466 -384
  87. pymobiledevice3/services/dvt/instruments/device_info.py +11 -11
  88. pymobiledevice3/services/dvt/instruments/energy_monitor.py +1 -1
  89. pymobiledevice3/services/dvt/instruments/graphics.py +1 -1
  90. pymobiledevice3/services/dvt/instruments/location_simulation.py +1 -1
  91. pymobiledevice3/services/dvt/instruments/location_simulation_base.py +10 -10
  92. pymobiledevice3/services/dvt/instruments/network_monitor.py +17 -17
  93. pymobiledevice3/services/dvt/instruments/notifications.py +1 -1
  94. pymobiledevice3/services/dvt/instruments/process_control.py +25 -10
  95. pymobiledevice3/services/dvt/instruments/screenshot.py +2 -2
  96. pymobiledevice3/services/dvt/instruments/sysmontap.py +15 -15
  97. pymobiledevice3/services/dvt/testmanaged/xcuitest.py +42 -52
  98. pymobiledevice3/services/file_relay.py +10 -10
  99. pymobiledevice3/services/heartbeat.py +8 -7
  100. pymobiledevice3/services/house_arrest.py +12 -15
  101. pymobiledevice3/services/installation_proxy.py +119 -100
  102. pymobiledevice3/services/lockdown_service.py +12 -5
  103. pymobiledevice3/services/misagent.py +22 -19
  104. pymobiledevice3/services/mobile_activation.py +84 -72
  105. pymobiledevice3/services/mobile_config.py +331 -301
  106. pymobiledevice3/services/mobile_image_mounter.py +137 -116
  107. pymobiledevice3/services/mobilebackup2.py +188 -150
  108. pymobiledevice3/services/notification_proxy.py +11 -11
  109. pymobiledevice3/services/os_trace.py +128 -74
  110. pymobiledevice3/services/pcapd.py +306 -306
  111. pymobiledevice3/services/power_assertion.py +10 -9
  112. pymobiledevice3/services/preboard.py +4 -4
  113. pymobiledevice3/services/remote_fetch_symbols.py +16 -14
  114. pymobiledevice3/services/remote_server.py +176 -146
  115. pymobiledevice3/services/restore_service.py +16 -16
  116. pymobiledevice3/services/screenshot.py +13 -10
  117. pymobiledevice3/services/simulate_location.py +7 -7
  118. pymobiledevice3/services/springboard.py +15 -15
  119. pymobiledevice3/services/syslog.py +5 -5
  120. pymobiledevice3/services/web_protocol/alert.py +3 -3
  121. pymobiledevice3/services/web_protocol/automation_session.py +183 -179
  122. pymobiledevice3/services/web_protocol/cdp_screencast.py +44 -36
  123. pymobiledevice3/services/web_protocol/cdp_server.py +19 -19
  124. pymobiledevice3/services/web_protocol/cdp_target.py +411 -373
  125. pymobiledevice3/services/web_protocol/driver.py +47 -45
  126. pymobiledevice3/services/web_protocol/element.py +74 -63
  127. pymobiledevice3/services/web_protocol/inspector_session.py +106 -102
  128. pymobiledevice3/services/web_protocol/selenium_api.py +3 -3
  129. pymobiledevice3/services/web_protocol/session_protocol.py +15 -10
  130. pymobiledevice3/services/web_protocol/switch_to.py +11 -12
  131. pymobiledevice3/services/webinspector.py +142 -116
  132. pymobiledevice3/tcp_forwarder.py +35 -22
  133. pymobiledevice3/tunneld/api.py +20 -15
  134. pymobiledevice3/tunneld/server.py +310 -193
  135. pymobiledevice3/usbmux.py +197 -148
  136. pymobiledevice3/utils.py +14 -11
  137. {pymobiledevice3-4.27.4.dist-info → pymobiledevice3-5.1.2.dist-info}/METADATA +1 -2
  138. pymobiledevice3-5.1.2.dist-info/RECORD +173 -0
  139. pymobiledevice3-4.27.4.dist-info/RECORD +0 -172
  140. {pymobiledevice3-4.27.4.dist-info → pymobiledevice3-5.1.2.dist-info}/WHEEL +0 -0
  141. {pymobiledevice3-4.27.4.dist-info → pymobiledevice3-5.1.2.dist-info}/entry_points.txt +0 -0
  142. {pymobiledevice3-4.27.4.dist-info → pymobiledevice3-5.1.2.dist-info}/licenses/LICENSE +0 -0
  143. {pymobiledevice3-4.27.4.dist-info → pymobiledevice3-5.1.2.dist-info}/top_level.txt +0 -0
@@ -13,267 +13,270 @@ from pymobiledevice3.lockdown import LockdownClient
13
13
  from pymobiledevice3.lockdown_service_provider import LockdownServiceProvider
14
14
  from pymobiledevice3.services.lockdown_service import LockdownService
15
15
 
16
- INTERFACE_NAMES = enum.Enum('InterfaceNames', names={
17
- 'other': 1,
18
- 'regular1822': 2,
19
- 'hdh1822': 3,
20
- 'ddnX25': 4,
21
- 'rfc877x25': 5,
22
- 'ethernetCsmacd': 6,
23
- 'iso88023Csmacd': 7,
24
- 'iso88024TokenBus': 8,
25
- 'iso88025TokenRing': 9,
26
- 'iso88026Man': 10,
27
- 'starLan': 11,
28
- 'proteon10Mbit': 12,
29
- 'proteon80Mbit': 13,
30
- 'hyperchannel': 14,
31
- 'fddi': 15,
32
- 'lapb': 16,
33
- 'sdlc': 17,
34
- 'ds1': 18,
35
- 'e1': 19,
36
- 'basicISDN': 20,
37
- 'primaryISDN': 21,
38
- 'propPointToPointSerial': 22,
39
- 'ppp': 23,
40
- 'softwareLoopback': 24,
41
- 'eon': 25,
42
- 'ethernet3Mbit': 26,
43
- 'nsip': 27,
44
- 'slip': 28,
45
- 'ultra': 29,
46
- 'ds3': 30,
47
- 'sip': 31,
48
- 'frameRelay': 32,
49
- 'rs232': 33,
50
- 'para': 34,
51
- 'arcnet': 35,
52
- 'arcnetPlus': 36,
53
- 'atm': 37,
54
- 'miox25': 38,
55
- 'sonet': 39,
56
- 'x25ple': 40,
57
- 'iso88022llc': 41,
58
- 'localTalk': 42,
59
- 'smdsDxi': 43,
60
- 'frameRelayService': 44,
61
- 'v35': 45,
62
- 'hssi': 46,
63
- 'hippi': 47,
64
- 'modem': 48,
65
- 'aal5': 49,
66
- 'sonetPath': 50,
67
- 'sonetVT': 51,
68
- 'smdsIcip': 52,
69
- 'propVirtual': 53,
70
- 'propMultiplexor': 54,
71
- 'ieee80212': 55,
72
- 'fibreChannel': 56,
73
- 'hippiInterface': 57,
74
- 'frameRelayInterconnect': 58,
75
- 'aflane8023': 59,
76
- 'aflane8025': 60,
77
- 'cctEmul': 61,
78
- 'fastEther': 62,
79
- 'isdn': 63,
80
- 'v11': 64,
81
- 'v36': 65,
82
- 'g703at64k': 66,
83
- 'g703at2mb': 67,
84
- 'qllc': 68,
85
- 'fastEtherFX': 69,
86
- 'channel': 70,
87
- 'ieee80211': 71,
88
- 'ibm370parChan': 72,
89
- 'escon': 73,
90
- 'dlsw': 74,
91
- 'isdns': 75,
92
- 'isdnu': 76,
93
- 'lapd': 77,
94
- 'ipSwitch': 78,
95
- 'rsrb': 79,
96
- 'atmLogical': 80,
97
- 'ds0': 81,
98
- 'ds0Bundle': 82,
99
- 'bsc': 83,
100
- 'async': 84,
101
- 'cnr': 85,
102
- 'iso88025Dtr': 86,
103
- 'eplrs': 87,
104
- 'arap': 88,
105
- 'propCnls': 89,
106
- 'hostPad': 90,
107
- 'termPad': 91,
108
- 'frameRelayMPI': 92,
109
- 'x213': 93,
110
- 'adsl': 94,
111
- 'radsl': 95,
112
- 'sdsl': 96,
113
- 'vdsl': 97,
114
- 'iso88025CRFPInt': 98,
115
- 'myrinet': 99,
116
- 'voiceEM': 100,
117
- 'voiceFXO': 101,
118
- 'voiceFXS': 102,
119
- 'voiceEncap': 103,
120
- 'voiceOverIp': 104,
121
- 'atmDxi': 105,
122
- 'atmFuni': 106,
123
- 'atmIma': 107,
124
- 'pppMultilinkBundle': 108,
125
- 'ipOverCdlc': 109,
126
- 'ipOverClaw': 110,
127
- 'stackToStack': 111,
128
- 'virtualIpAddress': 112,
129
- 'mpc': 113,
130
- 'ipOverAtm': 114,
131
- 'iso88025Fiber': 115,
132
- 'tdlc': 116,
133
- 'gigabitEthernet': 117,
134
- 'hdlc': 118,
135
- 'lapf': 119,
136
- 'v37': 120,
137
- 'x25mlp': 121,
138
- 'x25huntGroup': 122,
139
- 'transpHdlc': 123,
140
- 'interleave': 124,
141
- 'fast': 125,
142
- 'ip': 126,
143
- 'docsCableMaclayer': 127,
144
- 'docsCableDownstream': 128,
145
- 'docsCableUpstream': 129,
146
- 'a12MppSwitch': 130,
147
- 'tunnel': 131,
148
- 'coffee': 132,
149
- 'ces': 133,
150
- 'atmSubInterface': 134,
151
- 'l2vlan': 135,
152
- 'l3ipvlan': 136,
153
- 'l3ipxvlan': 137,
154
- 'digitalPowerline': 138,
155
- 'mediaMailOverIp': 139,
156
- 'dtm': 140,
157
- 'dcn': 141,
158
- 'ipForward': 142,
159
- 'msdsl': 143,
160
- 'ieee1394': 144,
161
- 'if-gsn': 145,
162
- 'dvbRccMacLayer': 146,
163
- 'dvbRccDownstream': 147,
164
- 'dvbRccUpstream': 148,
165
- 'atmVirtual': 149,
166
- 'mplsTunnel': 150,
167
- 'srp': 151,
168
- 'voiceOverAtm': 152,
169
- 'voiceOverFrameRelay': 153,
170
- 'idsl': 154,
171
- 'compositeLink': 155,
172
- 'ss7SigLink': 156,
173
- 'propWirelessP2P': 157,
174
- 'frForward': 158,
175
- 'rfc1483': 159,
176
- 'usb': 160,
177
- 'ieee8023adLag': 161,
178
- 'bgppolicyaccounting': 162,
179
- 'frf16MfrBundle': 163,
180
- 'h323Gatekeeper': 164,
181
- 'h323Proxy': 165,
182
- 'mpls': 166,
183
- 'mfSigLink': 167,
184
- 'hdsl2': 168,
185
- 'shdsl': 169,
186
- 'ds1FDL': 170,
187
- 'pos': 171,
188
- 'dvbAsiIn': 172,
189
- 'dvbAsiOut': 173,
190
- 'plc': 174,
191
- 'nfas': 175,
192
- 'tr008': 176,
193
- 'gr303RDT': 177,
194
- 'gr303IDT': 178,
195
- 'isup': 179,
196
- 'propDocsWirelessMaclayer': 180,
197
- 'propDocsWirelessDownstream': 181,
198
- 'propDocsWirelessUpstream': 182,
199
- 'hiperlan2': 183,
200
- 'propBWAp2Mp': 184,
201
- 'sonetOverheadChannel': 185,
202
- 'digitalWrapperOverheadChannel': 186,
203
- 'aal2': 187,
204
- 'radioMAC': 188,
205
- 'atmRadio': 189,
206
- 'imt': 190,
207
- 'mvl': 191,
208
- 'reachDSL': 192,
209
- 'frDlciEndPt': 193,
210
- 'atmVciEndPt': 194,
211
- 'opticalChannel': 195,
212
- 'opticalTransport': 196,
213
- 'propAtm': 197,
214
- 'voiceOverCable': 198,
215
- 'infiniband': 199,
216
- 'teLink': 200,
217
- 'q2931': 201,
218
- 'virtualTg': 202,
219
- 'sipTg': 203,
220
- 'sipSig': 204,
221
- 'docsCableUpstreamChannel': 205,
222
- 'econet': 206,
223
- 'pon155': 207,
224
- 'pon622': 208,
225
- 'bridge': 209,
226
- 'linegroup': 210,
227
- 'voiceEMFGD': 211,
228
- 'voiceFGDEANA': 212,
229
- 'voiceDID': 213,
230
- 'mpegTransport': 214,
231
- 'sixToFour': 215,
232
- 'gtp': 216,
233
- 'pdnEtherLoop1': 217,
234
- 'pdnEtherLoop2': 218,
235
- 'opticalChannelGroup': 219,
236
- 'homepna': 220,
237
- 'gfp': 221,
238
- 'ciscoISLvlan': 222,
239
- 'actelisMetaLOOP': 223,
240
- 'fcipLink': 224,
241
- 'rpr': 225,
242
- 'qam': 226,
243
- 'lmp': 227,
244
- 'cblVectaStar': 228,
245
- 'docsCableMCmtsDownstream': 229,
246
- 'adsl2': 230,
247
- 'macSecControlledIF': 231,
248
- 'macSecUncontrolledIF': 232,
249
- 'aviciOpticalEther': 233,
250
- 'atmbond': 234,
251
- 'voiceFGDOS': 235,
252
- 'mocaVersion1': 236,
253
- 'ieee80216WMAN': 237,
254
- 'adsl2plus': 238,
255
- 'dvbRcsMacLayer': 239,
256
- 'dvbTdm': 240,
257
- 'dvbRcsTdma': 241,
258
- 'x86Laps': 242,
259
- 'wwanPP': 243,
260
- 'wwanPP2': 244,
261
- 'voiceEBS': 245,
262
- 'ifPwType': 246,
263
- 'ilan': 247,
264
- 'pip': 248,
265
- 'aluELP': 249,
266
- 'gpon': 250,
267
- 'vdsl2': 251,
268
- 'capwapDot11Profile': 252,
269
- 'capwapDot11Bss': 253,
270
- 'capwapWtpVirtualRadio': 254,
271
- 'bits': 255,
272
- 'docsCableUpstreamRfPort': 256,
273
- 'cableDownstreamRfPort': 257,
274
- 'vmwareVirtualNic': 258,
275
- 'ieee802154': 259,
276
- })
16
+ INTERFACE_NAMES = enum.Enum(
17
+ "InterfaceNames",
18
+ names={
19
+ "other": 1,
20
+ "regular1822": 2,
21
+ "hdh1822": 3,
22
+ "ddnX25": 4,
23
+ "rfc877x25": 5,
24
+ "ethernetCsmacd": 6,
25
+ "iso88023Csmacd": 7,
26
+ "iso88024TokenBus": 8,
27
+ "iso88025TokenRing": 9,
28
+ "iso88026Man": 10,
29
+ "starLan": 11,
30
+ "proteon10Mbit": 12,
31
+ "proteon80Mbit": 13,
32
+ "hyperchannel": 14,
33
+ "fddi": 15,
34
+ "lapb": 16,
35
+ "sdlc": 17,
36
+ "ds1": 18,
37
+ "e1": 19,
38
+ "basicISDN": 20,
39
+ "primaryISDN": 21,
40
+ "propPointToPointSerial": 22,
41
+ "ppp": 23,
42
+ "softwareLoopback": 24,
43
+ "eon": 25,
44
+ "ethernet3Mbit": 26,
45
+ "nsip": 27,
46
+ "slip": 28,
47
+ "ultra": 29,
48
+ "ds3": 30,
49
+ "sip": 31,
50
+ "frameRelay": 32,
51
+ "rs232": 33,
52
+ "para": 34,
53
+ "arcnet": 35,
54
+ "arcnetPlus": 36,
55
+ "atm": 37,
56
+ "miox25": 38,
57
+ "sonet": 39,
58
+ "x25ple": 40,
59
+ "iso88022llc": 41,
60
+ "localTalk": 42,
61
+ "smdsDxi": 43,
62
+ "frameRelayService": 44,
63
+ "v35": 45,
64
+ "hssi": 46,
65
+ "hippi": 47,
66
+ "modem": 48,
67
+ "aal5": 49,
68
+ "sonetPath": 50,
69
+ "sonetVT": 51,
70
+ "smdsIcip": 52,
71
+ "propVirtual": 53,
72
+ "propMultiplexor": 54,
73
+ "ieee80212": 55,
74
+ "fibreChannel": 56,
75
+ "hippiInterface": 57,
76
+ "frameRelayInterconnect": 58,
77
+ "aflane8023": 59,
78
+ "aflane8025": 60,
79
+ "cctEmul": 61,
80
+ "fastEther": 62,
81
+ "isdn": 63,
82
+ "v11": 64,
83
+ "v36": 65,
84
+ "g703at64k": 66,
85
+ "g703at2mb": 67,
86
+ "qllc": 68,
87
+ "fastEtherFX": 69,
88
+ "channel": 70,
89
+ "ieee80211": 71,
90
+ "ibm370parChan": 72,
91
+ "escon": 73,
92
+ "dlsw": 74,
93
+ "isdns": 75,
94
+ "isdnu": 76,
95
+ "lapd": 77,
96
+ "ipSwitch": 78,
97
+ "rsrb": 79,
98
+ "atmLogical": 80,
99
+ "ds0": 81,
100
+ "ds0Bundle": 82,
101
+ "bsc": 83,
102
+ "async": 84,
103
+ "cnr": 85,
104
+ "iso88025Dtr": 86,
105
+ "eplrs": 87,
106
+ "arap": 88,
107
+ "propCnls": 89,
108
+ "hostPad": 90,
109
+ "termPad": 91,
110
+ "frameRelayMPI": 92,
111
+ "x213": 93,
112
+ "adsl": 94,
113
+ "radsl": 95,
114
+ "sdsl": 96,
115
+ "vdsl": 97,
116
+ "iso88025CRFPInt": 98,
117
+ "myrinet": 99,
118
+ "voiceEM": 100,
119
+ "voiceFXO": 101,
120
+ "voiceFXS": 102,
121
+ "voiceEncap": 103,
122
+ "voiceOverIp": 104,
123
+ "atmDxi": 105,
124
+ "atmFuni": 106,
125
+ "atmIma": 107,
126
+ "pppMultilinkBundle": 108,
127
+ "ipOverCdlc": 109,
128
+ "ipOverClaw": 110,
129
+ "stackToStack": 111,
130
+ "virtualIpAddress": 112,
131
+ "mpc": 113,
132
+ "ipOverAtm": 114,
133
+ "iso88025Fiber": 115,
134
+ "tdlc": 116,
135
+ "gigabitEthernet": 117,
136
+ "hdlc": 118,
137
+ "lapf": 119,
138
+ "v37": 120,
139
+ "x25mlp": 121,
140
+ "x25huntGroup": 122,
141
+ "transpHdlc": 123,
142
+ "interleave": 124,
143
+ "fast": 125,
144
+ "ip": 126,
145
+ "docsCableMaclayer": 127,
146
+ "docsCableDownstream": 128,
147
+ "docsCableUpstream": 129,
148
+ "a12MppSwitch": 130,
149
+ "tunnel": 131,
150
+ "coffee": 132,
151
+ "ces": 133,
152
+ "atmSubInterface": 134,
153
+ "l2vlan": 135,
154
+ "l3ipvlan": 136,
155
+ "l3ipxvlan": 137,
156
+ "digitalPowerline": 138,
157
+ "mediaMailOverIp": 139,
158
+ "dtm": 140,
159
+ "dcn": 141,
160
+ "ipForward": 142,
161
+ "msdsl": 143,
162
+ "ieee1394": 144,
163
+ "if-gsn": 145,
164
+ "dvbRccMacLayer": 146,
165
+ "dvbRccDownstream": 147,
166
+ "dvbRccUpstream": 148,
167
+ "atmVirtual": 149,
168
+ "mplsTunnel": 150,
169
+ "srp": 151,
170
+ "voiceOverAtm": 152,
171
+ "voiceOverFrameRelay": 153,
172
+ "idsl": 154,
173
+ "compositeLink": 155,
174
+ "ss7SigLink": 156,
175
+ "propWirelessP2P": 157,
176
+ "frForward": 158,
177
+ "rfc1483": 159,
178
+ "usb": 160,
179
+ "ieee8023adLag": 161,
180
+ "bgppolicyaccounting": 162,
181
+ "frf16MfrBundle": 163,
182
+ "h323Gatekeeper": 164,
183
+ "h323Proxy": 165,
184
+ "mpls": 166,
185
+ "mfSigLink": 167,
186
+ "hdsl2": 168,
187
+ "shdsl": 169,
188
+ "ds1FDL": 170,
189
+ "pos": 171,
190
+ "dvbAsiIn": 172,
191
+ "dvbAsiOut": 173,
192
+ "plc": 174,
193
+ "nfas": 175,
194
+ "tr008": 176,
195
+ "gr303RDT": 177,
196
+ "gr303IDT": 178,
197
+ "isup": 179,
198
+ "propDocsWirelessMaclayer": 180,
199
+ "propDocsWirelessDownstream": 181,
200
+ "propDocsWirelessUpstream": 182,
201
+ "hiperlan2": 183,
202
+ "propBWAp2Mp": 184,
203
+ "sonetOverheadChannel": 185,
204
+ "digitalWrapperOverheadChannel": 186,
205
+ "aal2": 187,
206
+ "radioMAC": 188,
207
+ "atmRadio": 189,
208
+ "imt": 190,
209
+ "mvl": 191,
210
+ "reachDSL": 192,
211
+ "frDlciEndPt": 193,
212
+ "atmVciEndPt": 194,
213
+ "opticalChannel": 195,
214
+ "opticalTransport": 196,
215
+ "propAtm": 197,
216
+ "voiceOverCable": 198,
217
+ "infiniband": 199,
218
+ "teLink": 200,
219
+ "q2931": 201,
220
+ "virtualTg": 202,
221
+ "sipTg": 203,
222
+ "sipSig": 204,
223
+ "docsCableUpstreamChannel": 205,
224
+ "econet": 206,
225
+ "pon155": 207,
226
+ "pon622": 208,
227
+ "bridge": 209,
228
+ "linegroup": 210,
229
+ "voiceEMFGD": 211,
230
+ "voiceFGDEANA": 212,
231
+ "voiceDID": 213,
232
+ "mpegTransport": 214,
233
+ "sixToFour": 215,
234
+ "gtp": 216,
235
+ "pdnEtherLoop1": 217,
236
+ "pdnEtherLoop2": 218,
237
+ "opticalChannelGroup": 219,
238
+ "homepna": 220,
239
+ "gfp": 221,
240
+ "ciscoISLvlan": 222,
241
+ "actelisMetaLOOP": 223,
242
+ "fcipLink": 224,
243
+ "rpr": 225,
244
+ "qam": 226,
245
+ "lmp": 227,
246
+ "cblVectaStar": 228,
247
+ "docsCableMCmtsDownstream": 229,
248
+ "adsl2": 230,
249
+ "macSecControlledIF": 231,
250
+ "macSecUncontrolledIF": 232,
251
+ "aviciOpticalEther": 233,
252
+ "atmbond": 234,
253
+ "voiceFGDOS": 235,
254
+ "mocaVersion1": 236,
255
+ "ieee80216WMAN": 237,
256
+ "adsl2plus": 238,
257
+ "dvbRcsMacLayer": 239,
258
+ "dvbTdm": 240,
259
+ "dvbRcsTdma": 241,
260
+ "x86Laps": 242,
261
+ "wwanPP": 243,
262
+ "wwanPP2": 244,
263
+ "voiceEBS": 245,
264
+ "ifPwType": 246,
265
+ "ilan": 247,
266
+ "pip": 248,
267
+ "aluELP": 249,
268
+ "gpon": 250,
269
+ "vdsl2": 251,
270
+ "capwapDot11Profile": 252,
271
+ "capwapDot11Bss": 253,
272
+ "capwapWtpVirtualRadio": 254,
273
+ "bits": 255,
274
+ "docsCableUpstreamRfPort": 256,
275
+ "cableDownstreamRfPort": 257,
276
+ "vmwareVirtualNic": 258,
277
+ "ieee802154": 259,
278
+ },
279
+ )
277
280
 
278
281
  """
279
282
  struct pcap_hdr_s {
@@ -296,28 +299,28 @@ typedef struct pcaprec_hdr_s {
296
299
  LINKTYPE_ETHERNET = 1
297
300
  LINKTYPE_RAW = 101
298
301
 
299
- ETHERNET_HEADER = b'\xBE\xEF' * 6 + b'\x08\x00'
302
+ ETHERNET_HEADER = b"\xbe\xef" * 6 + b"\x08\x00"
300
303
 
301
304
  device_packet_struct = Struct(
302
- 'header_length' / Int32ub,
303
- 'header_version' / Byte,
304
- 'packet_length' / Int32ub,
305
- 'interface_type' / Byte,
306
- 'unit' / Int16ub,
307
- 'io' / Byte,
308
- 'protocol_family' / Int32ub,
309
- 'frame_pre_length' / Int32ub,
310
- 'frame_post_length' / Int32ub,
311
- 'interface_name' / Padded(16, CString('utf8')),
312
- 'pid' / Int32ul,
313
- 'comm' / Padded(17, CString('utf8')),
314
- 'svc' / Int32ub,
315
- 'epid' / Int32ul,
316
- 'ecomm' / Padded(17, CString('utf8')),
317
- 'seconds' / Int32ub,
318
- 'microseconds' / Int32ub,
305
+ "header_length" / Int32ub,
306
+ "header_version" / Byte,
307
+ "packet_length" / Int32ub,
308
+ "interface_type" / Byte,
309
+ "unit" / Int16ub,
310
+ "io" / Byte,
311
+ "protocol_family" / Int32ub,
312
+ "frame_pre_length" / Int32ub,
313
+ "frame_post_length" / Int32ub,
314
+ "interface_name" / Padded(16, CString("utf8")),
315
+ "pid" / Int32ul,
316
+ "comm" / Padded(17, CString("utf8")),
317
+ "svc" / Int32ub,
318
+ "epid" / Int32ul,
319
+ "ecomm" / Padded(17, CString("utf8")),
320
+ "seconds" / Int32ub,
321
+ "microseconds" / Int32ub,
319
322
  Seek(this.header_length),
320
- 'data' / Bytes(this.packet_length),
323
+ "data" / Bytes(this.packet_length),
321
324
  )
322
325
 
323
326
 
@@ -333,8 +336,9 @@ class PcapdService(LockdownService):
333
336
  an iOS device. On macOS, the virtual interface can be enabled with the rvictl command. This script allows to use
334
337
  this service on other systems.
335
338
  """
336
- RSD_SERVICE_NAME = 'com.apple.pcapd.shim.remote'
337
- SERVICE_NAME = 'com.apple.pcapd'
339
+
340
+ RSD_SERVICE_NAME = "com.apple.pcapd.shim.remote"
341
+ SERVICE_NAME = "com.apple.pcapd"
338
342
 
339
343
  def __init__(self, lockdown: LockdownServiceProvider):
340
344
  if isinstance(lockdown, LockdownClient):
@@ -342,8 +346,9 @@ class PcapdService(LockdownService):
342
346
  else:
343
347
  super().__init__(lockdown, self.RSD_SERVICE_NAME)
344
348
 
345
- def watch(self, packets_count: int = -1, process: Optional[str] = None, interface_name: Optional[str] = None) \
346
- -> Generator[Container, None, None]:
349
+ def watch(
350
+ self, packets_count: int = -1, process: Optional[str] = None, interface_name: Optional[str] = None
351
+ ) -> Generator[Container, None, None]:
347
352
  packet_index = 0
348
353
  while packet_index != packets_count:
349
354
  d = self.service.recv_plist()
@@ -352,13 +357,11 @@ class PcapdService(LockdownService):
352
357
 
353
358
  packet = device_packet_struct.parse(d)
354
359
 
355
- if process is not None:
356
- if process != str(packet.pid) and process != packet.comm:
357
- continue
360
+ if process is not None and process != str(packet.pid) and process != packet.comm:
361
+ continue
358
362
 
359
- if interface_name is not None:
360
- if interface_name != packet.interface_name:
361
- continue
363
+ if interface_name is not None and interface_name != packet.interface_name:
364
+ continue
362
365
 
363
366
  packet.interface_type = INTERFACE_NAMES(packet.interface_type)
364
367
  packet.protocol_family = CrossPlatformAddressFamily(packet.protocol_family)
@@ -366,7 +369,7 @@ class PcapdService(LockdownService):
366
369
  if not packet.frame_pre_length:
367
370
  # Add fake ethernet header for pdp packets.
368
371
  packet.data = ETHERNET_HEADER + packet.data
369
- elif packet.interface_name == 'pdp_ip':
372
+ elif packet.interface_name == "pdp_ip":
370
373
  packet.data = ETHERNET_HEADER + packet.data[4:]
371
374
 
372
375
  yield packet
@@ -376,35 +379,32 @@ class PcapdService(LockdownService):
376
379
  def write_to_pcap(self, out, packet_generator) -> None:
377
380
  shb = blocks.SectionHeader(
378
381
  options={
379
- 'shb_hardware': 'artificial',
380
- 'shb_os': 'iOS',
381
- 'shb_userappl': 'pymobiledevice3',
382
+ "shb_hardware": "artificial",
383
+ "shb_os": "iOS",
384
+ "shb_userappl": "pymobiledevice3",
382
385
  }
383
386
  )
384
387
  shb.new_member(
385
388
  blocks.InterfaceDescription,
386
389
  link_type=1,
387
- options={
388
- 'if_description': 'iOS Packet Capture',
389
- 'if_os': f'iOS {self.lockdown.product_version}'
390
- },
390
+ options={"if_description": "iOS Packet Capture", "if_os": f"iOS {self.lockdown.product_version}"},
391
391
  )
392
392
  writer = FileWriter(out, shb)
393
393
 
394
394
  for packet in packet_generator:
395
- if hasattr(packet, 'timestamp'):
396
- packet_time = packet.timestamp
397
- else:
398
- packet_time = time.time()
395
+ packet_time = packet.timestamp if hasattr(packet, "timestamp") else time.time()
399
396
 
400
397
  timestamp_microseconds = int(packet_time * 1_000_000)
401
398
  timestamp_high = (timestamp_microseconds >> 32) & 0xFFFFFFFF
402
399
  timestamp_low = timestamp_microseconds & 0xFFFFFFFF
403
400
 
404
- enhanced_packet = shb.new_member(blocks.EnhancedPacket, options={
405
- 'opt_comment': f'PID: {packet.pid}, ProcName: {packet.comm}, EPID: {packet.epid}, '
406
- f'EProcName: {packet.ecomm}, SVC: {packet.svc}'
407
- })
401
+ enhanced_packet = shb.new_member(
402
+ blocks.EnhancedPacket,
403
+ options={
404
+ "opt_comment": f"PID: {packet.pid}, ProcName: {packet.comm}, EPID: {packet.epid}, "
405
+ f"EProcName: {packet.ecomm}, SVC: {packet.svc}"
406
+ },
407
+ )
408
408
 
409
409
  enhanced_packet.packet_data = packet.data
410
410
  enhanced_packet.timestamp_high = timestamp_high