libimobiledevice / libusbmuxd

A client library to multiplex connections from and to iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v2.1
589 stars 270 forks source link

Win32: fix bug that network device cannot connect #121

Closed AiXanadu closed 1 year ago

AiXanadu commented 2 years ago

On windows, the data transmitted by the driver is not the same as that on other platforms. The data I output is: 02 00 00 00 C0 A8 1F 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Bit 0 is AF_INET, and the following 4-7 bits are IPv4 address. So I modified it to match this prefix only under windows. Now, it can normally connect to the WiFi device of IPv4.

@nikias

AiXanadu commented 2 years ago

I manually adjusted the data to match the format used by libimobiledevice. https://github.com/libimobiledevice/libimobiledevice/blob/fa8bfb65c70edd4d2617fbbf970302beb9a4ced2/src/idevice.c#L383 https://github.com/libimobiledevice/libimobiledevice/blob/fa8bfb65c70edd4d2617fbbf970302beb9a4ced2/src/idevice.c#L475

nikias commented 1 year ago

This is good, @xanadu-lee do you know if the IPv6 data looks like this?

1c 00 00 00 00 00 00 00 <IPV6Addr bytes ....>
AiXanadu commented 1 year ago

这很好,你知道IPv6数据是不是这样的吗?

1c 00 00 00 00 00 00 00 <IPV6Addr bytes ....>

Please, it's been a year and a half.

beni20 commented 1 year ago

thx @xanadu-lee for that fix. Is it not merged yet/in master? I changed that file and do a bit of progress. So that fix worked for me. Device in restore mode was detected. Now i'm stuck with other error but i guess its not related...

Starting Reverse Proxy ReverseProxy[Ctrl]: (status=1) Ready Checkpoint 1547 complete with code 0 Waiting for NAND (28) Checkpoint 1549 complete with code 0 Updating NAND Firmware (58) ERROR: Could not read data (-256). Aborting. ReverseProxy[Ctrl]: Connection closed ReverseProxy[Ctrl]: Terminating ReverseProxy[Ctrl]: (status=2) Terminated ERROR: Unable to restore device

AiXanadu commented 1 year ago

Restoring a device is not related to WIFI connection, you cannot restore a WIFI connected device.