Skip to content

Commit 0ac61e7

Browse files
authored
Detect new brands: Biegedy, Blackton, Temigereev, and Detect devices for exist brands (#210)
feat(sync) Detect new brands Blackton, Temigereev and Detect devices for exist brands (matomo-org#7917) feat(device) detect new brand Temigereev: TG 30, TG 15 feat(device) detect brand Samsung: Galaxy M55 5G (SM-M556B), Galaxy Tab S10 Ultra 14.6" 5G (SM-X926B) feat(device) detect brand Motorola: Moto G8 Play (XT2015-2), Moto S50 (XT2409-5) feat(device) detect brand Meizu: 20 Infinity feat(device) detect brand Ace: Buzz 5 Lite feat(device) detect brand W&O: WO7 feat(device) detect brand Tanix: TX3 Mini feat(device) detect brand Lingbo: L24 Ultra, G15 Pro Max, G24 Mini, G15 Mini, Venus Pad 16, Venus Pad 15 feat(device) detect new brand Blackton: Bt 32FS32B feat(device) detect brand KENSHI: Armor I1 Slim feat(device) detect brand HongTop: Smart TV feat(device) detect brand Tecno Mobile: Spark 30 (TECNO KL6), Phantom V2 Flip (TECNO AE11) feat(device) detect brand Huawei: Honor X7c (ALT-LX1), Honor Pad X8a WiFi (NDL-W09) feat(device) detect brand Realme: 13 5G (RMX3951) feat(device) detect brand Blackview: Tab 16 Pro feat(device) detect brand Lenovo: Xiaoxin Pad Pro 12.7" (TB375FC) feat(device) detect brand Vivo: X200 Pro (V2405A), V40 Lite (V2424, V2417) feat(device) detect brand Lingbo: L16 Max feat(device) detect brand Oukitel: WP52 feat(device) detect brand Motorola: Moto Razr 50 (XT2453-2), Moto G85 5G --- feat(sync) Detect new brand: Biegedy And Detect devices for exist brands (matomo-org#7923) feat(device) detect brand Samsung: Galaxy Z Fold 5 (SC-55D), Galaxy S23 (SC-51D), Galaxy S24 (SC-51E) feat(device) detect brand POCO: C75 (2410FPCC5G) feat(device) detect brand Xiaomi: Mix Flip (2405CPX3DG) feat(device) detect brand Sony: Xperia 1 V (SO-51D) feat(device) detect brand Oukitel: RT8 feat(device) detect brand Ugoos: TOX4, TOX3 Plus feat(device) detect brand Realme: Narzo 70 Turbo 5G (RMX5003) feat(device) detect brand DISH: Celero 5G SC (SN339D) feat(device) detect brand Tecno Mobile: Spark Go (2024) (TECNO BG6s), Spark 30 Pro (TECNO KL7), Spark 20 Pro 5G (TECNO KJ8), Phantom V Fold 2 (TECNO AE10) feat(device) detect new brand Biegedy: B22 feat(device) detect brand Blackview: Wave 8 feat(device) detect brand Sony: Xperia 1 VI (XQ-EC44) feat(device) detect brand OPPO: A60 5G (CPH2683) feat(device) detect brand Chuwi: Hi10 XPro Pad feat(device) detect brand Motorola: Moto G Play (2023) (XT2271-5), Moto E14 --- feat(sync) Improves version detection for Azure Linux, macOS and Windows (matomo-org#7922) * Adds detection for Cygwin * Adds detection for Azure Blob Storage * Improves version detection for Windows * Improves version detection for macOS * Improves platform detection * Improves detection for Azure Linux --- chore: generate indexes chore: set version 2.1.6 chore: update readme
1 parent 4aeba7f commit 0ac61e7

25 files changed

+1892
-426
lines changed

README.md

Lines changed: 299 additions & 298 deletions
Large diffs are not rendered by default.

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ export default class DeviceDetector {
3434
setOsVersionTruncate(value: any): void;
3535
setClientVersionTruncate(value: any): void;
3636

37-
set deviceTrusted(arg: boolean);
37+
set deviceTrusted(stage: boolean);
3838
get deviceTrusted(): boolean;
3939

40-
set deviceInfo(arg: boolean);
40+
set deviceInfo(stage: boolean);
4141
get deviceInfo(): boolean;
4242

4343
/**
44-
* @param {boolean} arg - true use indexes, false not use indexes
44+
* @param {boolean} stage - true use indexes, false not use indexes
4545
*/
46-
set deviceIndexes(arg: boolean);
46+
set deviceIndexes(stage: boolean);
4747

4848
/**
4949
* @return {boolean} - true use indexes, false not use indexes

index.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class DeviceDetector {
7878
/**
7979
* @param {DeviceDetectorOptions} options
8080
**/
81-
constructor(options) {
81+
constructor(options = {}) {
8282
this.init();
8383

8484
this.skipBotDetection = attr(options, 'skipBotDetection', false);
@@ -116,8 +116,8 @@ class DeviceDetector {
116116
this.addParseBot(BOT_PARSER, new BotParser());
117117
}
118118

119-
set deviceTrusted(check) {
120-
this.#deviceTrusted = check;
119+
set deviceTrusted(stage) {
120+
this.#deviceTrusted = stage;
121121
}
122122

123123
get deviceTrusted() {
@@ -166,10 +166,10 @@ class DeviceDetector {
166166
}
167167

168168
/**
169-
* @param {boolean} status - true use indexes, false not use indexes
169+
* @param {boolean} stage - true use indexes, false not use indexes
170170
*/
171-
set deviceIndexes(status) {
172-
this.#deviceIndexes = status;
171+
set deviceIndexes(stage) {
172+
this.#deviceIndexes = stage;
173173
}
174174

175175
/**
@@ -626,7 +626,7 @@ class DeviceDetector {
626626
deviceType = DEVICE_TYPE.TV;
627627
}
628628
/**
629-
* All devices that contain Andr0id in string are assumed to be a tv
629+
* All devices that contain "Andr0id" in string are assumed to be a tv
630630
*/
631631
if (helper.hasAndroidTVFragment(userAgent)) {
632632
deviceType = DEVICE_TYPE.TV;
@@ -695,6 +695,16 @@ class DeviceDetector {
695695
return aliasDevice.parse(userAgent);
696696
}
697697

698+
/**
699+
* restore original userAgent from clientHints object
700+
* @param {string} userAgent
701+
* @param {ResultClientHints} clientHints
702+
* @return {string}
703+
*/
704+
restoreUserAgentFromClientHints(userAgent, clientHints) {
705+
return helper.restoreUserAgentFromClientHints(userAgent, clientHints)
706+
}
707+
698708
/**
699709
* parse device
700710
* @param {string} userAgent
@@ -714,7 +724,7 @@ class DeviceDetector {
714724
trusted: null
715725
};
716726

717-
let ua = helper.restoreUserAgentFromClientHints(userAgent, clientHints);
727+
const ua = this.restoreUserAgentFromClientHints(userAgent, clientHints);
718728
// skip all parse is client-hints useragent and model not exist
719729
if (!helper.hasDeviceModelByClientHints(clientHints) && helper.hasUserAgentClientHintsFragment(userAgent)) {
720730
return Object.assign({}, result);

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.5",
3+
"version": "2.1.6",
44
"description": "Nodejs device detector (port matomo-org/device-detector)",
55
"main": "index.js",
66
"scripts": {

parser/client/browser-families.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ module.exports = {
4141
],
4242
'Firefox': [
4343
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
44-
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'GZ', 'I4', 'IF',
44+
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'I4', 'IF', '8P',
4545
'IW', 'LH', 'LY', 'MB', 'MN', 'MO', 'MY', 'OA', 'OS',
4646
'PI', 'PX', 'QA', 'S5', 'SX', 'TF', 'TO', 'WF', 'ZV',
4747
'FP', 'AD', '2I', 'P9', 'KJ', 'WY', 'VK', 'W5',
48-
'7C', 'N7', 'W7', '8P',
48+
'7C', 'N7', 'W7',
4949
],
5050
'Internet Explorer': ['IE', 'CZ', 'BZ', 'IM', 'PS', '3A', '4A', 'RN'],
5151
'Konqueror': ['KO'],

parser/device/brand-short.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ module.exports = {
186186
'BT': 'Bitel',
187187
'B7': 'Bitmore',
188188
'ZB': 'Bittium',
189+
'BIE': 'Biegedy',
189190
'BK': 'Bkav',
190191
'5B': 'Black Bear',
191192
'BLK': 'Black Box',
192193
'BF': 'Black Fox',
193194
'BPC': 'Blackpcs',
195+
'BLT': 'Blackton',
194196
'B2': 'Blackview',
195197
'2Y': 'b2m',
196198
'BP': 'Blaupunkt',
@@ -1611,6 +1613,7 @@ module.exports = {
16111613
'TX': 'TechniSat',
16121614
'TT': 'TechnoTrend',
16131615
'TTS': 'TECHNOSAT',
1616+
'TM1': 'Temigereev',
16141617
'TP': 'TechPad',
16151618
'TPS': 'TPS',
16161619
'9E': 'Techwood',

parser/os-abstract-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class OsAbstractParser extends ParserAbstract {
346346
if (this.getBaseRegExp('sparc64').test(userAgent)) {
347347
return 'SPARC64';
348348
}
349-
if (this.getBaseRegExp('64-?bit|WOW64|(?:Intel)?x64|WINDOWS_64|win64|.*amd64|x86_?64').test(userAgent)) {
349+
if (this.getBaseRegExp('64-?bit|WOW64|(?:Intel)?x64|WINDOWS_64|win64|.*amd64|.*x86_?64').test(userAgent)) {
350350
return 'x64';
351351
}
352352
if (this.getBaseRegExp('.+32bit|.+win32|(?:i[0-9]|x)86|i86pc').test(userAgent)) {

regexes/client-index-hash.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
'28292465':
147147
- - 419
148148
- []
149+
'28387235':
150+
- - 397
151+
- []
149152
'29511629':
150153
- - 551
151154
- []
@@ -4304,6 +4307,9 @@ d19f499:
43044307
47d4fd11:
43054308
- []
43064309
- - 327
4310+
1615ccb:
4311+
- []
4312+
- - 577
43074313
6e09c04d:
43084314
- - 397
43094315
- []

regexes/client/browser_engine.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
- regex: 'Servo'
4242
name: 'Servo'
4343

44-
- regex: 'Goanna'
45-
name: 'Goanna'
46-
4744
- regex: 'Ekioh(?:Flow)?'
4845
name: 'EkiohFlow'
4946

regexes/client/libraries.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@
201201
name: 'OkHttp'
202202
version: '$1'
203203

204-
- regex: 'HTTP_Request2(?:/(\d+[.\d]+))?'
205-
name: 'HTTP_Request2'
206-
version: '$1'
207-
208204
- regex: 'HTTP_Request2(?:/(\d+[.\d]+))?'
209205
name: 'HTTP_Request2'
210206
version: '$1'
@@ -643,3 +639,13 @@
643639
name: 'ICAP Client'
644640
version: '$1'
645641
url: 'https://github.com/Peoplecantfly/icapserver'
642+
643+
- regex: 'Cygwin-Setup(?:/(\d+[.\d]+))?'
644+
name: 'Cygwin'
645+
version: '$1'
646+
url: 'https://www.cygwin.com/'
647+
648+
- regex: 'azsdk-python-storage-blob(?:/(\d+[.\d]+))?'
649+
name: 'Azure Blob Storage'
650+
version: '$1'
651+
url: 'https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python'

regexes/client/mediaplayers.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@
113113
name: 'mpv'
114114
version: '$1'
115115

116-
- regex: 'foobar2000(?:/([\w\.]+))?'
117-
name: 'foobar2000'
118-
version: '$1'
119-
120116
- regex: 'HTC Streaming Player'
121117
name: 'HTC Streaming Player'
122118
version: ''

regexes/device-index-hash.yml

Lines changed: 131 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,9 @@ infinix x6838:
17301730
- XI
17311731
2406ern9cc:
17321732
- XI
1733+
sc-55d:
1734+
- SA
1735+
- SU
17331736
gi-626:
17341737
- A5
17351738
5039d_ru:
@@ -34359,8 +34362,6 @@ c1_max:
3435934362
- XI
3436034363
moto g14:
3436134364
- MR
34362-
sm-m546b:
34363-
- SA
3436434365
sm-a346m:
3436534366
- SA
3436634367
sm-a145m:
@@ -39512,6 +39513,94 @@ tecno cla6:
3951239513
- TB
3951339514
tecno cla5:
3951439515
- TB
39516+
sm-m556b:
39517+
- SA
39518+
sm-a356b:
39519+
- SA
39520+
xt2015-2:
39521+
- MR
39522+
mz-meizu 20 inf:
39523+
- M1
39524+
xt2409-5:
39525+
- MR
39526+
buzz 5 lite:
39527+
- AE
39528+
l24 ultra:
39529+
- LIB
39530+
g15 pro max:
39531+
- LIB
39532+
g24_mini:
39533+
- LIB
39534+
g15_mini:
39535+
- LIB
39536+
armor i1 slim:
39537+
- KHI
39538+
alt-lx1:
39539+
- HU
39540+
rmx3951:
39541+
- RE
39542+
tecno kl6:
39543+
- TB
39544+
umidigi g9 5g:
39545+
- UM
39546+
tecno ae11:
39547+
- TB
39548+
meizu s6:
39549+
- M1
39550+
v2405a:
39551+
- VV
39552+
wp52:
39553+
- OE
39554+
xt2453-2:
39555+
- MR
39556+
moto g85 5g:
39557+
- MR
39558+
v2424:
39559+
- VV
39560+
v2417:
39561+
- VV
39562+
sc-51d:
39563+
- SA
39564+
- SU
39565+
2410fpcc5g:
39566+
- 0P
39567+
2405cpx3dg:
39568+
- XI
39569+
tecno bg6s:
39570+
- TB
39571+
ulefone armor 6e:
39572+
- UL
39573+
tecno kl7:
39574+
- TB
39575+
tecno kj8:
39576+
- TB
39577+
tecno ae10:
39578+
- TB
39579+
so-51d:
39580+
- SO
39581+
sn339d:
39582+
- DQ
39583+
sc-51e:
39584+
- SA
39585+
- SU
39586+
rmx5003:
39587+
- RE
39588+
wave 8:
39589+
- B2
39590+
xt2271-5:
39591+
- MR
39592+
moto e14:
39593+
- MR
39594+
xq-ec44:
39595+
- SO
39596+
cph2683:
39597+
- OP
39598+
armor mini 20t pro:
39599+
- UL
39600+
zte v70:
39601+
- ZT
39602+
lenovo legion duel:
39603+
- LE
3951539604
gs55-6:
3951639605
- GS
3951739606
gs57-6:
@@ -48942,6 +49031,30 @@ kenshi_k10:
4894249031
- KHI
4894349032
wo pad max:
4894449033
- WAO
49034+
sm-x926b:
49035+
- SA
49036+
wo 7:
49037+
- WAO
49038+
venus pad16:
49039+
- LIB
49040+
venus pad15:
49041+
- LIB
49042+
tg 30:
49043+
- TM1
49044+
tg15:
49045+
- TM1
49046+
l16 max:
49047+
- LIB
49048+
ndl-w09:
49049+
- HU
49050+
tb375fc:
49051+
- LE
49052+
tab 16 pro:
49053+
- B2
49054+
hi10_xpro_pad:
49055+
- 1C
49056+
b22_eea:
49057+
- BIE
4894549058
jdn-al00:
4894649059
- HU
4894749060
ags2-al00hn:
@@ -61230,6 +61343,22 @@ yndx-00076:
6123061343
- YD
6123161344
yndx-00074:
6123261345
- YD
61346+
tanix_tx3_mini:
61347+
- 9N
61348+
bt_32fs32b:
61349+
- BLT
61350+
hongtop_box:
61351+
- HON
61352+
tox4:
61353+
- UG
61354+
tox3_plus:
61355+
- UG
61356+
sl-led50s02t2su:
61357+
- SC1
61358+
32les901t2sm:
61359+
- '05'
61360+
32les903t2sm:
61361+
- '05'
6123361362
bb2 pro:
6123461363
- 0M
6123561364
kii pro:

0 commit comments

Comments
 (0)