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

compilation error on the latest version of libusbmuxd on windows #95

Closed
iFred09 opened this issue Jun 17, 2020 · 19 comments
Closed

compilation error on the latest version of libusbmuxd on windows #95

iFred09 opened this issue Jun 17, 2020 · 19 comments

Comments

@iFred09
Copy link

iFred09 commented Jun 17, 2020

Hello,

I'm trying to compile the latest version of libusbmuxd and I have this error, and I never had this error before (i successfully compiled this one month ago).
Same error when I compile with the version in the "Release" tab.

compileerror

Thank's!

@iFred09 iFred09 changed the title compilation error on the latest version of libusbmuxd compilation error on the latest version of libusbmuxd on windows Jun 17, 2020
@elekven-m
Copy link

I get this error also. Building using gcc 8.1.0 under mingw.

@Orbif
Copy link

Orbif commented Jun 26, 2020

Looks like freeifaddrs and getifaddrs aren't available on mingw.

I found out some implementation of theses functions exist for PyGObject project on Windows.

I created a patch adding these functions to libimobiledevice. With this patch, the compilation works fine, but maybe there is a better way to do this on Windows ?

@iFred09
Copy link
Author

iFred09 commented Jun 26, 2020

hi @Orbif I want to know how to use your patch. Thx !

@brendonjkding
Copy link

brendonjkding commented Jun 27, 2020

hi @Orbif I want to know how to use your patch. Thx !

  1. Download libimobiledevice-socket-mingw-compatibility.patch and move it to libusbmuxd(and libimobiledevice) folder
  2. git apply libimobiledevice-socket-mingw-compatibility.patch

@iFred09
Copy link
Author

iFred09 commented Jun 27, 2020

it works fine for libusbmuxd and libimobiledevice, thank's !

@haen7
Copy link

haen7 commented Jun 28, 2020

I built libusbmuxd and libimobiledevice using @Orbif's patch. Now idevice_id shows network devices but ideviceinfo -n gives ERROR.
Annotation 2020-06-28 175340

@bricedenice59
Copy link

The patch quoted above does not resolve compilation issues I have on Windows.
When could we have a working version that compiles ?
image

@AiXanadu
Copy link

Hello, can this patch connect to network devices? I tried to delete the IPv6 code, but it showed when I connected to a network device LOCKDOWN_E_MUX_ERROR

@AiXanadu
Copy link

I'm sorry, I'm using a translation tool

@AiXanadu
Copy link

@FunkyM

Can you ask when you plan to fix the version compilation of MinGW?

@dkw72n
Copy link

dkw72n commented Sep 29, 2020

The patch quoted above does not resolve compilation issues I have on Windows.
When could we have a working version that compiles ?
image

add -D_WIN32_WINNT=0x600 to CFLAGS if you don't need your program to run below Windows XP.

see: http://www.mingw.org/wiki/Use_more_recent_defined_functions for more information

@AiXanadu
Copy link

@dkw72n
I tried, but it didn't help.
lack getifaddrs 、freeifaddrs and IFF_RUNNING

Maybe the author didn't consider supporting Win32

@dkw72n
Copy link

dkw72n commented Oct 4, 2020

@dkw72n
I tried, but it didn't help.
lack getifaddrs 、freeifaddrs and IFF_RUNNING

Maybe the author didn't consider supporting Win32

You also need the patch mentioned above for those functions

@nikias
Copy link
Member

nikias commented Oct 12, 2020

Hi, I created a patch that adds some of the functionality to compile it on win32. However while it compiles, I have no idea if it actually works.
https://gist.github.com/nikias/98e1723c7dcab771ee6627267133b28f

@nikias
Copy link
Member

nikias commented Oct 12, 2020

Oh and I am late to the game and didn't see @Orbif's patch 🤦

@mexmer
Copy link

mexmer commented Oct 16, 2020

when i have time, i will give some pull request for visual studio compilation. just need to check, if i didn't break linux compilation or msys

@AiXanadu
Copy link

AiXanadu commented Oct 22, 2020

