Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Vision Pro Support #1094

Open
Colonelpanic0 opened this issue Jun 25, 2024 · 3 comments
Open

Apple Vision Pro Support #1094

Colonelpanic0 opened this issue Jun 25, 2024 · 3 comments

Comments

@Colonelpanic0
Copy link

Is your feature request related to a problem? Please describe.
When connecting to Apple Vision Pro through a remote session, the device is detected through Bonjour presumably, but throws errors when attempting to connect. I'd like to be able to connect to AVP for device management features.

Describe the solution you'd like
Successful connectivity to AVP over wireless.

Describe alternatives you've considered
Might be feasible with the developer strap, which provides a wired connection instead.

Additional context
Here is the device being picked up after running python3 -m pymobiledevice3 remote pair

Screenshot 2024-06-25 at 7 04 59 PM

Here is the errors after attempting to connect:

INFO Waiting user pairing consent
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/__main__.py", line 176, in <module>
    main()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/__main__.py", line 100, in main
    cli()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/cli/remote.py", line 240, in cli_pair
    asyncio.run(start_remote_pair_task(name), debug=True)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/cli/remote.py", line 233, in start_remote_pair_task
    await service.connect(autopair=True)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/remote/tunnel_service.py", line 904, in connect
    await RemotePairingProtocol.connect(self, autopair=autopair)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/remote/tunnel_service.py", line 373, in connect
    await self._pair()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/remote/tunnel_service.py", line 494, in _pair
    await self._verify_proof()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymobiledevice3/remote/tunnel_service.py", line 562, in _verify_proof
    assert self.srp_context.verify_proof(data[PairingDataComponentType.PROOF].hex().encode())
                                         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: EnumIntegerString.new(4, 'PROOF')

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@doronz88
Copy link
Owner

Please verify if the same stuff applying to AppleTV may also be applied to Apple VisionPro (simply try adding your own device string there):

if 'pairingRejectedWithError' in response:
raise PairingError(
response['pairingRejectedWithError']['wrappedError']['userInfo']['NSLocalizedDescription'])
elif 'awaitingUserConsent' in response:
pairing_data = await self._receive_pairing_data()
else:
# On tvOS no consent is needed and pairing data is returned immediately.
pairing_data = self._decode_bytes_if_needed(response['pairingData']['_0']['data'])
# On tvOS we need pin to setup pairing.
if 'AppleTV' in self.remote_device_model:
pin = input('Enter PIN: ')

@Colonelpanic0
Copy link
Author

Well, it got a little further this time. Changing the 'AppleTV' string to 'Apple Vision Pro' I get the PIN to appear briefly on the connect attempt on the AVP itself, but it disappears and the script throws an error again.

47] INFO Waiting user pairing consent
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/__main__.py", line 174, in <module>
    main()
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/__main__.py", line 100, in main
    cli()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/cli/remote.py", line 240, in cli_pair
    asyncio.run(start_remote_pair_task(name), debug=True)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/cli/remote.py", line 233, in start_remote_pair_task
    await service.connect(autopair=True)
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/remote/tunnel_service.py", line 904, in connect
    await RemotePairingProtocol.connect(self, autopair=autopair)
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/remote/tunnel_service.py", line 373, in connect
    await self._pair()
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/remote/tunnel_service.py", line 494, in _pair
    await self._verify_proof()
  File "/Users/ric/pymobiledevice3/pymobiledevice3/pymobiledevice3/remote/tunnel_service.py", line 562, in _verify_proof
    assert self.srp_context.verify_proof(data[PairingDataComponentType.PROOF].hex().encode())
                                         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: EnumIntegerString.new(4, 'PROOF')

@doronz88
Copy link
Owner

doronz88 commented Jul 2, 2024

Sounds like it's not the same issue as in AppleTV. Can you print the data you are receiving instead of the expected one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants