Skip to content

Commit

Permalink
Detect new brands: Biegedy, Blackton, Temigereev, and Detect devices …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sanchezzzhak authored Nov 20, 2024
1 parent 4aeba7f commit 0ac61e7
Show file tree
Hide file tree
Showing 25 changed files with 1,892 additions and 426 deletions.
597 changes: 299 additions & 298 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ export default class DeviceDetector {
setOsVersionTruncate(value: any): void;
setClientVersionTruncate(value: any): void;

set deviceTrusted(arg: boolean);
set deviceTrusted(stage: boolean);
get deviceTrusted(): boolean;

set deviceInfo(arg: boolean);
set deviceInfo(stage: boolean);
get deviceInfo(): boolean;

/**
* @param {boolean} arg - true use indexes, false not use indexes
* @param {boolean} stage - true use indexes, false not use indexes
*/
set deviceIndexes(arg: boolean);
set deviceIndexes(stage: boolean);

/**
* @return {boolean} - true use indexes, false not use indexes
Expand Down
26 changes: 18 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DeviceDetector {
/**
* @param {DeviceDetectorOptions} options
**/
constructor(options) {
constructor(options = {}) {
this.init();

this.skipBotDetection = attr(options, 'skipBotDetection', false);
Expand Down Expand Up @@ -116,8 +116,8 @@ class DeviceDetector {
this.addParseBot(BOT_PARSER, new BotParser());
}

set deviceTrusted(check) {
this.#deviceTrusted = check;
set deviceTrusted(stage) {
this.#deviceTrusted = stage;
}

get deviceTrusted() {
Expand Down Expand Up @@ -166,10 +166,10 @@ class DeviceDetector {
}

/**
* @param {boolean} status - true use indexes, false not use indexes
* @param {boolean} stage - true use indexes, false not use indexes
*/
set deviceIndexes(status) {
this.#deviceIndexes = status;
set deviceIndexes(stage) {
this.#deviceIndexes = stage;
}

/**
Expand Down Expand Up @@ -626,7 +626,7 @@ class DeviceDetector {
deviceType = DEVICE_TYPE.TV;
}
/**
* All devices that contain Andr0id in string are assumed to be a tv
* All devices that contain "Andr0id" in string are assumed to be a tv
*/
if (helper.hasAndroidTVFragment(userAgent)) {
deviceType = DEVICE_TYPE.TV;
Expand Down Expand Up @@ -695,6 +695,16 @@ class DeviceDetector {
return aliasDevice.parse(userAgent);
}

/**
* restore original userAgent from clientHints object
* @param {string} userAgent
* @param {ResultClientHints} clientHints
* @return {string}
*/
restoreUserAgentFromClientHints(userAgent, clientHints) {
return helper.restoreUserAgentFromClientHints(userAgent, clientHints)
}

/**
* parse device
* @param {string} userAgent
Expand All @@ -714,7 +724,7 @@ class DeviceDetector {
trusted: null
};

let ua = helper.restoreUserAgentFromClientHints(userAgent, clientHints);
const ua = this.restoreUserAgentFromClientHints(userAgent, clientHints);
// skip all parse is client-hints useragent and model not exist
if (!helper.hasDeviceModelByClientHints(clientHints) && helper.hasUserAgentClientHintsFragment(userAgent)) {
return Object.assign({}, result);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-device-detector",
"version": "2.1.5",
"version": "2.1.6",
"description": "Nodejs device detector (port matomo-org/device-detector)",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions parser/client/browser-families.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ module.exports = {
],
'Firefox': [
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'GZ', 'I4', 'IF',
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'I4', 'IF', '8P',
'IW', 'LH', 'LY', 'MB', 'MN', 'MO', 'MY', 'OA', 'OS',
'PI', 'PX', 'QA', 'S5', 'SX', 'TF', 'TO', 'WF', 'ZV',
'FP', 'AD', '2I', 'P9', 'KJ', 'WY', 'VK', 'W5',
'7C', 'N7', 'W7', '8P',
'7C', 'N7', 'W7',
],
'Internet Explorer': ['IE', 'CZ', 'BZ', 'IM', 'PS', '3A', '4A', 'RN'],
'Konqueror': ['KO'],
Expand Down
3 changes: 3 additions & 0 deletions parser/device/brand-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ module.exports = {
'BT': 'Bitel',
'B7': 'Bitmore',
'ZB': 'Bittium',
'BIE': 'Biegedy',
'BK': 'Bkav',
'5B': 'Black Bear',
'BLK': 'Black Box',
'BF': 'Black Fox',
'BPC': 'Blackpcs',
'BLT': 'Blackton',
'B2': 'Blackview',
'2Y': 'b2m',
'BP': 'Blaupunkt',
Expand Down Expand Up @@ -1611,6 +1613,7 @@ module.exports = {
'TX': 'TechniSat',
'TT': 'TechnoTrend',
'TTS': 'TECHNOSAT',
'TM1': 'Temigereev',
'TP': 'TechPad',
'TPS': 'TPS',
'9E': 'Techwood',
Expand Down
2 changes: 1 addition & 1 deletion parser/os-abstract-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class OsAbstractParser extends ParserAbstract {
if (this.getBaseRegExp('sparc64').test(userAgent)) {
return 'SPARC64';
}
if (this.getBaseRegExp('64-?bit|WOW64|(?:Intel)?x64|WINDOWS_64|win64|.*amd64|x86_?64').test(userAgent)) {
if (this.getBaseRegExp('64-?bit|WOW64|(?:Intel)?x64|WINDOWS_64|win64|.*amd64|.*x86_?64').test(userAgent)) {
return 'x64';
}
if (this.getBaseRegExp('.+32bit|.+win32|(?:i[0-9]|x)86|i86pc').test(userAgent)) {
Expand Down
6 changes: 6 additions & 0 deletions regexes/client-index-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
'28292465':
- - 419
- []
'28387235':
- - 397
- []
'29511629':
- - 551
- []
Expand Down Expand Up @@ -4304,6 +4307,9 @@ d19f499:
47d4fd11:
- []
- - 327
1615ccb:
- []
- - 577
6e09c04d:
- - 397
- []
Expand Down
3 changes: 0 additions & 3 deletions regexes/client/browser_engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
- regex: 'Servo'
name: 'Servo'

- regex: 'Goanna'
name: 'Goanna'

- regex: 'Ekioh(?:Flow)?'
name: 'EkiohFlow'

Expand Down
14 changes: 10 additions & 4 deletions regexes/client/libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@
name: 'OkHttp'
version: '$1'

- regex: 'HTTP_Request2(?:/(\d+[.\d]+))?'
name: 'HTTP_Request2'
version: '$1'

- regex: 'HTTP_Request2(?:/(\d+[.\d]+))?'
name: 'HTTP_Request2'
version: '$1'
Expand Down Expand Up @@ -643,3 +639,13 @@
name: 'ICAP Client'
version: '$1'
url: 'https://github.com/Peoplecantfly/icapserver'

- regex: 'Cygwin-Setup(?:/(\d+[.\d]+))?'
name: 'Cygwin'
version: '$1'
url: 'https://www.cygwin.com/'

- regex: 'azsdk-python-storage-blob(?:/(\d+[.\d]+))?'
name: 'Azure Blob Storage'
version: '$1'
url: 'https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python'
4 changes: 0 additions & 4 deletions regexes/client/mediaplayers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@
name: 'mpv'
version: '$1'

- regex: 'foobar2000(?:/([\w\.]+))?'
name: 'foobar2000'
version: '$1'

- regex: 'HTC Streaming Player'
name: 'HTC Streaming Player'
version: ''
Expand Down
133 changes: 131 additions & 2 deletions regexes/device-index-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,9 @@ infinix x6838:
- XI
2406ern9cc:
- XI
sc-55d:
- SA
- SU
gi-626:
- A5
5039d_ru:
Expand Down Expand Up @@ -34359,8 +34362,6 @@ c1_max:
- XI
moto g14:
- MR
sm-m546b:
- SA
sm-a346m:
- SA
sm-a145m:
Expand Down Expand Up @@ -39512,6 +39513,94 @@ tecno cla6:
- TB
tecno cla5:
- TB
sm-m556b:
- SA
sm-a356b:
- SA
xt2015-2:
- MR
mz-meizu 20 inf:
- M1
xt2409-5:
- MR
buzz 5 lite:
- AE
l24 ultra:
- LIB
g15 pro max:
- LIB
g24_mini:
- LIB
g15_mini:
- LIB
armor i1 slim:
- KHI
alt-lx1:
- HU
rmx3951:
- RE
tecno kl6:
- TB
umidigi g9 5g:
- UM
tecno ae11:
- TB
meizu s6:
- M1
v2405a:
- VV
wp52:
- OE
xt2453-2:
- MR
moto g85 5g:
- MR
v2424:
- VV
v2417:
- VV
sc-51d:
- SA
- SU
2410fpcc5g:
- 0P
2405cpx3dg:
- XI
tecno bg6s:
- TB
ulefone armor 6e:
- UL
tecno kl7:
- TB
tecno kj8:
- TB
tecno ae10:
- TB
so-51d:
- SO
sn339d:
- DQ
sc-51e:
- SA
- SU
rmx5003:
- RE
wave 8:
- B2
xt2271-5:
- MR
moto e14:
- MR
xq-ec44:
- SO
cph2683:
- OP
armor mini 20t pro:
- UL
zte v70:
- ZT
lenovo legion duel:
- LE
gs55-6:
- GS
gs57-6:
Expand Down Expand Up @@ -48942,6 +49031,30 @@ kenshi_k10:
- KHI
wo pad max:
- WAO
sm-x926b:
- SA
wo 7:
- WAO
venus pad16:
- LIB
venus pad15:
- LIB
tg 30:
- TM1
tg15:
- TM1
l16 max:
- LIB
ndl-w09:
- HU
tb375fc:
- LE
tab 16 pro:
- B2
hi10_xpro_pad:
- 1C
b22_eea:
- BIE
jdn-al00:
- HU
ags2-al00hn:
Expand Down Expand Up @@ -61230,6 +61343,22 @@ yndx-00076:
- YD
yndx-00074:
- YD
tanix_tx3_mini:
- 9N
bt_32fs32b:
- BLT
hongtop_box:
- HON
tox4:
- UG
tox3_plus:
- UG
sl-led50s02t2su:
- SC1
32les901t2sm:
- '05'
32les903t2sm:
- '05'
bb2 pro:
- 0M
kii pro:
Expand Down
Loading

0 comments on commit 0ac61e7

Please sign in to comment.