To libusbmuxd libimobiledevice patch up https://github.com/Orbif/libimobiledevice-patchs/blob/master/libimobiledevice-socket-mingw-compatibility.patch
Also idevice.c >>
device->udid = strdup(muxdev->udid);
device->mux_id = muxdev->handle;
device->version = 0;
switch (muxdev->conn_type) {
case CONNECTION_TYPE_USB:
device->conn_type = CONNECTION_USBMUXD;
device->conn_data = NULL;
break;
case CONNECTION_TYPE_NETWORK:
device->conn_type = CONNECTION_NETWORK;
size_t len = ((uint8_t*)muxdev->conn_data)[0];
device->conn_data = malloc(len);
memcpy(device->conn_data, muxdev->conn_data, len);
device->conn_type = CONNECTION_USBMUXD; //add
device->conn_data = NULL; //add
break;
default:
device->conn_type = 0;
device->conn_data = NULL;
break;
}
return device;

The WiFi device can be successfully connected.
Here is the execution result:

D:\Download\Build>ideviceinfo.exe -u 2df9dfdd5c8d4fb91283b0a8e3ed00034dd3b94d -n
---- device info plist start -----

ConnectionType Network DeviceID 88 EscapedFullServiceName 98:00:c6:cd:db:2f@fe80::9a00:c6ff:fecd:db2f._apple-mobdev2._tcp.local. InterfaceIndex 8 NetworkAddress FwAAAAAAAAD+gAAAAAAAABTjbF+XozfNCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= SerialNumber 2df9dfdd5c8d4fb91283b0a8e3ed00034dd3b94d

---- device info plist end -----
NetworkAddress [Length:128] [0x00] : �_ _ _ _ _ _ _ € _ _ _ _ _ �_鉥l___梍7_蚠 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
NetworkAddress [Length:128] [0x00] : 23_0_0_0_0_0_0_0_-2_-128_0_0_0_0_0_0_20_-29_108_95_-105_-93_55_-51_8_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_
NetworkAddress [Length:128] [0x00] : 17_00_00_00_00_00_00_00_FFFFFFFE_FFFFFF80_00_00_00_00_00_00_14_FFFFFFE3_6C_5F_FFFFFF97_FFFFFFA3_37_FFFFFFCD_08_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_
NetworkAddress INT32 : 23
NetworkAddress INT64 : 23

