Skip to content

Commit

Permalink
feat(device) detect new brand Philco models: PH350, PCS01
Browse files Browse the repository at this point in the history
feat(device) detect brand Realme model: C3 (RMX2020)
feat(device) detect brand Multilaser model: M7 3G Plus
feat(device) detect brand Quantum model: MUV Up
feat(device) detect brand Positivo BGH models: Twist Metal, Twist 2

issue matomo-org#6322
  • Loading branch information
sanchezzzhak committed Jun 27, 2020
1 parent 798afea commit 846dc95
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 9 deletions.
1 change: 1 addition & 0 deletions Parser/Device/DeviceParserAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'PE' => 'PEAQ',
'PG' => 'Pentagram',
'PH' => 'Philips',
'4P' => 'Philco',
'1P' => 'Phicomm',
'PI' => 'Pioneer',
'PX' => 'Pixus',
Expand Down
161 changes: 161 additions & 0 deletions Tests/fixtures/smartphone-14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7654,3 +7654,164 @@
model: 6I
os_family: Android
browser_family: Chrome
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; M7-3G-PLUS Build/V18_20200413)
os:
name: Android
short_name: AND
version: 8.1.0
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: tablet
brand: 1R
model: M7 3G Plus
os_family: Android
browser_family: Android Browser
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; M7_3G_PLUS Build/V4_20191031)
os:
name: Android
short_name: AND
version: 8.1.0
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: tablet
brand: 1R
model: M7 3G Plus
os_family: Android
browser_family: Android Browser
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 7.0; Quantum MUV UP Build/NRD90M)
os:
name: Android
short_name: AND
version: "7.0"
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: smartphone
brand: QA
model: MUV Up
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; Android 9; PCS01 Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36
os:
name: Android
short_name: AND
version: "9"
platform: ""
client:
type: browser
name: Chrome Webview
short_name: CV
version: 83.0.4103.106
engine: Blink
engine_version: ""
device:
type: smartphone
brand: 4P
model: PCS01
os_family: Android
browser_family: Chrome
-
user_agent: Dalvik/1.6.0 (Linux; U; Android 4.0.4; PH350B Build/IMM76D)
os:
name: Android
short_name: AND
version: 4.0.4
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: smartphone
brand: MM
model: PH350
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; Android 10; RMX2020 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/81.0.4044.117 Mobile Safari/537.36
os:
name: Android
short_name: AND
version: "10"
platform: ""
client:
type: browser
name: Chrome Webview
short_name: CV
version: 81.0.4044.117
engine: Blink
engine_version: ""
device:
type: smartphone
brand: RE
model: C3
os_family: Android
browser_family: Chrome
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 7.0; Twist Metal Build/NRD90M)
os:
name: Android
short_name: AND
version: "7.0"
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: smartphone
brand: 3P
model: Twist Metal
os_family: Android
browser_family: Android Browser
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; Twist 2 Build/OPM2.171019.012)
os:
name: Android
short_name: AND
version: 8.1.0
platform: ""
client:
type: browser
name: Android Browser
short_name: AN
version: ""
engine: WebKit
engine_version: ""
device:
type: smartphone
brand: 3P
model: Twist 2
os_family: Android
browser_family: Android Browser

30 changes: 21 additions & 9 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9003,7 +9003,7 @@ OnePlus:

# Realme (sub brand Oppo)
Realme:
regex: '(?:RMX(?:19(03|4[1235]|9[23]|2[157]|[01379]1)|20[06]1|2027|20[34]0|2051|18(0[1579]|11|3[13]|2[157]|[45]1|45))|(?:OPPO[ _]?)?CPH1861)[ ;/)]'
regex: '(?:RMX(?:19(03|4[1235]|9[23]|2[157]|[01379]1)|20[06]1|2027|20[234]0|2051|18(0[1579]|11|3[13]|2[157]|[45]1|45))|(?:OPPO[ _]?)?CPH1861)[ ;/)]'
device: 'smartphone'
models:
- regex: '(?:OPPO[ _]?)?CPH1861[);/ ]'
Expand Down Expand Up @@ -9046,7 +9046,7 @@ Realme:
model: 'C1'
- regex: 'RMX194[1235]'
model: 'C2'
- regex: 'RMX2027'
- regex: 'RMX202[07]'
model: 'C3'
- regex: 'RMX1831'
model: 'U1'
Expand Down Expand Up @@ -11128,13 +11128,15 @@ QMobile:

# Quantum
Quantum:
regex: 'Quantum (Fit|MUV PRO|Go|Mini|V|You [2E])[);/ ]'
regex: 'Quantum (Fit|MUV (?:PRO|UP)|Go|Mini|V|You [2E])[);/ ]'
device: 'smartphone'
models:
- regex: 'Quantum (Fit|Go|Mini|V|You [2E])[);/ ]'
model: '$1'
- regex: 'Quantum MUV PRO[);/ ]'
model: 'MUV Pro'
- regex: 'Quantum MUV UP[);/ ]'
model: 'MUV Up'

# Quechua
Quechua:
Expand Down Expand Up @@ -14820,23 +14822,28 @@ How:

# Multilaser
Multilaser:
regex: '(Multilaser[ _](?:[FE])|MS50G)[);/ ]'
regex: '(Multilaser[ _](?:[FE])|MS50G|M7[_-]3G[_-]PLUS)[);/ ]'
device: 'smartphone'
models:
- regex: 'Multilaser[ _]([FE])[);/ ]' #P9118
model: '$1'
- regex: '(MS50G)[);/ ]'
model: '$1'
- regex: '(M7[_-]3G[_-]PLUS)[);/ ]'
device: 'tablet'
model: 'M7 3G Plus'

# Positivo BGH
Positivo BGH:
regex: '(Positivo Twist [SM]|Twist (?:\(2018\)|2 (?:Fit|Pro)|Mini|Metal 32GB|Max|XL))[);/ ]'
regex: '(Positivo Twist|Twist (?:\(2018\)|2 (?:Fit|Pro)|Mini|Metal(?: 32GB)?|Max|XL|[2SM]))[);/ ]'
device: 'smartphone'
models:
- regex: 'Twist \(2018\)[);/ ]'
model: 'Twist (2018)'
- regex: 'Twist Metal 32GB[);/ ]'
model: 'Twist Metal 32GB'
- regex: 'Twist Metal[);/ ]'
model: 'Twist Metal'
- regex: 'Twist Max[);/ ]'
model: 'Twist Max'
- regex: 'Twist Mini[);/ ]'
Expand All @@ -14847,12 +14854,17 @@ Positivo BGH:
model: 'Twist 2 Pro'
- regex: 'Twist XL[);/ ]'
model: 'Twist XL'
- regex: 'Positivo Twist S[);/ ]'
model: 'Twist S'
- regex: 'Positivo Twist M[);/ ]'
model: 'Twist M'
- regex: '(?:Positivo )?Twist ([2SM])[);/ ]'
model: 'Twist $1'

# Maxtron
Maxtron:
regex: 'Maxtron[ _-](V[327]|S8)[);/ ]'
device: 'smartphone'
model: '$1'

# Philco
Philco:
regex: '(PCS01|PH350B)[);/ ]'
device: 'smartphone'
model: '$1'

0 comments on commit 846dc95

Please sign in to comment.