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

tunneld: add mobdev2 monitor #955

Merged
merged 2 commits into from
Apr 24, 2024
Merged

tunneld: add mobdev2 monitor #955

merged 2 commits into from
Apr 24, 2024

Conversation

doronz88
Copy link
Owner

No description provided.

@doronz88 doronz88 force-pushed the feature/mobdev2-monitor branch 3 times, most recently from cad285a to de4b4df Compare April 23, 2024 16:03
@doronz88 doronz88 force-pushed the feature/mobdev2-monitor branch 3 times, most recently from 5ec6732 to b3d5d0d Compare April 24, 2024 06:13
@takov751
Copy link
Contributor

for some reason paired device are not detected by lockdown module get_mobdev2_lockdown function.
So i had to manually edit line in tunneld.py
async for ip, lockdown in get_mobdev2_lockdowns(only_paired=True):
only_paired=False

It starts working as it's suppose to, however after sometime when phone locks itself tunneld crashes with error:

  File "/home/takov/DEV/pymobiledevice3/pymobiledevice3/utils.py", line 44, in wrapper
    return await f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/takov/DEV/pymobiledevice3/pymobiledevice3/tunneld.py", line 162, in monitor_mobdev2_task
    async for ip, lockdown in get_mobdev2_lockdowns(only_paired=False):
  File "/home/takov/DEV/pymobiledevice3/pymobiledevice3/lockdown.py", line 820, in get_mobdev2_lockdowns
    lockdown = create_using_tcp(hostname=ip, autopair=False, pair_record=record)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/takov/DEV/pymobiledevice3/pymobiledevice3/lockdown.py", line 759, in create_using_tcp
    service = ServiceConnection.create_using_tcp(hostname, port, keep_alive=keep_alive)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/takov/DEV/pymobiledevice3/pymobiledevice3/service_connection.py", line 81, in create_using_tcp
    sock = socket.create_connection((hostname, port))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/socket.py", line 827, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known

@doronz88
Copy link
Owner Author

doronz88 commented Apr 24, 2024

@takov751 I just pushed a commit to ignore all lockdown errors during tunneld establishment as to not break tunneld at any flow

@doronz88 doronz88 merged commit a4f86f1 into master Apr 24, 2024
17 checks passed
@doronz88 doronz88 deleted the feature/mobdev2-monitor branch April 24, 2024 06:52
@takov751
Copy link
Contributor

quickly tested the recent change. Tunnel works for short period of time then it does not crash just hangs. manually had to kill the process from another terminal

@doronz88
Copy link
Owner Author

can you debug and tell where it happens? i was not able to reproduce

@takov751
Copy link
Contributor

Of course @doronz88 tomorrow i'll report back

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

Successfully merging this pull request may close these issues.

None yet

2 participants