Skip to content

Commit

Permalink
Adds detection for astro brand
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuconcioiu committed Dec 13, 2024
1 parent 5b4fa2d commit 695ff5d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ abstract class AbstractDeviceParser extends AbstractParser
'59' => 'ArtLine',
'8A' => 'Asano',
'90' => 'Asanzo',
'1U' => 'Astro',
'1U' => 'Astro (UA)',
'AST' => 'astro (MY)',
'A4' => 'Ask',
'A8' => 'Assistant',
'ASS' => 'ASSE',
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9723,7 +9723,7 @@
engine_version: 79.0.3945.93
device:
type: smartphone
brand: Astro
brand: Astro (UA)
model: S451
os_family: Android
browser_family: Chrome
Expand All @@ -9741,7 +9741,7 @@
engine_version: 74.0.3729.157
device:
type: smartphone
brand: Astro
brand: Astro (UA)
model: S501
os_family: Android
browser_family: Chrome
Expand Down
45 changes: 45 additions & 0 deletions Tests/fixtures/tv-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,48 @@
model: Smart TV (2020)
os_family: GNU/Linux
browser_family: Opera
-
user_agent: Mozilla/5.0 (Astro;AS620SM;2.2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
os: [ ]
client:
type: browser
name: Safari
version: "13.0"
engine: WebKit
engine_version: 605.1.15
device:
type: tv
brand: astro (MY)
model: AS620SM
os_family: Unknown
browser_family: Safari
-
user_agent: Mozilla/5.0 (Astro;AS630SM;2.2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
os: [ ]
client:
type: browser
name: Safari
version: "13.0"
engine: WebKit
engine_version: 605.1.15
device:
type: tv
brand: astro (MY)
model: AS630SM
os_family: Unknown
browser_family: Safari
-
user_agent: Mozilla/5.0 (Astro;KSTB6112;2.2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
os: [ ]
client:
type: browser
name: Safari
version: "13.0"
engine: WebKit
engine_version: 605.1.15
device:
type: tv
brand: astro (MY)
model: KSTB6112
os_family: Unknown
browser_family: Safari
10 changes: 8 additions & 2 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17438,7 +17438,7 @@ Matrix:

# Mobicel or Mobicell
Mobicel:
regex: 'Mobicel[_ ](R[16]|METRO2)|ASTRO(?: Build|[;)]|$)|(?:Android 6(?:[\d.]*);(?: [\w-]+;)? SHIFT)|(?:Android 8(?:[\d.]*);(?: [\w-]+;)? (?:BEAM|ZOOM|RUBY)|FAME(?:_DS)?|CLIK|R7_[12]|(?<!INTENSE )HYPE(?:_X)?|DANDY(?:_ZAM)?|(?<!SMADL )Matrix|VENUS_G|TRENDY PLUS|FENDY_DS|TANGO_LITE|BLINK|BERRY|BERRY[_ ]?(?:[12]|PLUS)|R1PLUS_1|ZOOM-H|REBEL|LEGEND (?:MAX|PRO_1|Pro LTE)|HERO_DS|Switch[ _]GO|SWITCH1|switch plus|PULSE_1|TRENDY 2|TRENDY_LITE|FEVER_PLUS(?:_[HJ])?|RIO_(?:SS|ZAM|RW|BN)|Clik plus|(PURE|Fendy) PLUS|RX PRO|Neo[ _]LTE|Titan_1|ZOOM_1|R4 LTE|NEO_1|EPIC_[12]| GLO|EPIC PRO_[12]|IX PRO|OREO|Cosmo LTE|Neo_Plus|IX-1|Android 13(?:[\d.]*);(?: [\w-]+;)? IX|Android 1[12](?:[\d.]*);(?: [\w-]+;)? FORCE|VX20|VX19)(?:[);/ ]|$)'
regex: 'Mobicel[_ ](R[16]|METRO2)|(?<!\()ASTRO(?: Build|[;)]|$)|(?:Android 6(?:[\d.]*);(?: [\w-]+;)? SHIFT)|(?:Android 8(?:[\d.]*);(?: [\w-]+;)? (?:BEAM|ZOOM|RUBY)|FAME(?:_DS)?|CLIK|R7_[12]|(?<!INTENSE )HYPE(?:_X)?|DANDY(?:_ZAM)?|(?<!SMADL )Matrix|VENUS_G|TRENDY PLUS|FENDY_DS|TANGO_LITE|BLINK|BERRY|BERRY[_ ]?(?:[12]|PLUS)|R1PLUS_1|ZOOM-H|REBEL|LEGEND (?:MAX|PRO_1|Pro LTE)|HERO_DS|Switch[ _]GO|SWITCH1|switch plus|PULSE_1|TRENDY 2|TRENDY_LITE|FEVER_PLUS(?:_[HJ])?|RIO_(?:SS|ZAM|RW|BN)|Clik plus|(PURE|Fendy) PLUS|RX PRO|Neo[ _]LTE|Titan_1|ZOOM_1|R4 LTE|NEO_1|EPIC_[12]| GLO|EPIC PRO_[12]|IX PRO|OREO|Cosmo LTE|Neo_Plus|IX-1|Android 13(?:[\d.]*);(?: [\w-]+;)? IX|Android 1[12](?:[\d.]*);(?: [\w-]+;)? FORCE|VX20|VX19)(?:[);/ ]|$)'
device: 'smartphone'
models:
- regex: 'EPIC PRO_([12])'
Expand Down Expand Up @@ -19494,8 +19494,14 @@ Odys:
- regex: 'Odys[ _-]([^/;]+) Build'
model: '$1'

# astro (https://www.astro.com.my/)
astro (MY):
regex: 'Astro;([A-Z0-9]+);'
device: 'tv'
model: '$1'

# Astro (astro.ua)
Astro:
Astro (UA):
regex: 'Astro[- ](S451|S501)(?:[);/ ]|$)'
device: 'smartphone'
model: '$1'
Expand Down

0 comments on commit 695ff5d

Please sign in to comment.