1
0
Fork 0

[OS Detection] Improve MacOS detection (#24708)

This commit is contained in:
Drashna Jael're 2025-01-29 11:25:21 -08:00 committed by GitHub
parent ea3a968510
commit 8bf01dd796
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 55 additions and 8 deletions

View file

@ -133,7 +133,7 @@ void process_wlength(const uint16_t w_length) {
} else if (setups_data.count == setups_data.cnt_ff) {
// Linux has 3 packets with 0xFF.
guessed = OS_LINUX;
} else if (setups_data.count == 5 && setups_data.last_wlength == 0xFF && setups_data.cnt_ff == 1 && setups_data.cnt_02 == 2) {
} else if (setups_data.count >= 5 && setups_data.last_wlength == 0xFF && setups_data.cnt_ff >= 1 && setups_data.cnt_02 >= 2) {
guessed = OS_MACOS;
} else if (setups_data.count == 4 && setups_data.cnt_ff == 0 && setups_data.cnt_02 == 2) {
// iOS and iPadOS don't have the last 0xFF packet.