|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +// Copyright (c) 2025–2026 Vadim Belov <https://belov.us> |
| 3 | + |
| 4 | +using System; |
| 5 | +using System.Collections.Generic; |
| 6 | + |
| 7 | +namespace EasyExtensions.Helpers |
| 8 | +{ |
| 9 | + internal static class KnownDeviceCodes |
| 10 | + { |
| 11 | + internal static readonly Dictionary<string, UserAgentDeviceInfo> Map = new Dictionary<string, UserAgentDeviceInfo>(StringComparer.OrdinalIgnoreCase) |
| 12 | + { |
| 13 | + // ========================= |
| 14 | + // Samsung phones (flagships) |
| 15 | + // ========================= |
| 16 | + ["SM-G981B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-G981B", "Samsung Galaxy S20"), |
| 17 | + ["SM-G991B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-G991B", "Samsung Galaxy S21"), |
| 18 | + ["SM-G996B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-G996B", "Samsung Galaxy S21+"), |
| 19 | + ["SM-G998B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-G998B", "Samsung Galaxy S21 Ultra"), |
| 20 | + |
| 21 | + ["SM-S901B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S901B", "Samsung Galaxy S22"), |
| 22 | + ["SM-S906B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S906B", "Samsung Galaxy S22+"), |
| 23 | + ["SM-S908B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S908B", "Samsung Galaxy S22 Ultra"), |
| 24 | + |
| 25 | + ["SM-S911B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S911B", "Samsung Galaxy S23"), |
| 26 | + ["SM-S916B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S916B", "Samsung Galaxy S23+"), |
| 27 | + ["SM-S918B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S918B", "Samsung Galaxy S23 Ultra"), |
| 28 | + |
| 29 | + ["SM-S921B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S921B", "Samsung Galaxy S24"), |
| 30 | + ["SM-S926B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S926B", "Samsung Galaxy S24+"), |
| 31 | + ["SM-S928B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S928B", "Samsung Galaxy S24 Ultra"), |
| 32 | + ["SM-S928U1"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S928U1", "Samsung Galaxy S24 Ultra (US Unlocked)"), |
| 33 | + |
| 34 | + // S25 family (????? ??????????? ? ?????/?????????; ???????????? ???????? ???? ??????) |
| 35 | + ["SM-S931B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S931B", "Samsung Galaxy S25"), |
| 36 | + ["SM-S936B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S936B", "Samsung Galaxy S25+"), |
| 37 | + ["SM-S938B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-S938B", "Samsung Galaxy S25 Ultra"), |
| 38 | + |
| 39 | + // ========================= |
| 40 | + // Samsung foldables |
| 41 | + // ========================= |
| 42 | + ["SM-F936B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-F936B", "Samsung Galaxy Z Fold4"), |
| 43 | + ["SM-F731B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-F731B", "Samsung Galaxy Z Flip5"), |
| 44 | + ["SM-F946B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungPhone, "SM-F946B", "Samsung Galaxy Z Fold5"), |
| 45 | + |
| 46 | + // ========================= |
| 47 | + // Samsung tablets (Tab S-series) |
| 48 | + // ========================= |
| 49 | + ["SM-X710"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungTablet, "SM-X710", "Samsung Galaxy Tab S9 (Wi-Fi)"), |
| 50 | + ["SM-X716B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungTablet, "SM-X716B", "Samsung Galaxy Tab S9 (5G)"), |
| 51 | + |
| 52 | + ["SM-X910"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungTablet, "SM-X910", "Samsung Galaxy Tab S9 Ultra (Wi-Fi)"), |
| 53 | + ["SM-X916B"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungTablet, "SM-X916B", "Samsung Galaxy Tab S9 Ultra (5G)"), |
| 54 | + |
| 55 | + ["SM-X920"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungTablet, "SM-X920", "Samsung Galaxy Tab S10 Ultra"), |
| 56 | + |
| 57 | + // ========================= |
| 58 | + // Samsung watches |
| 59 | + // ========================= |
| 60 | + ["SM-R930"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungWatch, "SM-R930", "Samsung Galaxy Watch6 40mm"), |
| 61 | + ["SM-R940"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungWatch, "SM-R940", "Samsung Galaxy Watch6 44mm"), |
| 62 | + ["SM-R960"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungWatch, "SM-R960", "Samsung Galaxy Watch6 Classic 47mm"), |
| 63 | + |
| 64 | + ["SM-L310"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungWatch, "SM-L310", "Samsung Galaxy Watch7 (Bluetooth)"), |
| 65 | + ["SM-L315"] = new UserAgentDeviceInfo(UserAgentDeviceType.SamsungWatch, "SM-L315", "Samsung Galaxy Watch7 (LTE)"), |
| 66 | + |
| 67 | + // ============================================================ |
| 68 | + // Google Pixel (????? ??????????? ??? device/sku codes ? UA/app) |
| 69 | + // ============================================================ |
| 70 | + ["G9BQD"] = new UserAgentDeviceInfo(UserAgentDeviceType.GooglePhone, "G9BQD", "Google Pixel 8"), |
| 71 | + ["GKWS6"] = new UserAgentDeviceInfo(UserAgentDeviceType.GooglePhone, "GKWS6", "Google Pixel 8 (variant)"), |
| 72 | + |
| 73 | + // ========================= |
| 74 | + // OnePlus (????? CPH****) |
| 75 | + // ========================= |
| 76 | + ["CPH2581"] = new UserAgentDeviceInfo(UserAgentDeviceType.OnePlusPhone, "CPH2581", "OnePlus 12 (Global)"), |
| 77 | + ["CPH2609"] = new UserAgentDeviceInfo(UserAgentDeviceType.OnePlusPhone, "CPH2609", "OnePlus 12R (Global)"), |
| 78 | + |
| 79 | + // ========================= |
| 80 | + // Xiaomi / Redmi / POCO (????? "M****" ??? "231***") |
| 81 | + // ========================= |
| 82 | + ["23127PN0CG"] = new UserAgentDeviceInfo(UserAgentDeviceType.XiaomiPhone, "23127PN0CG", "Xiaomi 14 (Global)"), |
| 83 | + ["23090RA98G"] = new UserAgentDeviceInfo(UserAgentDeviceType.XiaomiPhone, "23090RA98G", "POCO X6 Pro (Global)"), |
| 84 | + |
| 85 | + // ============================================================ |
| 86 | + // Apple iPhone / iPad / Watch (?????? machine identifiers) |
| 87 | + // ?????: ? Safari UA ????? ?????? ???. ??? ??????? ??? SDK/?????. |
| 88 | + // ============================================================ |
| 89 | + ["iPhone15,2"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone15,2", "iPhone 14 Pro"), |
| 90 | + ["iPhone15,3"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone15,3", "iPhone 14 Pro Max"), |
| 91 | + ["iPhone16,1"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone16,1", "iPhone 15 Pro"), |
| 92 | + ["iPhone16,2"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone16,2", "iPhone 15 Pro Max"), |
| 93 | + ["iPhone17,1"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone17,1", "iPhone 16 Pro"), |
| 94 | + ["iPhone17,2"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone17,2", "iPhone 16 Pro Max"), |
| 95 | + ["iPhone17,3"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone17,3", "iPhone 16"), |
| 96 | + ["iPhone17,4"] = new UserAgentDeviceInfo(UserAgentDeviceType.ApplePhone, "iPhone17,4", "iPhone 16 Plus"), |
| 97 | + }; |
| 98 | + } |
| 99 | +} |
0 commit comments