Skip to content

Commit

Permalink
Detect new brand and detect devices for exist brands and Create relea…
Browse files Browse the repository at this point in the history
…se 2.1.0 (#174)

* feat: added specs for samsung - galaxy s20 fe (sm-g780g, sm-g780f) and test detect trusted
* feat: added specs for xiaomi - redmi 10c (220333qny) and test detect trusted
* feat: added specs for xiaomi - mi 11 lite (m2101k9ag) and test detect trusted
* feat: added specs for xiaomi - redmi note 9 pro (m2003j6b2g) and test detect trusted
* feat: added specs for oppo - a93 (pehm00, peht00) and test detect trusted
* feat: added specs for blackview - bv6600 and test detect trusted
* feat: added test detect trusted for samsung - galaxy a10s (sm-a107f)

Detect new brand TriaPlay and Detect devices for exist brands (matomo-org#7642)
* feat(device) detect new brand TriaPlay: TV Box
* feat(device) detect brand Vivo: Y02t (V2252), Y100 (V2239), Y35m (V2230A)
* feat(device) detect brand T-Mobile: REVVL 6x 5G (TMRV065G), T Phone (2023)
* feat(device) detect brand Sigma: X-Treme PQ55
* feat(device) detect brand Xiaomi: 14 Pro, 13 Lite
* feat(device) detect brand Casper: VIA M35
* feat(device) detect brand Lenovo: Xiaoxin Pad Pro 12.7" (TB371FC)
* feat(device) detect brand Sparx: S7
* feat(device) detect brand Samsung: Galaxy Tab S9+ 12.4" (SM-X810), Galaxy Tab S9 12.4" 5G (SM-X716B)
* feat(device) detect brand OSCAL: Tiger 12
* feat(device) detect brand ZTE: Blade V50 Vita
* feat(device) detect brand Sky: Elite B63
* feat(device) detect brand Nokia: G42 5G
* feat(device) detect brand Motorola: ThinkPhone
* feat(device) detect brand Casper: VIA M30 Plus
* feat(device) detect brand Lenovo: Tab M9 (TB310FU)
* feat(device) detect brand Samsung: Galaxy A03s (SM-S135DL), Galaxy A33 5G (SM-A336BN), Galaxy Tab A9+ 11.0" 5G (SM-X216B)

Adds detection for System76 brand and improves detection for Apple and Meta devices (matomo-org#7641)
* Improves detection for Apple Watch
* Adds detection for Meta Quest 2 and Quest Pro
* Adds detection for System76
* Adds detection for Meta Portal Go

Update readme and set version 2.1.0
  • Loading branch information
sanchezzzhak authored Mar 27, 2024
1 parent 68bc6ac commit 7027622
Show file tree
Hide file tree
Showing 19 changed files with 1,327 additions and 327 deletions.
620 changes: 321 additions & 299 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/CLIENT_HINTS_BROWSER.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ This code is designed to receive client-hints on your page without additional pa
```js

export default function DeviceMeta() {

let gl;
if (!gl) {
try {
let canvas = document.createElement('canvas');
gl = canvas.getContext('webgl') ||
canvas.getContext('experimental-webgl');
} catch (e) {}
}
let hints = {};
let hints = {};
if (navigator.userAgentData) {
const fetchHints = [
'brands',
Expand Down Expand Up @@ -162,7 +162,7 @@ export default function DeviceMeta() {
return response;
}
// send track device information and client-hints for background processing
fetch('/api/t', {
postData('/api/t', {
eventId, // custom params (for example, this could be the visit ID)
metaData // client-hints + meta data for device
})
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-device-detector",
"version": "2.0.18",
"version": "2.1.0",
"description": "Nodejs device detector (port matomo-org/device-detector)",
"main": "index.js",
"scripts": {
Expand All @@ -24,7 +24,9 @@
"detect browser",
"detect device brand",
"detect device model",
"detect user-agent"
"detect user-agent",
"detect trusted device",
"client-hints"
],
"author": "sanchezzzhak",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions parser/client/browser-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,8 @@ module.exports = {
'ZV': 'Zvu',
'ZI': 'Zirco Browser',
'ZR': 'Zordo Browser',
// detected browsers in older versions
// 'IA': 'Iceape',: pim
// 'SM': 'SeaMonkey',: pim

};
2 changes: 2 additions & 0 deletions parser/device/brand-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,7 @@ module.exports = {
'SYC': 'Syco',
'SM': 'Symphony',
'4S': 'Syrox',
'SYS': 'System76',
'TM': 'T-Mobile',
'T96': 'T96',
'TAD': 'TADAAM',
Expand Down Expand Up @@ -1530,6 +1531,7 @@ module.exports = {
'5R': 'Transpeed',
'T6': 'TrekStor',
'T3': 'Trevi',
'TRI': 'TriaPlay',
'TJ': 'Trifone',
'Q5': 'Trident',
'4T': 'Tronsmart',
Expand Down
13 changes: 9 additions & 4 deletions parser/device/device-trusted.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,17 @@ const checkGpu = (deviceData, clientHints) => {
let deviceGPU = deviceInfo && deviceInfo.hardware && deviceInfo.hardware.gpu
? deviceInfo.hardware.gpu.name
: null;

let metaGPU = attr(clientHints.meta, 'gpu', null);
if (deviceGPU !== null && metaGPU !== null) {
if (!isDeviceGpuValid(deviceGPU, metaGPU)) {
return false;
}

if (metaGPU === 'PowerVR SGX Doma') {
metaGPU = 'PowerVR GE8320';
}

if (metaGPU !== null && deviceGPU !== null) {
return isDeviceGpuValid(deviceGPU, metaGPU)
}

return true;
};

Expand Down
15 changes: 15 additions & 0 deletions regexes/client-index-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,9 @@ af45e42:
76cc6a5f:
- - 4
- []
6f243db8:
- - 296
- []
2624d0d5:
- - 437
- []
Expand Down Expand Up @@ -3271,6 +3274,12 @@ cafc9d6:
afff8b2:
- []
- - 67
181783a8:
- - 356
- []
5f332956:
- - 356
- []
30a8c29e:
- - 317
- []
Expand Down Expand Up @@ -6878,6 +6887,9 @@ e68f8e6:
7f494dc7:
- - 516
- []
1973d17:
- []
- - 15
969a304:
- - 509
- []
Expand Down Expand Up @@ -9208,3 +9220,6 @@ e0bc6d3:
429bdf47:
- - 60
- []
371ab823:
- - 227
- []
50 changes: 50 additions & 0 deletions regexes/device-index-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,8 @@ blm-00:
- HU
xd-sdd05-2101:
- XW
portalgo:
- OQ
aeobc:
- KN
aeokn:
Expand Down Expand Up @@ -34807,6 +34809,42 @@ rmx3890:
- RE
23100rn82l:
- XI
v2252:
- VV
v2239:
- VV
v2230a:
- VV
tmrv065g:
- TM
t phone (2023):
- TM
x-treme pq55:
- 1S
xiaomi 14 pro:
- XI
via m35:
- R4
sparx s7:
- SPX
sm-s135dl:
- SA
sm-a336bn:
- SA
sm-s711u:
- SA
tiger 12:
- OSC
zte 8550:
- ZT
sky b63:
- SW
nokia g42 5g:
- NK
thinkphone by motorola:
- MR
via m30 plus:
- R4
y9plus:
- DO
doro 8030/8031/8028:
Expand Down Expand Up @@ -44334,6 +44372,16 @@ ipad7,12:
- AP
ipad6,8:
- AP
tb371fc:
- LE
sm-x810:
- SA
sm-x716b:
- SA
sm-x216b:
- SA
tb310fu:
- LE
jdn-al00:
- HU
ags2-al00hn:
Expand Down Expand Up @@ -55386,6 +55434,8 @@ aftalmo:
aftboxe1:
- TS
- KN
triaplaybox:
- TRI
bb2 pro:
- 0M
kii pro:
Expand Down
15 changes: 14 additions & 1 deletion regexes/device-info/device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,7 @@ blackview:
e7s: ''
omega pro: ''
p10000 pro: ''
bv6600: 'RE=2021.03;SZ=79.4x159x18;WT=325;DS=5.7;RS=720x1440;OI=1;OV=10;CP=355;RM=4096;'

# Bravis
bravis:
Expand Down Expand Up @@ -4397,7 +4398,7 @@ samsung:
sm-a102w: '->galaxy a10e'
sm-a107m: '->galaxy a10s'
sm-a107f: '->galaxy a10s'
galaxy a10s: 'RE=2019.08;SZ=75.8x156.9x7.8;WT=168;DS=6.2;RS=720x1520;OI=1;OV=9.0;CP=171;RM=2048;'
galaxy a10s: 'RE=2019.08;SZ=75.8x156.9x7.8;WT=168;DS=6.2;RS=720x1520;OI=1;OV=9;CP=171;RM=2048;'
galaxy note 20 5g: 'RE=2020.08;SZ=75.2x161.6x8.3;WT=192;DS=6.7;RS=1080x2400;OI=1;OV=10;CP=249;RM=8192;'
sm-n9810: '->galaxy note 20 5g'
sm-n981b: '->galaxy note 20 5g'
Expand Down Expand Up @@ -4728,6 +4729,9 @@ samsung:
sm-g781u1: '->galaxy s20 fe 5g'
sm-g781v: '->galaxy s20 fe 5g'
sm-g781w: '->galaxy s20 fe 5g'
galaxy s20 fe: 'RE=2020.09;SZ=74.5x159.8x8.4;WT=190;DS=6.5;RS=1080x2400;OI=1;OV=10;CP=249;RM=6144;'
sm-g780g: '->galaxy s20 fe;CP=207;'
sm-g780f: '->galaxy s20 fe;'
galaxy s4 zoom: 'RE=2013.06;SZ=63.5x125.5x15.4;WT=208;DS=4.3;RS=540x960;OI=1;OV=4.2.2;CP=;RM=1536;'
sm-c105a: '->galaxy s4 zoom'
sm-c105: '->galaxy s4 zoom'
Expand Down Expand Up @@ -7181,6 +7185,9 @@ oppo:
peym00: '->k9 pro 5g'
k9 5g: 'RE=2021.05;SZ=73.4x159.1x7.9;WT=172;DS=6.43;RS=1080x2400;OI=1;OV=11;CP=242;RM=8192;TT=449750;'
pexm00: '->k9 5g'
a93: 'RE=2021.01;SZ=74.7x162.9x8.4;WT=188;DS=6.5;RS=1080x2400;OI=1;OV=11;CP=307;RM=8192;'
pehm00: '->a93'
peht00: '->a93'

maze:
alpha: 'DS=6;RS=1080x1920;SZ=82.5x159.8x8.1;WT=225;RE=2017.06;OI=1;OV=7;RM=6144;CP=343;'
Expand Down Expand Up @@ -7230,5 +7237,11 @@ xiaomi:
redmi 9c nfc: 'RE=2020.08;SZ=77.1x164.9x9;WT=196;DS=6.53;RS=720x1600;OI=1;OV=10;CP=348;RM=2048;'
m2006c3mng: '->redmi 9c nfc'
redmi note 8 pro: 'RE=2019.08;SZ=76.4x161.4x8.8;WT=200;DS=6.53;RS=1080x2340;OI=1;OV=9;CP=325;GP=120;RM=4096;TT=224759;TG=6999;'
redmi note 9 pro: 'RE=2020.04;SZ=76.7x165.8x8.8;WT=209;DS=6.67;RS=1080x2400;OI=1;OV=10;CP=273;RM=6144;TT=279625;TG=1785;'
m2003j6b2g: '->redmi note 9 pro'
redmi 10: 'RE=2021.08;SZ=75.5x162x8.9;WT=181;DS=6.5;RS=1080x2400;OI=1;OV=11;CP=349;RM=4096;'
21061119dg: '->redmi 10'
redmi 10c: 'RE=2022.03;SZ=76.6x169.6x8.3;WT=190;DS=6.71;RS=720x1650;OI=1;OV=11;CP=363;RM=3072;'
220333qny: '->redmi 10c'
mi 11 lite: 'RE=2021.03;SZ=75.7x160.5x6.8;WT=157;DS=6.55;RS=1080x2400;OI=1;OV=11;CP=364;RM=4096;TT=290172;TG=1796;'
m2101k9ag: '->mi 11 lite'
4 changes: 2 additions & 2 deletions regexes/device-info/hardware-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ cpu:
process: 6nm
gpu_id: 110
307:
name: Qualcomm Snapdragon 480 5G
name: Qualcomm Snapdragon 480 5G # SM4350
type: ARM
cores: 8
clock_rate: 2000
Expand Down Expand Up @@ -2387,7 +2387,7 @@ cpu:
process: 12nm
gpu_id: 116
355:
name: MediaTek Helio A25
name: MediaTek Helio A25 #MT6762V/WD
type: ARM
cores: 8
clock_rate: 1800
Expand Down
Loading

0 comments on commit 7027622

Please sign in to comment.