Skip to content

Commit

Permalink
Merge pull request #791 from doronz88/bugfix/tunneld-min-ios
Browse files Browse the repository at this point in the history
tunneld: avoid establishing quic tunnels on ios<17
  • Loading branch information
doronz88 authored Jan 18, 2024
2 parents 56d74e8 + 4a596b6 commit 8892853
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pymobiledevice3/tunneld.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import uvicorn
from fastapi import FastAPI
from ifaddr import get_adapters
from packaging.version import Version

from pymobiledevice3.remote.bonjour import query_bonjour
from pymobiledevice3.remote.common import TunnelProtocol
Expand All @@ -21,10 +22,6 @@

logger = logging.getLogger(__name__)

ZEROCONF_TIMEOUT = 3000
MIN_VERSION = '17.0.0'
UNINIT_ADDRESS = ('', 0)


@dataclasses.dataclass
class TunnelTask:
Expand Down Expand Up @@ -83,7 +80,7 @@ async def handle_new_ip(self, ip: str):
# validate a CoreDevice was indeed found
addresses = query.listener.addresses
if not addresses:
return
raise asyncio.CancelledError()
peer_address = addresses[0]

# establish an untrusted RSD handshake
Expand All @@ -92,7 +89,10 @@ async def handle_new_ip(self, ip: str):
try:
rsd.connect()
except ConnectionRefusedError:
return
raise asyncio.CancelledError()

if (self.protocol == TunnelProtocol.QUIC) and (Version(rsd.product_version) < Version('17.0.0')):
raise asyncio.CancelledError()

# populate the udid from the untrusted RSD information
self.tunnel_tasks[ip].udid = rsd.udid
Expand Down

0 comments on commit 8892853

Please sign in to comment.