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

Fork Sync #1

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7f24e9a
Fix preflight for older devices
mexmer Sep 21, 2022
12e24e4
preflight: Assume old iOS version if retrieval of ProductVersion fails
nikias Oct 4, 2022
bccae83
autoconf: Automatically derive version number from latest git tag
nikias Oct 7, 2022
6d0183d
Support switching to different "modes" using vendor specific control …
Dec 22, 2022
9bc87cd
style
Dec 22, 2022
939595a
Factor out device_complete_initialization and call it from get_mode_cb.
Dec 22, 2022
0fdad22
- Add device to collection in usb_device_add
Dec 23, 2022
1eb5a01
Best effort for old devices (potentially not supporting mode switch) …
Dec 23, 2022
a2cbb59
Simplify finding valid configuration, interface and endpoints and ref…
Dec 23, 2022
24a0265
correct log
Dec 23, 2022
84801d8
Guess current mode based on available configurations and interfaces.
Dec 24, 2022
e55e6e7
udev: Fix freezing on OpenRC caused by a raced execution of usbmuxd
BalkanMadman Feb 22, 2023
dca3373
Fix use-after-free on get_mode_cb
Mar 1, 2023
d0cda19
Set default value for ENV_DEV_MODE
Mar 1, 2023
049877e
Update to use latest libplist code
nikias Apr 21, 2023
01c94c7
conf: Fix false plist read/write errors caused by using new libplist API
nikias May 5, 2023
61b99ab
udev: Make sure iBridge (T1) doesn't end up in an unconfigured state
nikias Jul 20, 2023
56f013b
autoconf: Fix processing of --with-preflight and --with-systemd options
nikias Sep 18, 2023
2707534
systemd: use runstatedir
williamspatrick Oct 6, 2022
b9d5e3c
autoconf: Add workaround for runstatedir for old autoconf versions
nikias Sep 18, 2023
91aa7be
[github-actions] Update build config to use checkout@v3 and upload-ar…
nikias Sep 18, 2023
c7a0dd9
usb: Set default mode to 3 to include CDC NCM, and fix a log message
nikias Sep 19, 2023
b5dfb25
usb: Make sure buffer for vendor specific request is 0-initialized
nikias Sep 29, 2023
360619c
client: Add missing include for FreeBSD
nikias Oct 11, 2023
243dedf
device: Fix crash caused by wrong variable when logging an error
gothi3 Jun 13, 2024
bc0b91c
usb: Rename usb_device struct member 'dev' to more appropriate 'handle'
nikias Jun 13, 2024
f8be60c
usb: Revert default mode back to 1
httpstorm Apr 22, 2024
a2cafe2
configure.ac: Do not use '+=' to set CFLAGS to be POSIX-compliant
BalkanMadman May 4, 2024
81a4165
configure.ac: Don't explicitly add -g to compiler flags
nikias Sep 14, 2024
a2dceac
usb: correctly display 10 Gbps USB 3.x
Forst Jul 31, 2024
df80b73
usb: add support for modes 4 and 5
Forst Jul 31, 2024
10d9eae
conf: fix false plist write error in config_set_device_record
nikias Sep 14, 2024
e9a0dce
Use more reliabe macros to print --version output
nikias Sep 14, 2024
0b1b233
Update libplist requirement to 2.6.0 and use PLIST_DICT helper for cl…
nikias Sep 15, 2024
7c0c0eb
[github-actions] Updated build workflow
nikias Dec 2, 2024
0cdf92d
Updated README
nikias Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/preflight.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void* preflight_worker_handle_device_add(void* userdata)

plist_t value = NULL;
char* version_str = NULL;
char* platform_str = NULL;
char* deviceclass_str = NULL;

usbmuxd_log(LL_INFO, "%s: Starting preflight on device %s...", __func__, _dev->udid);

Expand Down Expand Up @@ -228,28 +228,28 @@ static void* preflight_worker_handle_device_add(void* userdata)
goto leave;
}

lerr = lockdownd_get_value(lockdown, NULL, "ProductName", &value);
lerr = lockdownd_get_value(lockdown, NULL, "DeviceClass", &value);
if (lerr != LOCKDOWN_E_SUCCESS) {
usbmuxd_log(LL_ERROR, "%s: ERROR: Could not get ProductName from device %s, lockdown error %d", __func__, _dev->udid, lerr);
usbmuxd_log(LL_ERROR, "%s: ERROR: Could not get DeviceClass from device %s, lockdown error %d", __func__, _dev->udid, lerr);
goto leave;
}
if (value && plist_get_node_type(value) == PLIST_STRING) {
plist_get_string_val(value, &platform_str);
plist_get_string_val(value, &deviceclass_str);
}
plist_free(value);

if (!platform_str) {
usbmuxd_log(LL_ERROR, "%s: Could not get ProductName string from device %s handle %d", __func__, _dev->udid, (int)(long)_dev->conn_data);
if (!deviceclass_str) {
usbmuxd_log(LL_ERROR, "%s: Could not get DeviceClass string from device %s handle %d", __func__, _dev->udid, (int)(long)_dev->conn_data);
goto leave;
}

int version_major = strtol(version_str, NULL, 10);
if ((!strcmp(platform_str, "iPhone OS") && version_major >= 7)
|| ((!strcmp(platform_str, "watchOS") || !strcmp(platform_str, "Watch OS")) && version_major >= 2)
|| (!strcmp(platform_str, "Apple TVOS") && version_major >= 9)
if (((!strcmp(deviceclass_str, "iPhone") || !strcmp(deviceclass_str, "iPad")) && version_major >= 7)
|| (!strcmp(deviceclass_str, "Watch") && version_major >= 2)
|| (!strcmp(deviceclass_str, "AppleTV") && version_major >= 9)
) {
/* iOS 7.0 / watchOS 2.0 / tvOS 9.0 and later */
usbmuxd_log(LL_INFO, "%s: Found %s %s device %s", __func__, platform_str, version_str, _dev->udid);
usbmuxd_log(LL_INFO, "%s: Found %s %s device %s", __func__, deviceclass_str, version_str, _dev->udid);

lockdownd_set_untrusted_host_buid(lockdown);

Expand Down Expand Up @@ -356,7 +356,7 @@ static void* preflight_worker_handle_device_add(void* userdata)
}

leave:
free(platform_str);
free(deviceclass_str);
free(version_str);
if (lockdown)
lockdownd_client_free(lockdown);
Expand Down