Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improves detection for Android TV and Sony models #7459

Merged
merged 3 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ protected function parseDevice(): void
/**
* All devices that contain Andr0id in string are assumed to be a tv
*/
if ($this->matchUserAgent('Andr0id|Android TV|\(lite\) TV')) {
if ($this->matchUserAgent('Andr0id|Android TV|\(lite\) TV|BRAVIA')) {
$this->device = AbstractDeviceParser::DEVICE_TYPE_TV;
}

Expand Down
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3902,3 +3902,11 @@
version: "12.3"
platform: x64
family: Mac
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 11; BRAVIA VU31 Build/RTK2.220814.001)
os:
name: Android TV
short_name: ADR
version: "11"
platform:
family: Android
48 changes: 42 additions & 6 deletions Tests/fixtures/tv-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5514,7 +5514,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 9.0; BRAVIA 4K UR3 Build/PTT1.190515.001.S97) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.95 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: "9.0"
platform: ""
client:
Expand Down Expand Up @@ -5730,7 +5730,7 @@
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 10; BRAVIA VH1 Build/QTG3.200305.006.S89)
os:
name: Android
name: Android TV
version: "10"
platform: ""
client:
Expand All @@ -5748,7 +5748,7 @@
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 9; BRAVIA 4K UR1 Build/PTT1.190515.001.S104)
os:
name: Android
name: Android TV
version: "9"
platform: ""
client:
Expand All @@ -5766,7 +5766,7 @@
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 10; BRAVIA 4K VH2 Build/QTG3.200305.006.S118)
os:
name: Android
name: Android TV
version: "10"
platform: ""
client:
Expand All @@ -5784,7 +5784,7 @@
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 11; BRAVIA VU1 Build/RTT7.210105.001)
os:
name: Android
name: Android TV
version: "11"
platform: ""
client:
Expand Down Expand Up @@ -6090,7 +6090,7 @@
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 9; BRAVIA 8K UR3 Build/PTT1.190515.001.S104)
os:
name: Android
name: Android TV
version: "9"
platform: ""
client:
Expand Down Expand Up @@ -10285,3 +10285,39 @@
model: ULX-43UTCS347
os_family: Android
browser_family: Chrome
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 11; BRAVIA VU31 Build/RTK2.220814.001)
os:
name: Android TV
version: "11"
platform: ""
client:
type: browser
name: Android Browser
version: ""
engine: WebKit
engine_version: ""
device:
type: tv
brand: Sony
model: Bravia VU31
os_family: Android
browser_family: Android Browser
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 11; BRAVIA VU2 Build/RTT7.210923.001)
os:
name: Android TV
version: "11"
platform: ""
client:
type: browser
name: Android Browser
version: ""
engine: WebKit
engine_version: ""
device:
type: tv
brand: Sony
model: Bravia VU2
os_family: Android
browser_family: Android Browser
12 changes: 6 additions & 6 deletions Tests/fixtures/tv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4763,7 +4763,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 7.0; BRAVIA 2015 Build/NRD91N.S34; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: "7.0"
platform: ""
client:
Expand All @@ -4781,7 +4781,7 @@
-
user_agent: TV Bro/1.0 Mozilla/5.0 (Linux; Android 8.0.0; BRAVIA 2K GB ATV3 Build/OPR2.170623.027.S30; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.93 Safari/537.36
os:
name: Android
name: Android TV
version: 8.0.0
platform: ""
client:
Expand All @@ -4799,7 +4799,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 7.0; BRAVIA 4K 2015 Build/NRD91N.S34) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: "7.0"
platform: ""
client:
Expand All @@ -4817,7 +4817,7 @@
-
user_agent: TV Bro/1.0 Mozilla/5.0 (Linux; Android 7.0; BRAVIA 4K GB Build/NRD91N.S139; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.92 Safari/537.36
os:
name: Android
name: Android TV
version: "7.0"
platform: ""
client:
Expand All @@ -4835,7 +4835,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 7.0; BRAVIA 4K GB ATV3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: "7.0"
platform: ""
client:
Expand All @@ -4853,7 +4853,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 8.0.0; BRAVIA 4K UR2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: 8.0.0
platform: ""
client:
Expand Down
2 changes: 1 addition & 1 deletion regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7737,7 +7737,7 @@ Sony:
device: 'wearable'

# SONY: Bravia or TV Box
- regex: '(?:BRAVIA )(2K GB ATV3|[48]K UR[123]|4K GB ATV3|4K GB|4K VH2|4K 2015|2015|VH1|VU1)(?:[);/ ]|$)'
- regex: '(?:BRAVIA )(2K GB ATV3|[48]K UR[123]|4K GB ATV3|4K GB|4K VH2|4K 2015|2015|VH1|VU[12]|VU31)(?:[);/ ]|$)'
model: 'Bravia $1'
device: 'tv'
- regex: 'SVP-DTV15(?:[);/ ]|$)'
Expand Down
2 changes: 1 addition & 1 deletion regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
name: 'Android TV'
version: '$1'

- regex: 'Android[; ](\d+[\.\d]*).+(?:(?:Android|AT&T) TV|AOSP on r33a0)'
- regex: 'Android[; ](\d+[\.\d]*).+(?:(?:Android|AT&T) TV|AOSP on r33a0|BRAVIA)'
name: 'Android TV'
version: '$1'

Expand Down