pymobiledevice3 4.21.4__py3-none-any.whl → 4.21.5__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.

@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '4.21.4'
21
- __version_tuple__ = version_tuple = (4, 21, 4)
20
+ __version__ = version = '4.21.5'
21
+ __version_tuple__ = version_tuple = (4, 21, 5)
@@ -68,6 +68,7 @@ from pymobiledevice3.remote.xpc_message import XpcInt64Type, XpcUInt64Type
68
68
  from pymobiledevice3.service_connection import ServiceConnection
69
69
  from pymobiledevice3.utils import asyncio_print_traceback
70
70
 
71
+ DEFAULT_INTERFACE_NAME = 'pymobiledevice3-tunnel'
71
72
  TIMEOUT = 1
72
73
 
73
74
  OSUTIL = get_os_utils()
@@ -168,16 +169,23 @@ class RemotePairingTunnel(ABC):
168
169
  await self.send_packet_to_device(packet)
169
170
  else:
170
171
  while True:
171
- packet = await asyncio.get_running_loop().run_in_executor(None, self.tun.read)
172
+ packet = await self.tun.async_read()
172
173
  if packet:
174
+ if (packet[0] >> 4) != 6:
175
+ # Make sure to output only IPv6 packets
176
+ continue
173
177
  await self.send_packet_to_device(packet)
174
178
  except ConnectionResetError:
175
179
  self._logger.warning(f'got connection reset in {asyncio.current_task().get_name()}')
176
180
  except OSError:
177
181
  self._logger.warning(f'got oserror in {asyncio.current_task().get_name()}')
178
182
 
179
- def start_tunnel(self, address: str, mtu: int) -> None:
180
- self.tun = TunTapDevice()
183
+ def start_tunnel(self, address: str, mtu: int, interface_name=DEFAULT_INTERFACE_NAME) -> None:
184
+ if 'win32' == sys.platform:
185
+ # Only win32 tunnel implementation supports interface name
186
+ self.tun = TunTapDevice(interface_name)
187
+ else:
188
+ self.tun = TunTapDevice()
181
189
  self.tun.addr = address
182
190
  self.tun.mtu = mtu
183
191
  self.tun.up()
@@ -232,8 +240,8 @@ class RemotePairingQuicTunnel(RemotePairingTunnel, QuicConnectionProtocol):
232
240
  await self.ping()
233
241
  await asyncio.sleep(self._quic.configuration.idle_timeout / 2)
234
242
 
235
- def start_tunnel(self, address: str, mtu: int) -> None:
236
- super().start_tunnel(address, mtu)
243
+ def start_tunnel(self, address: str, mtu: int, interface_name=DEFAULT_INTERFACE_NAME) -> None:
244
+ super().start_tunnel(address, mtu, interface_name=interface_name)
237
245
  self._keep_alive_task = asyncio.create_task(self.keep_alive_task())
238
246
 
239
247
  async def stop_tunnel(self) -> None:
@@ -295,8 +303,8 @@ class RemotePairingTcpTunnel(RemotePairingTunnel):
295
303
  await self._writer.drain()
296
304
  return json.loads(CDTunnelPacket.parse(await self._reader.read(self.REQUESTED_MTU)).body)
297
305
 
298
- def start_tunnel(self, address: str, mtu: int) -> None:
299
- super().start_tunnel(address, mtu)
306
+ def start_tunnel(self, address: str, mtu: int, interface_name=DEFAULT_INTERFACE_NAME) -> None:
307
+ super().start_tunnel(address, mtu, interface_name=interface_name)
300
308
  self._sock_read_task = asyncio.create_task(self.sock_read_task(), name=f'sock-read-task-{address}')
301
309
 
302
310
  async def stop_tunnel(self) -> None:
@@ -437,7 +445,8 @@ class RemotePairingProtocol(StartTcpTunnel):
437
445
  await client.wait_connected()
438
446
  handshake_response = await client.request_tunnel_establish()
439
447
  client.start_tunnel(handshake_response['clientParameters']['address'],
440
- handshake_response['clientParameters']['mtu'])
448
+ handshake_response['clientParameters']['mtu'],
449
+ interface_name=f'{DEFAULT_INTERFACE_NAME}-{self.remote_identifier}')
441
450
  try:
442
451
  yield TunnelResult(
443
452
  client.tun.name, handshake_response['serverAddress'], handshake_response['serverRSDPort'],
@@ -471,7 +480,8 @@ class RemotePairingProtocol(StartTcpTunnel):
471
480
  handshake_response = await tunnel.request_tunnel_establish()
472
481
 
473
482
  tunnel.start_tunnel(handshake_response['clientParameters']['address'],
474
- handshake_response['clientParameters']['mtu'])
483
+ handshake_response['clientParameters']['mtu'],
484
+ interface_name=f'{DEFAULT_INTERFACE_NAME}-{self.remote_identifier}')
475
485
 
476
486
  try:
477
487
  yield TunnelResult(
@@ -945,7 +955,8 @@ class CoreDeviceTunnelProxy(StartTcpTunnel):
945
955
  tunnel = RemotePairingTcpTunnel(self._service.reader, self._service.writer)
946
956
  handshake_response = await tunnel.request_tunnel_establish()
947
957
  tunnel.start_tunnel(handshake_response['clientParameters']['address'],
948
- handshake_response['clientParameters']['mtu'])
958
+ handshake_response['clientParameters']['mtu'],
959
+ interface_name=f'{DEFAULT_INTERFACE_NAME}-{self.remote_identifier}')
949
960
  try:
