Skip to content

Commit

Permalink
Detect new device brands and Detect devices for exist brands (#214)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sanchezzzhak authored Jan 20, 2025
1 parent 6c77617 commit 0aafdda
Show file tree
Hide file tree
Showing 38 changed files with 8,572 additions and 3,925 deletions.
716 changes: 361 additions & 355 deletions README.md

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,19 @@ class DeviceDetector {

/**
* All unknown devices under running Java ME
* are more likely a features phones
* are more likely features phones
*/
if (deviceType === '' && osName === 'Java ME') {
deviceType = DEVICE_TYPE.FEATURE_PHONE;
}

/**
* All devices running KaiOS are more likely features phones
*/
if ('KaiOS' === osName) {
deviceType = DEVICE_TYPE.FEATURE_PHONE;
}

/**
* According to http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx
* Internet Explorer 10 introduces the "Touch" UA string token. If this token is present at the end of the
Expand Down Expand Up @@ -626,9 +633,13 @@ 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)) {
const hasDeviceTvType = [
DEVICE_TYPE.TV,
DEVICE_TYPE.PERIPHERAL
].indexOf(deviceType) === -1 && helper.hasAndroidTVFragment(userAgent)
if (hasDeviceTvType) {
deviceType = DEVICE_TYPE.TV;
}
/**
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.6",
"version": "2.1.7",
"description": "Nodejs device detector (port matomo-org/device-detector)",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions parser/client/browser-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
'AL': 'Aloha Browser',
'AH': 'Aloha Browser Lite',
'A8': 'ALVA',
'9A': 'AltiBrowser',
'AM': 'Amaya',
'A3': 'Amaze Browser',
'A5': 'Amerigo',
Expand Down Expand Up @@ -345,6 +346,7 @@ module.exports = {
'LX': 'Lynx',
'L2': 'Lynket Browser',
'MD': 'Mandarin',
'MP': 'Maple',
'M5': 'MarsLab Web Browser',
'M7': 'MaxBrowser',
'M1': 'mCent',
Expand Down
22 changes: 21 additions & 1 deletion parser/device/brand-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ module.exports = {
'ALS': 'All Star',
'AA': 'AllCall',
'3A': 'AllDocube',
'ALL': 'allente',
'A2': 'Allview',
'ALI': 'ALLINmobile',
'A7': 'Allwinner',
'ALP': 'alpsmart',
'A1': 'Altech UEC',
'66': 'Altice',
'ALM': 'Altimo',
'A5': 'altron',
'ALB': 'Altibox',
'ALT': 'Altus',
'KN': 'Amazon',
'AMZ': 'Amazon Basics',
Expand Down Expand Up @@ -195,6 +198,7 @@ module.exports = {
'BLK': 'Black Box',
'BF': 'Black Fox',
'BPC': 'Blackpcs',
'BLP': 'Blackphone',
'BLT': 'Blackton',
'B2': 'Blackview',
'2Y': 'b2m',
Expand Down Expand Up @@ -241,6 +245,7 @@ module.exports = {
'C9': 'CAGI',
'CAD': 'CADENA',
'CT': 'Capitel',
'GRD': 'G-Guard',
'G3': 'CG Mobile',
'37': 'CGV',
'CP': 'Captiva',
Expand Down Expand Up @@ -292,6 +297,7 @@ module.exports = {
'CY': 'Coby Kyros',
'XC': 'Cobalt',
'C6': 'Comio',
'COM': 'CommScope',
'CL': 'Compal',
'CQ': 'Compaq',
'C7': 'ComTrade Tesla',
Expand Down Expand Up @@ -561,6 +567,7 @@ module.exports = {
'44': 'Four Mobile',
'F0': 'Fonos',
'F2': 'FORME',
'FRM': 'Formovie',
'F5': 'Formuler',
'FR': 'Forstar',
'RF': 'Fortis',
Expand Down Expand Up @@ -603,6 +610,7 @@ module.exports = {
'GD': 'Gemini',
'GN': 'General Mobile',
'2G': 'Genesis',
'GEP': 'Geo Phone',
'G2': 'GEOFOX',
'GE': 'Geotel',
'Q4': 'Geotex',
Expand Down Expand Up @@ -654,6 +662,7 @@ module.exports = {
'GR1': 'GroBerwert',
'GF': 'Gretel',
'82': 'Gresso',
'GRB': 'Grünberg',
'GU': 'Grundig',
'GV': 'Gtel',
'CUO': 'Guophone',
Expand Down Expand Up @@ -707,6 +716,7 @@ module.exports = {
'HMD': 'HMD',
'8W': 'HKPro',
'HOF': 'HOFER',
'HOC': 'hoco',
'H1': 'Hoffmann',
'HOM': 'Homatics',
'H0': 'Hometech',
Expand Down Expand Up @@ -760,6 +770,7 @@ module.exports = {
'IC': 'iDroid',
'IDI': 'iDino',
'6Z': 'iData',
'IDC': 'IDC',
'IG': 'iGet',
'IHL': 'iHome Life',
'IH': 'iHunt',
Expand Down Expand Up @@ -982,6 +993,7 @@ module.exports = {
'LU': 'Lumus',
'LUM': 'Lumitel',
'L9': 'Luna',
'LUO': 'LUO',
'LR': 'Luxor',
'LY': 'LYF',
'LL': 'Leader Phone',
Expand Down Expand Up @@ -1104,6 +1116,7 @@ module.exports = {
'72': 'M-Tech',
'9H': 'M-Horse',
'MKP': 'M-KOPA',
'MLB': 'multibox',
'1R': 'Multilaser',
'MPS': 'MultiPOS',
'1M': 'MYFON',
Expand Down Expand Up @@ -1214,7 +1227,7 @@ module.exports = {
'OQ': 'Meta',
'O1': 'Odys',
'ODP': 'Odotpad',
'O9': 'Ok',
'O9': 'ok.',
'OKA': 'Okapi',
'OA': 'Okapia',
'OKI': 'Oking',
Expand Down Expand Up @@ -1380,6 +1393,7 @@ module.exports = {
'WJ': 'Qware',
'QWT': 'QWATT',
'R2': 'R-TV',
'R3D': 'R3Di',
'RA': 'Ramos',
'0R': 'Raspberry',
'R9': 'Ravoz',
Expand All @@ -1396,6 +1410,7 @@ module.exports = {
'RE': 'Realme',
'RE1': 'Redbean',
'R8': 'RED',
'RDX': 'RED-X',
'REW': 'Redway',
'6F': 'Redfox',
'RE2': 'RedLine',
Expand Down Expand Up @@ -1590,10 +1605,12 @@ module.exports = {
'5Y': 'Sunny',
'W8': 'SUNWIND',
'SBX': 'SuperBOX',
'SBM': 'Supermax',
'SBR': 'Sber',
'SGE': 'Super General',
'SU': 'SuperSonic',
'79': 'SuperTab',
'STV': 'SuperTV',
'S5': 'Supra',
'SUP': 'Supraim',
'ZS': 'Suzuki',
Expand Down Expand Up @@ -1723,6 +1740,7 @@ module.exports = {
'TUC': 'TUCSON',
'2U': 'Türk Telekom',
'TV': 'TVC',
'TVP': 'TV+',
'TW': 'TWM',
'Z1': 'TWZ',
'6T': 'Twoe',
Expand Down Expand Up @@ -1751,6 +1769,7 @@ module.exports = {
'UGR': 'United Group',
'UO': 'Unnecto',
'UNN': 'Unnion Technologies',
'UNP': 'UnoPhone',
'UU': 'Unonu',
'UN': 'Unowhy',
'UY': 'UNNO',
Expand Down Expand Up @@ -1885,6 +1904,7 @@ module.exports = {
'W2': 'Wigor',
'WI': 'Wiko',
'WF': 'Wileyfox',
'WLR': 'WildRed',
'WS': 'Winds',
'WN': 'Wink',
'9W': 'Winmax',
Expand Down
6 changes: 3 additions & 3 deletions parser/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@ function hasPuffinTabletFragment(userAgent) {
*/
function hasAndroidTVFragment(userAgent) {
return matchUserAgent(
'Andr0id|(?:Android(?: UHD)?|Google) TV|[(]lite[)] TV|BRAVIA|[(]TV;| TV$',
'Andr0id|(?:Android(?: UHD)?|(?<!Xming )Google) TV|\\(lite\\) TV|BRAVIA| TV$',
userAgent
) !== null;
}

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

/**
Expand Down
Loading

0 comments on commit 0aafdda

Please sign in to comment.