Skip to content

Commit

Permalink
Implement Google Pixel devices
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes committed Mar 5, 2017
1 parent 21248c1 commit 85c0c20
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG
Expand Up @@ -106,4 +106,4 @@ v1.2
- Cleanup and normalization of the language code
- [PIG] Return a schema with ONLY the requested fields
- Consistently add the Brand to the DeviceName to get a much more consistent dataset.

- Implement Google Pixel devices
133 changes: 133 additions & 0 deletions analyzer/src/main/resources/UserAgents/GoogleChrome.yaml
Expand Up @@ -449,3 +449,136 @@ config:
AgentVersionMajor : '1'
AgentNameVersion : 'Opera Neon 1.0.2459.0'
AgentNameVersionMajor : 'Opera Neon 1'

- test:
input:
user_agent_string: 'Mozilla/5.0 (Linux; Android 7.1.1; Pixel Build/NMF26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36'
expected:
DeviceClass : 'Phone'
DeviceName : 'Google Pixel'
DeviceBrand : 'Google'
OperatingSystemClass : 'Mobile'
OperatingSystemName : 'Android'
OperatingSystemVersion : '7.1.1'
OperatingSystemNameVersion : 'Android 7.1.1'
OperatingSystemVersionBuild : 'NMF26U'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Blink'
LayoutEngineVersion : '56.0'
LayoutEngineVersionMajor : '56'
LayoutEngineNameVersion : 'Blink 56.0'
LayoutEngineNameVersionMajor : 'Blink 56'
AgentClass : 'Browser'
AgentName : 'Chrome'
AgentVersion : '56.0.2924.87'
AgentVersionMajor : '56'
AgentNameVersion : 'Chrome 56.0.2924.87'
AgentNameVersionMajor : 'Chrome 56'

- test:
input:
user_agent_string: 'Mozilla/5.0 (Linux; Android 7.1.1; Pixel XL Build/NMF26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36'
expected:
DeviceClass : 'Phone'
DeviceName : 'Google Pixel XL'
DeviceBrand : 'Google'
OperatingSystemClass : 'Mobile'
OperatingSystemName : 'Android'
OperatingSystemVersion : '7.1.1'
OperatingSystemNameVersion : 'Android 7.1.1'
OperatingSystemVersionBuild : 'NMF26U'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Blink'
LayoutEngineVersion : '55.0'
LayoutEngineVersionMajor : '55'
LayoutEngineNameVersion : 'Blink 55.0'
LayoutEngineNameVersionMajor : 'Blink 55'
AgentClass : 'Browser'
AgentName : 'Chrome'
AgentVersion : '55.0.2883.91'
AgentVersionMajor : '55'
AgentNameVersion : 'Chrome 55.0.2883.91'
AgentNameVersionMajor : 'Chrome 55'

- test:
input:
user_agent_string: 'Mozilla/5.0 (Linux; Android 7.1.1; Pixel Build/NMF26U; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36'
expected:
DeviceClass : 'Phone'
DeviceName : 'Google Pixel'
DeviceBrand : 'Google'
OperatingSystemClass : 'Mobile'
OperatingSystemName : 'Android'
OperatingSystemVersion : '7.1.1'
OperatingSystemNameVersion : 'Android 7.1.1'
OperatingSystemVersionBuild : 'NMF26U'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Blink'
LayoutEngineVersion : '55.0'
LayoutEngineVersionMajor : '55'
LayoutEngineNameVersion : 'Blink 55.0'
LayoutEngineNameVersionMajor : 'Blink 55'
AgentClass : 'Browser Webview'
AgentName : 'Chrome Webview'
AgentVersion : '55.0.2883.91'
AgentVersionMajor : '55'
AgentNameVersion : 'Chrome Webview 55.0.2883.91'
AgentNameVersionMajor : 'Chrome Webview 55'
WebviewAppName : 'Unknown Webview App'
WebviewAppNameVersionMajor : 'Unknown Webview App ??'
WebviewAppVersion : '??'
WebviewAppVersionMajor : '??'