950
961
  yield TunnelResult(
951
962
  tunnel.tun.name, handshake_response['serverAddress'], handshake_response['serverRSDPort'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymobiledevice3
3
- Version: 4.21.4
3
+ Version: 4.21.5
4
4
  Summary: Pure python3 implementation for working with iDevices (iPhone, etc...)
5
5
  Author-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>
@@ -58,7 +58,7 @@ Requires-Dist: qh3<2,>=1.0.0
58
58
  Requires-Dist: developer_disk_image>=0.0.2
59
59
  Requires-Dist: opack2
60
60
  Requires-Dist: psutil
61
- Requires-Dist: pytun-pmd3>=2.0.9
61
+ Requires-Dist: pytun-pmd3>=2.1.0
62
62
  Requires-Dist: aiofiles
63
63
  Requires-Dist: prompt_toolkit
64
64
  Requires-Dist: sslpsk-pmd3>=1.0.3; python_version < "3.13"
@@ -8,7 +8,7 @@ misc/understanding_idevice_protocol_layers.md,sha256=8tEqRXWOUPoxOJLZVh7C7H9JGCh
8
8
  misc/usbmux_sniff.sh,sha256=iWtbucOEQ9_UEFXk9x-2VNt48Jg5zrPsnUbZ_LfZxwA,212
9
9
  pymobiledevice3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  pymobiledevice3/__main__.py,sha256=nwUgfXBMii2MSXLUls2uMTG88uC13s4haPBM4LuGcaU,11530
11
- pymobiledevice3/_version.py,sha256=L0S9xHZAqvyvcVNRszketqOwbVGHMmww4Q5KcJSZP7E,513
11
+ pymobiledevice3/_version.py,sha256=2ypGgANS8HaAICkcU7N8oU7jRJfq7P3G_Ujg6WJFe78,513
12
12
  pymobiledevice3/bonjour.py,sha256=FXa_x0Zdo6ims7N7F61hnnZEyn1tc2it3mQpHRMY0Kk,5560
13
13
  pymobiledevice3/ca.py,sha256=Ho0NaOtATe5hdruUSlVDRpfR9ltEYXjL3MoKwEvEJjw,2296
14
14
  pymobiledevice3/common.py,sha256=-PG6oaUkNFlB3jb7E0finMrX8wqhkS-cuTAfmLvZUmc,329
@@ -60,7 +60,7 @@ pymobiledevice3/remote/module_imports.py,sha256=DwExSL1r4kkFIWmXiQpqPo-cGl4duYd3
60
60
  pymobiledevice3/remote/remote_service.py,sha256=fCyzm4oT_WEorAXVHVLYnIOyTOuMGhX69Co3HkUdRYY,867
61
61
  pymobiledevice3/remote/remote_service_discovery.py,sha256=iqPE1PiDDB2ISK-ThuUPEiSU9ETZ-FGTcANhb6MrWmo,7156
62
62
  pymobiledevice3/remote/remotexpc.py,sha256=KbFHaH4D3RnaATve6kaIpJMHNF8H-kdhbRbEbxFmO6w,8082
63
- pymobiledevice3/remote/tunnel_service.py,sha256=a9s2pDnPfGCP166eb2CAeQEORwxNoUTn5OftjiODN7g,45761
63
+ pymobiledevice3/remote/tunnel_service.py,sha256=IyEfVj-6qWD3Tmt3-7IHAN0Tg81_GxS61T9HB1IxsRc,46579
64
64
  pymobiledevice3/remote/utils.py,sha256=BgUODRwkET5lyloZxJ-PrVZqTvyOlBuJ-MM7OCSqZ9g,2506
65
65
  pymobiledevice3/remote/xpc_message.py,sha256=-nVbf88ZN4ZNxLg6cOq4FfeKXYAoVRKnwGdfe7s-sZE,9336
66
66
  pymobiledevice3/remote/core_device/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -164,9 +164,9 @@ pymobiledevice3/services/web_protocol/switch_to.py,sha256=hDddJUEePbRN-8xlllOeGh
164
164
  pymobiledevice3/tunneld/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
165
  pymobiledevice3/tunneld/api.py,sha256=EfGKXEWhsMSB__menPmRmL9R6dpazVJDUy7B3pn05MM,2357
166
166
  pymobiledevice3/tunneld/server.py,sha256=SvC57AV_R8YQhA0fCwGNUdhfy8TKMFWwL_fp_FmXrBI,22715
167
- pymobiledevice3-4.21.4.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
168
- pymobiledevice3-4.21.4.dist-info/METADATA,sha256=snPi-jeUNDZeBWNFCmjmxcQOFlesyeiqx-MEcumR7Tg,17500
169
- pymobiledevice3-4.21.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
170
- pymobiledevice3-4.21.4.dist-info/entry_points.txt,sha256=jJMlOanHlVwUxcY__JwvKeWPrvBJr_wJyEq4oHIZNKE,66
171
- pymobiledevice3-4.21.4.dist-info/top_level.txt,sha256=MjZoRqcWPOh5banG-BbDOnKEfsS3kCxqV9cv-nzyg2Q,21
172
- pymobiledevice3-4.21.4.dist-info/RECORD,,
167
+ pymobiledevice3-4.21.5.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
168
+ pymobiledevice3-4.21.5.dist-info/METADATA,sha256=xH7mdSkWJILYJw9FmAkabVh26rgZ3wyctEqo9OMpUck,17500
169
+ pymobiledevice3-4.21.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
170
+ pymobiledevice3-4.21.5.dist-info/entry_points.txt,sha256=jJMlOanHlVwUxcY__JwvKeWPrvBJr_wJyEq4oHIZNKE,66
171
+ pymobiledevice3-4.21.5.dist-info/top_level.txt,sha256=MjZoRqcWPOh5banG-BbDOnKEfsS3kCxqV9cv-nzyg2Q,21
172
+ pymobiledevice3-4.21.5.dist-info/RECORD,,