Skip to content

Commit 0aafdda

Browse files
authored
Detect new device brands and Detect devices for exist brands (#214)
* feat(sync) Detect new brands: Altibox, G Guard, Supermax, TV+, UnoPhone, WildRed and Detect devices for exist brands (matomo-org#7958) feat(device) detect new brand TV+: Smart TV feat(device) detect brand Panasonic: Smart TV feat(device) detect brand Reeder: Smart TV feat(device) detect brand Saba: 32SB6000H, 42SB6000F feat(device) detect brand Erisson: 32LES905T2SM feat(device) detect new brand Altibox: Smart TV feat(device) detect new brand G Guard: Smart TV feat(device) detect new brand Supermax: Smart TV feat(device) detect brand Philips: NeoViu D1 feat(device) detect brand Dyon: 2K Smart TV feat(device) detect brand Walton: 2K Smart TV feat(device) detect brand Bell: Streamer feat(device) detect brand XGIMI: MoGo Pro feat(device) detect brand Telia: TV Box Nordic feat(device) detect brand Polaroid: SmartBox S (SMX4K) feat(device) detect new brand UnoPhone: Premier 5 Max, Premier 5 feat(device) detect new brand WildRed: 42QWS9001 feat(device) detect brand Xiaomi: Redmi Y3 (M1810F6G), 15 (24129PN74C), Redmi K80 Pro (24117RK2CC), 15 Pro feat(device) detect brand Vivo: iQOO 13 (V2408A), iQOO Z9s Pro 5G (I2305) feat(device) detect brand Realme: GT 7 Pro (RMX5011, RMX5010) feat(device) detect brand Ghia: GK133M3 feat(device) detect brand Sky: Elite T10 Pro feat(device) detect brand Ulefone: Tab A11 Pro feat(device) detect brand Oukitel: OT11 feat(device) detect brand ONYX BOOX: Note Air 4C feat(device) detect brand TOSCIDO: P101 feat(device) detect brand Huawei: Honor Magic 7 (PTP-AN00), Honor Magic 7 Pro (PTP-AN10), Nova 3i (IVY-LX2), Honor X9c (BRP-NX1), Honor X60 (BRC-AN00) feat(device) detect brand Nubia: Z70 Ultra (NX733J) feat(device) detect brand Google: Pixel 8 (GPJ41) feat(device) detect brand VGO TEL: Flex 2 feat(device) detect brand Doogee: V Max Pro feat(device) detect brand Unonu: N55S feat(device) detect brand Meizu: Lucky 08 feat(device) detect brand Sparx: Neo 8 Lite feat(device) detect brand POCO: C75 feat(device) detect brand JVC: Smart TV feat(device) detect brand Rombica: 65MT-UDG54G feat(device) detect brand ONVO: 24OV6000H feat(device) detect brand Akai: TA43BU500, TA32BF550 feat(device) detect brand Erisson: 42FLES901T2SM feat(device) detect brand Motorola: Moto G75 5G, Moto G45 5G, Moto G35 5G feat(device) detect brand Asano: 32LH5000T 32.0" feat(device) detect brand BBK: 40LEX-9201/FTS2C, 40LEX-7291/FTS2C, 40LEX-7246/FTS2C, 32LEX-7292/TS2C, 32LEX-7291/TS2C, 32LEX-7288/TS2C, 32LEX-7264/TS2C, 32LEX-7264/TS2C, 32LEX-7260/TS2C, 32LEX-7259/TS2C, 32LEX-7257/TS2C, 32LEX-7249/TS2C, 32LEX-7246/TS2C, 32LEX-7213/TS2C, 32LEX-7212/TS2C, 32LEX-7204/TS2C, 32LEX-7202/TS2C, 24LEX-7289/TS2C feat(device) detect brand Erisson: 40FLX9000CT2, 40FLES901T2SM, 32LES906T2SM feat(device) detect brand BAFF: 32Y HD-R feat(device) detect brand DEXP: 24HEY1 --- feat(sync) Adds detection for allente, alpsmart, CommScope, Formovie, Grünberg, multibox brands, improves detection for BenQ, Haier, Kodak, ok., Philips, Stilevs, (matomo-org#7961) Adds detection for Grünberg brand Adds detection for alpsmart brand Adds detection for CommScope brand Improves detection for BenQ devices Adds detection for allente brand Adds detection for multibox brand Adds detection for Formovie brand Improves detection for Stilevs brand Rename Ok to ok. Improves detection for ok. devices Improves detection for Haier devices Improves detection for Philips devices --- feat(sync) Detect new brands: hoco, LUO and Detect devices for exist brands (matomo-org#7962) feat(device) detect new brand LUO: V78 (LU-V78) feat(device) detect brand Xiaomi: Redmi Note 14 5G (24094RAD4C), Redmi 14C (2409BRN2CL) feat(device) detect brand Huawei: Honor Magic 7 (PTP-AN60), Honor X60 Pro (BRP-AN00) feat(device) detect brand HTC: Tattoo A3288 feat(device) detect brand Vivo: Y28 (V2433) feat(device) detect brand Realme: P2 Pro 5G (RMX3987) feat(device) detect brand Stylo: Swift 4G feat(device) detect brand W&O: WO Pad Pro, WO10, WO12 feat(device) detect new brand hoco: HI10 feat(device) detect brand Hotwav: Note 12 EF feat(device) detect brand Nothing: Phone 2a Plus (A142P) feat(device) detect brand AGM: H Max feat(device) detect brand HMD: Skyline feat(device) detect brand iTel: P65 (P671LN), Vista Tab 30 (P10003L) feat(device) detect brand Doogee: S200 X, S200 feat(device) detect brand Blackview: Shark 9 feat(device) detect brand TOSCIDO: T181 --- feat(sync) Adds detection for Epson EF-100 (matomo-org#7964) * Adds detection for Epson EF-100 * Improve peripheral detection --- feat(sync) Adds detection for the HeartFocus Education for iOS (matomo-org#7974) --- feat(sync) Improves version detection for iOS and macOS (matomo-org#7968) --- feat(sync) Adds detection for SuperTV brand (matomo-org#7969) --- feat(sync) Adds detection for Blackphone, Geo Phone, IDC, R3Di, RED-X brands, improves detection for various brands, improves detection for feature phones (matomo-org#7966) * Adds detection for Concord M20 * Adds detection for neoCore E1 R1 * Adds detection for Movic F4501 * Improves detection for JVC * Adds detection for Crosscall Core-S4 * Improves detection for feature phones * Adds detection for AT&T Cingular Flex * Adds detection for UnoPhone Premier Pro * Improves detection for Advan * Improves detection for Amazon Echo Show 8 * Improves detection for Amazon Echo Show 5 * Improves detection for Amazon Echo Show 5 * Improves detection for Mione devices * Improves detection for ViewSonic ViewPhone Q5 * Improves detection for Nokia devices * Improves detection for feature phones * Adds detection for Alcatel 3088 * Improves detection for Alcatel devices * Adds detection for Alcatel MyFlip 2 * Adds detection for Mango Akabuto 4G * Improves detection for AT&T devices * Improves detection for Alcatel devices * Improves detection for Cricket devices * Adds detection for Alcatel MyFlip * Adds detection for Doppio Texter * Adds detection for Blackphone brand * Adds detection for Geo Phone brand * Improves detection for Accent devices * Adds detection for Blu Flex * Improves detection for Blu devices * Improves detection for Jio devices * Improves detection for Multilaser devices * Improves detection for MTN devices * Adds detection for Orange Sanza * Adds detection for MTN Smart Kamunye * Adds detection for RED-X brand * Adds detection for Sigma X-Style * Adds detection for R3Di brand * Adds detection for Symphony PD1 4G * Add test for Bmobile W125K * Improves detection for Digit4G devices * Improves detection for Orange Sanza * Improves detection for Energizer devices * Adds detection for IDC brand * Adds detection for free Wi-Kif 4G * Improves detection for Telma devices * Improves detection for YouTube on KaiOS * Adds detection for K-Lite K301 * Improves detection for Orange devices --- feat(sync) Adds detection for AltiBrowser, Maple (browser and engine) and improves detection for Tizen (matomo-org#7975) * Adds detection for Maple browser and engine * Improves detection for Tizen * Adds detection for AltiBrowser * feat(sync): add KaiOS rule for feature phone type --- * chore: update readme * chore: set package next version 2.1.7 * feat: Added support for obtaining device code from KAIOS user-agent * chore: generate indexes * fix: All devices containing TV fragment are assumed to be a tv
1 parent 6c77617 commit 0aafdda

38 files changed

+8572
-3925
lines changed

README.md

Lines changed: 361 additions & 355 deletions
Large diffs are not rendered by default.

index.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,19 @@ class DeviceDetector {
576576

577577
/**
578578
* All unknown devices under running Java ME
579-
* are more likely a features phones
579+
* are more likely features phones
580580
*/
581581
if (deviceType === '' && osName === 'Java ME') {
582582
deviceType = DEVICE_TYPE.FEATURE_PHONE;
583583
}
584584

585+
/**
586+
* All devices running KaiOS are more likely features phones
587+
*/
588+
if ('KaiOS' === osName) {
589+
deviceType = DEVICE_TYPE.FEATURE_PHONE;
590+
}
591+
585592
/**
586593
* According to http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx
587594
* Internet Explorer 10 introduces the "Touch" UA string token. If this token is present at the end of the
@@ -626,9 +633,13 @@ class DeviceDetector {
626633
deviceType = DEVICE_TYPE.TV;
627634
}
628635
/**
629-
* All devices that contain "Andr0id" in string are assumed to be a tv
636+
* All devices that contain Andr0id in string are assumed to be a tv
630637
*/
631-
if (helper.hasAndroidTVFragment(userAgent)) {
638+
const hasDeviceTvType = [
639+
DEVICE_TYPE.TV,
640+
DEVICE_TYPE.PERIPHERAL
641+
].indexOf(deviceType) === -1 && helper.hasAndroidTVFragment(userAgent)
642+
if (hasDeviceTvType) {
632643
deviceType = DEVICE_TYPE.TV;
633644
}
634645
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-device-detector",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"description": "Nodejs device detector (port matomo-org/device-detector)",
55
"main": "index.js",
66
"scripts": {

parser/client/browser-short.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = {
4343
'AL': 'Aloha Browser',
4444
'AH': 'Aloha Browser Lite',
4545
'A8': 'ALVA',
46+
'9A': 'AltiBrowser',
4647
'AM': 'Amaya',
4748
'A3': 'Amaze Browser',
4849
'A5': 'Amerigo',
@@ -345,6 +346,7 @@ module.exports = {
345346
'LX': 'Lynx',
346347
'L2': 'Lynket Browser',
347348
'MD': 'Mandarin',
349+
'MP': 'Maple',
348350
'M5': 'MarsLab Web Browser',
349351
'M7': 'MaxBrowser',
350352
'M1': 'mCent',

parser/device/brand-short.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ module.exports = {
6161
'ALS': 'All Star',
6262
'AA': 'AllCall',
6363
'3A': 'AllDocube',
64+
'ALL': 'allente',
6465
'A2': 'Allview',
6566
'ALI': 'ALLINmobile',
6667
'A7': 'Allwinner',
68+
'ALP': 'alpsmart',
6769
'A1': 'Altech UEC',
6870
'66': 'Altice',
6971
'ALM': 'Altimo',
7072
'A5': 'altron',
73+
'ALB': 'Altibox',
7174
'ALT': 'Altus',
7275
'KN': 'Amazon',
7376
'AMZ': 'Amazon Basics',
@@ -195,6 +198,7 @@ module.exports = {
195198
'BLK': 'Black Box',
196199
'BF': 'Black Fox',
197200
'BPC': 'Blackpcs',
201+
'BLP': 'Blackphone',
198202
'BLT': 'Blackton',
199203
'B2': 'Blackview',
200204
'2Y': 'b2m',
@@ -241,6 +245,7 @@ module.exports = {
241245
'C9': 'CAGI',
242246
'CAD': 'CADENA',
243247
'CT': 'Capitel',
248+
'GRD': 'G-Guard',
244249
'G3': 'CG Mobile',
245250
'37': 'CGV',
246251
'CP': 'Captiva',
@@ -292,6 +297,7 @@ module.exports = {
292297
'CY': 'Coby Kyros',
293298
'XC': 'Cobalt',
294299
'C6': 'Comio',
300+
'COM': 'CommScope',
295301
'CL': 'Compal',
296302
'CQ': 'Compaq',
297303
'C7': 'ComTrade Tesla',
@@ -561,6 +567,7 @@ module.exports = {
561567
'44': 'Four Mobile',
562568
'F0': 'Fonos',
563569
'F2': 'FORME',
570+
'FRM': 'Formovie',
564571
'F5': 'Formuler',
565572
'FR': 'Forstar',
566573
'RF': 'Fortis',
@@ -603,6 +610,7 @@ module.exports = {
603610
'GD': 'Gemini',
604611
'GN': 'General Mobile',
605612
'2G': 'Genesis',
613+
'GEP': 'Geo Phone',
606614
'G2': 'GEOFOX',
607615
'GE': 'Geotel',
608616
'Q4': 'Geotex',
@@ -654,6 +662,7 @@ module.exports = {
654662
'GR1': 'GroBerwert',
655663
'GF': 'Gretel',
656664
'82': 'Gresso',
665+
'GRB': 'Grünberg',
657666
'GU': 'Grundig',
658667
'GV': 'Gtel',
659668
'CUO': 'Guophone',
@@ -707,6 +716,7 @@ module.exports = {
707716
'HMD': 'HMD',
708717
'8W': 'HKPro',
709718
'HOF': 'HOFER',
719+
'HOC': 'hoco',
710720
'H1': 'Hoffmann',
711721
'HOM': 'Homatics',
712722
'H0': 'Hometech',
@@ -760,6 +770,7 @@ module.exports = {
760770
'IC': 'iDroid',
761771
'IDI': 'iDino',
762772
'6Z': 'iData',
773+
'IDC': 'IDC',
763774
'IG': 'iGet',
764775
'IHL': 'iHome Life',
765776
'IH': 'iHunt',
@@ -982,6 +993,7 @@ module.exports = {
982993
'LU': 'Lumus',
983994
'LUM': 'Lumitel',
984995
'L9': 'Luna',
996+
'LUO': 'LUO',
985997
'LR': 'Luxor',
986998
'LY': 'LYF',
987999
'LL': 'Leader Phone',
@@ -1104,6 +1116,7 @@ module.exports = {
11041116
'72': 'M-Tech',
11051117
'9H': 'M-Horse',
11061118
'MKP': 'M-KOPA',
1119+
'MLB': 'multibox',
11071120
'1R': 'Multilaser',
11081121
'MPS': 'MultiPOS',
11091122
'1M': 'MYFON',
@@ -1214,7 +1227,7 @@ module.exports = {
12141227
'OQ': 'Meta',
12151228
'O1': 'Odys',
12161229
'ODP': 'Odotpad',
1217-
'O9': 'Ok',
1230+
'O9': 'ok.',
12181231
'OKA': 'Okapi',
12191232
'OA': 'Okapia',
12201233
'OKI': 'Oking',
@@ -1380,6 +1393,7 @@ module.exports = {
13801393
'WJ': 'Qware',
13811394
'QWT': 'QWATT',
13821395
'R2': 'R-TV',
1396+
'R3D': 'R3Di',
13831397
'RA': 'Ramos',
13841398
'0R': 'Raspberry',
13851399
'R9': 'Ravoz',
@@ -1396,6 +1410,7 @@ module.exports = {
13961410
'RE': 'Realme',
13971411
'RE1': 'Redbean',
13981412
'R8': 'RED',
1413+
'RDX': 'RED-X',
13991414
'REW': 'Redway',
14001415
'6F': 'Redfox',
14011416
'RE2': 'RedLine',
@@ -1590,10 +1605,12 @@ module.exports = {
15901605
'5Y': 'Sunny',
15911606
'W8': 'SUNWIND',
15921607
'SBX': 'SuperBOX',
1608+
'SBM': 'Supermax',
15931609
'SBR': 'Sber',
15941610
'SGE': 'Super General',
15951611
'SU': 'SuperSonic',
15961612
'79': 'SuperTab',
1613+
'STV': 'SuperTV',
15971614
'S5': 'Supra',
15981615
'SUP': 'Supraim',
15991616
'ZS': 'Suzuki',
@@ -1723,6 +1740,7 @@ module.exports = {
17231740
'TUC': 'TUCSON',
17241741
'2U': 'Türk Telekom',
17251742
'TV': 'TVC',
1743+
'TVP': 'TV+',
17261744
'TW': 'TWM',
17271745
'Z1': 'TWZ',
17281746
'6T': 'Twoe',
@@ -1751,6 +1769,7 @@ module.exports = {
17511769
'UGR': 'United Group',
17521770
'UO': 'Unnecto',
17531771
'UNN': 'Unnion Technologies',
1772+
'UNP': 'UnoPhone',
17541773
'UU': 'Unonu',
17551774
'UN': 'Unowhy',
17561775
'UY': 'UNNO',
@@ -1885,6 +1904,7 @@ module.exports = {
18851904
'W2': 'Wigor',
18861905
'WI': 'Wiko',
18871906
'WF': 'Wileyfox',
1907+
'WLR': 'WildRed',
18881908
'WS': 'Winds',
18891909
'WN': 'Wink',
18901910
'9W': 'Winmax',

parser/helper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,18 @@ function hasPuffinTabletFragment(userAgent) {
238238
*/
239239
function hasAndroidTVFragment(userAgent) {
240240
return matchUserAgent(
241-
'Andr0id|(?:Android(?: UHD)?|Google) TV|[(]lite[)] TV|BRAVIA|[(]TV;| TV$',
241+
'Andr0id|(?:Android(?: UHD)?|(?<!Xming )Google) TV|\\(lite\\) TV|BRAVIA| TV$',
242242
userAgent
243243
) !== null;
244244
}
245245

246246
/**
247247
* All devices running Tizen TV or SmartTV are assumed to be a tv
248248
* @param {string} userAgent
249-
* @returns {boolean}
249+
* @return {boolean}
250250
*/
251251
function hasTVFragment(userAgent) {
252-
return matchUserAgent('SmartTV|Tizen.+ TV .+$', userAgent) !== null;
252+
return matchUserAgent('SmartTV|Tizen.+ TV .+$|\\(TV;', userAgent) !== null;
253253
}
254254

255255
/**

0 commit comments

Comments
 (0)