- test:
input:
user_agent_string: 'Mozilla/5.0 (Linux; Android 7.1.1; Pixel C Build/N4F26I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Safari/537.36'
expected:
DeviceClass : 'Tablet'
DeviceName : 'Google Pixel C'
DeviceBrand : 'Google'
OperatingSystemClass : 'Mobile'
OperatingSystemName : 'Android'
OperatingSystemVersion : '7.1.1'
OperatingSystemNameVersion : 'Android 7.1.1'
OperatingSystemVersionBuild : 'N4F26I'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Blink'
LayoutEngineVersion : '55.0'
LayoutEngineVersionMajor : '55'
LayoutEngineNameVersion : 'Blink 55.0'
LayoutEngineNameVersionMajor : 'Blink 55'
AgentClass : 'Browser'
AgentName : 'Chrome'
AgentVersion : '55.0.2883.91'
AgentVersionMajor : '55'
AgentNameVersion : 'Chrome 55.0.2883.91'
AgentNameVersionMajor : 'Chrome 55'

- test:
input:
user_agent_string: 'Mozilla/5.0 (Linux; Android 7.1.1; Pixel Build/NMF26U; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/111.0.0.18.69;]'
expected:
DeviceClass : 'Phone'
DeviceName : 'Google Pixel'
DeviceBrand : 'Google'
OperatingSystemClass : 'Mobile'
OperatingSystemName : 'Android'
OperatingSystemVersion : '7.1.1'
OperatingSystemNameVersion : 'Android 7.1.1'
OperatingSystemVersionBuild : 'NMF26U'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Blink'
LayoutEngineVersion : '55.0'
LayoutEngineVersionMajor : '55'
LayoutEngineNameVersion : 'Blink 55.0'
LayoutEngineNameVersionMajor : 'Blink 55'
AgentClass : 'Browser Webview'
AgentName : 'Chrome Webview'
AgentVersion : '55.0.2883.91'
AgentVersionMajor : '55'
AgentNameVersion : 'Chrome Webview 55.0.2883.91'
AgentNameVersionMajor : 'Chrome Webview 55'
WebviewAppName : 'Facebook App for Android'
WebviewAppNameVersionMajor : 'Facebook App for Android 111'
WebviewAppVersion : '111.0.0.18.69'
WebviewAppVersionMajor : '111'
83 changes: 83 additions & 0 deletions analyzer/src/main/resources/UserAgents/MobileBrands.yaml
Expand Up @@ -59,6 +59,7 @@ config:
"Azumi" : "Azumi"
"Lenovo" : "Lenovo"
"Nexus" : "Google"
"Pixel" : "Google"
"Panasonic" : "Panasonic"
"Philips" : "Philips"
"SonyEricsson" : "SonyEricsson"
Expand Down Expand Up @@ -3207,6 +3208,88 @@ config:
- 'DeviceBrand : 101:"Google"'


- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name="Build"^<{"Pixel"'
extract:
- 'DeviceBrand : 105:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[2]="Build"^<{"Pixel"'
extract:
- 'DeviceBrand : 105:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[3]="Build"^<{"Pixel"'
extract:
- 'DeviceBrand : 105:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[1]="Build"@{"Pixel"'
extract:
- 'DeviceBrand : 104:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[2]="Build"@{"Pixel"'
extract:
- 'DeviceBrand : 103:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[3]="Build"@{"Pixel"'
extract:
- 'DeviceBrand : 102:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[4]="Build"@{"Pixel"'
extract:
- 'DeviceBrand : 101:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.(1)comments.entry.product.name[5]="Build"@{"Pixel"'
extract:
- 'DeviceBrand : 100:"Google"'

- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
- 'agent.(1-2)product.name{"Pixel"'
extract:
- 'DeviceBrand : 110:"Google"'

- matcher:
require:
- 'agent.product.name{"Pixel"'
extract:
- 'DeviceBrand : 103:"Google"'

- matcher:
require:
- 'agent.(1-2)product.(1)comments.entry.product.name{"Pixel"'
extract:
- 'DeviceBrand : 102:"Google"'

- matcher:
require:
- 'agent.(1-2)product.(1)comments.entry.text{"Pixel"'
extract:
- 'DeviceBrand : 101:"Google"'


- matcher:
require:
- 'agent.(1-2)product.comments.entry.product.name="Android"'
Expand Down
Expand Up @@ -44,7 +44,10 @@ Avea|Avea
Avvio|Avvio
Azumi|Azumi
Lenovo|Lenovo

Nexus|Google
Pixel|Google

Panasonic|Panasonic
Philips|Philips
SonyEricsson|SonyEricsson
Expand Down

0 comments on commit 85c0c20

Please sign in to comment.