15:28:11 lockdown.c:651 lockdownd_client_new(): device udid: 2df9dfdd5c8d4fb91283b0a8e3ed00034dd3b94d
15:28:11 lockdown.c:380 lockdownd_query_type(): called
15:28:11 property_list_service.c:132 internal_plist_send(): sending 284 bytes
15:28:11 service.c:144 service_send(): sending 4 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 4, sent 4
15:28:12 service.c:144 service_send(): sending 284 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 284, sent 284
15:28:12 property_list_service.c:137 internal_plist_send(): sent 284 bytes
15:28:12 property_list_service.c:205 internal_plist_receive_timeout(): initial read=4
15:28:12 property_list_service.c:211 internal_plist_receive_timeout(): 297 bytes following
15:28:12 property_list_service.c:224 internal_plist_receive_timeout(): received 297 bytes
15:28:12 lockdown.c:396 lockdownd_query_type(): success with type com.apple.mobile.lockdown
15:28:12 property_list_service.c:132 internal_plist_send(): sending 332 bytes
15:28:12 service.c:144 service_send(): sending 4 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 4, sent 4
15:28:12 service.c:144 service_send(): sending 332 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 332, sent 332
15:28:12 property_list_service.c:137 internal_plist_send(): sent 332 bytes
15:28:12 property_list_service.c:205 internal_plist_receive_timeout(): initial read=4
15:28:12 property_list_service.c:211 internal_plist_receive_timeout(): 325 bytes following
15:28:12 property_list_service.c:224 internal_plist_receive_timeout(): received 325 bytes
15:28:12 lockdown.c:449 lockdownd_get_value(): success
15:28:12 lockdown.c:460 lockdownd_get_value(): has a value
15:28:12 userpref.c:193 userpref_read_system_buid(): using 30836117-1230309011129734592 as SystemBUID
15:28:12 property_list_service.c:132 internal_plist_send(): sending 421 bytes
15:28:12 service.c:144 service_send(): sending 4 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 4, sent 4
15:28:12 service.c:144 service_send(): sending 421 bytes
15:28:12 idevice.c:623 idevice_connection_send(): internal_connection_send 421, sent 421
15:28:12 property_list_service.c:137 internal_plist_send(): sent 421 bytes
15:28:12 property_list_service.c:205 internal_plist_receive_timeout(): initial read=4
15:28:12 property_list_service.c:211 internal_plist_receive_timeout(): 354 bytes following
15:28:12 property_list_service.c:224 internal_plist_receive_timeout(): received 354 bytes
15:28:12 lockdown.c:1168 lockdownd_start_session(): Session startup OK
15:28:12 lockdown.c:1180 lockdownd_start_session(): SessionID: 976C1876-649F-4D29-8E41-1126574D91A7
15:28:12 lockdown.c:1187 lockdownd_start_session(): Enable SSL Session: true
15:28:12 idevice.c:1100 idevice_connection_enable_ssl(): Performing SSL handshake
15:28:12 idevice.c:1124 idevice_connection_enable_ssl(): SSL mode enabled, TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
15:28:12 property_list_service.c:132 internal_plist_send(): sending 283 bytes
15:28:12 service.c:144 service_send(): sending 4 bytes
15:28:12 idevice.c:606 idevice_connection_send(): SSL_write 4, sent 4
15:28:12 service.c:144 service_send(): sending 283 bytes
15:28:12 idevice.c:606 idevice_connection_send(): SSL_write 283, sent 283
15:28:12 property_list_service.c:137 internal_plist_send(): sent 283 bytes
15:28:12 idevice.c:732 idevice_connection_receive_timeout(): SSL_read 4, received 4
15:28:12 property_list_service.c:205 internal_plist_receive_timeout(): initial read=4
15:28:12 property_list_service.c:211 internal_plist_receive_timeout(): 5464 bytes following
15:28:12 idevice.c:732 idevice_connection_receive_timeout(): SSL_read 5464, received 5464
15:28:12 property_list_service.c:224 internal_plist_receive_timeout(): received 5464 bytes
15:28:12 lockdown.c:449 lockdownd_get_value(): success
15:28:12 lockdown.c:460 lockdownd_get_value(): has a value
ActivationState: Activated
ActivationStateAcknowledged: true
BasebandActivationTicketVersion: V2
BasebandCertId: 2315222105
BasebandChipID: 9781473
BasebandKeyHashInformation:
AKeyStatus: 2
SKeyHash: u+/tcCwvaQ+1Y9t40I4yegCEmB28mALlaROhaIVGBWo=
SKeyStatus: 0
BasebandMasterKeyHash: 8CB15EE4C8002199070D9500BB8FB183B02713A5CA2A6B92DB5E75CE15536182
BasebandRegionSKU: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
BasebandSerialNumber: I/JieQ==
BasebandStatus: BBInfoAvailable
BasebandVersion: 8.02.00
BluetoothAddress: 98:00:c6:cd:db:30
BoardId: 8
BrickState: false
BuildVersion: 18B5052h
CPUArchitecture: arm64
CarrierBundleInfoArray[0]:
CertID: 2315222105
ChipID: 32784
ChipSerialNo: I/JieQ==
DeviceClass: iPhone
DeviceColor: 2
DeviceName: iPhone 7
DieID: 1425148074418982
EthernetAddress: 98:00:c6:cd:db:31
FirmwareVersion: iBoot-6723.40.106
FusingStatus: 3
HardwareModel: D10AP
HardwarePlatform: t8010
HasSiDP: true
HostAttached: false
InternationalMobileEquipmentIdentity: 355850080567570
MLBSerialNumber: F3X7296031EGXD6G
MobileEquipmentIdentifier: 35585008056757
MobileSubscriberCountryCode:
MobileSubscriberNetworkCode:
ModelNumber: MNCL3
NonVolatileRAM:
auto-boot: dHJ1ZQ==
backlight-level: MTUxNg==
backlight-nits: MHgwMGFjYTk3NQ==
boot-args:
bootdelay: MA==
com.apple.System.tz0-size: MHhDMDAwMDA=
oblit-begins: T2JsaXRUeXBlOiBPYmxpdGVyYXRlRGF0YVBhcnRpdGlvbi4gUmVhc29uOiBCYWNrdXBSZXN0b3Jl
obliteration: aGFuZGxlX21lc3NhZ2U6IE9ibGl0ZXJhdGlvbiBDb21wbGV0ZQo=
ota-controllerVersion: U1VTLTIuMA==
PartitionType: GUID_partition_scheme
PasswordProtected: false
PkHash: if98WU1oTt+jcaZlvUC9AOG/rlbJxZpIN+cg7Rv1bCY=
ProductName: iPhone OS
ProductType: iPhone9,1
ProductVersion: 14.2
ProductionSOC: true
ProtocolVersion: 2
ProximitySensorCalibration: f3oABTIAHgAAgJRBvFYCQgAAyELwp3hBaBHZQQAAFkPwp3hBaBHZQQAAFkMb7zND46gIP3H1h0QKv4dEpLCGRFz/hUQ+OQBCdz4BQlyPCkIe5wxCAAAgQt8P/0JqTSVCAABIQvY4qkNYqalDcUkHRimcQEMTYykfAh8EDtd3mkXp5oBDABanRQIAAAAAAACt
RegionInfo: J/A
ReleaseType: Beta
SIMStatus: kCTSIMSupportSIMStatusNotInserted
SIMTrayStatus: kCTSIMSupportSIMTrayInsertedNoSIM
SerialNumber: DNPV42UGHG83
SoftwareBehavior: GQAAAAAAAAAAAAAAAAAAAA==
SoftwareBundleVersion:
SupportedDeviceFamilies[1]:
0: 1
TelephonyCapability: true
TimeIntervalSince1970: 1603351693.015587
TimeZone: Asia/Shanghai
TimeZoneOffsetFromUTC: 28800.000000
TrustedHostAttached: false
UniqueChipID: 1425148074418982
UniqueDeviceID: 2df9dfdd5c8d4fb91283b0a8e3ed00034dd3b94d
UseRaptorCerts: true
Uses24HourClock: true
WiFiAddress: 98:00:c6:cd:db:2f
WirelessBoardSerialNumber: 77EC8F00E9
kCTPostponementInfoPRLName: 0
kCTPostponementInfoServiceProvisioningState: false
kCTPostponementStatus: kCTPostponementStatusActivated
15:28:13 lockdown.c:262 lockdownd_stop_session(): stopping session 976C1876-649F-4D29-8E41-1126574D91A7
15:28:13 property_list_service.c:132 internal_plist_send(): sending 363 bytes
15:28:13 service.c:144 service_send(): sending 4 bytes
15:28:13 idevice.c:606 idevice_connection_send(): SSL_write 4, sent 4
15:28:13 service.c:144 service_send(): sending 363 bytes
15:28:13 idevice.c:606 idevice_connection_send(): SSL_write 363, sent 363
15:28:13 property_list_service.c:137 internal_plist_send(): sent 363 bytes
15:28:13 idevice.c:732 idevice_connection_receive_timeout(): SSL_read 4, received 4
15:28:13 property_list_service.c:205 internal_plist_receive_timeout(): initial read=4
15:28:13 property_list_service.c:211 internal_plist_receive_timeout(): 238 bytes following
15:28:13 idevice.c:732 idevice_connection_receive_timeout(): SSL_read 238, received 238
15:28:13 property_list_service.c:224 internal_plist_receive_timeout(): received 238 bytes
15:28:13 lockdown.c:278 lockdownd_stop_session(): success
15:28:13 idevice.c:1216 idevice_connection_disable_bypass_ssl(): Skipping bidirectional SSL shutdown. SSL error code: 5

15:28:13 idevice.c:1231 idevice_connection_disable_bypass_ssl(): SSL mode disabled

D:\Download\Build>

I suspect that the problem is that libusbmuxd tries to connect WiFi devices through socket. However, due to the problem of IP address resolution under windows, I changed it to USB mode, but I did not connect USB device (refer to the previous compiler version)
The last compiled version can also be connected to WiFi devices

@nikias

@haen7
Copy link

haen7 commented Oct 22, 2020

after applying @XanaduAPI's patch everything seems to be working fine. I just backed up my iPhone over wifi on windows 10 using idevicebackup2.

@nikias
Copy link
Member

nikias commented Jun 27, 2023

The original issue should be resolved.

@nikias nikias closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

12 participants