Skip to content

Commit

Permalink
Improves detection for ARM platform (#7731)
Browse files Browse the repository at this point in the history
* Remove ARM platform name
ref #7729
  • Loading branch information
liviuconcioiu committed Jul 5, 2024
1 parent 125b643 commit aef8813
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ protected function parsePlatform(): string
}
}

if ($this->matchUserAgent('arm|.*arm64|aarch64|Apple ?TV|Watch ?OS|Watch1,[12]')) {
if ($this->matchUserAgent('arm[ _;)ev]|.*arm$|.*arm64|aarch64|Apple ?TV|Watch ?OS|Watch1,[12]')) {
return 'ARM';
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4296,7 +4296,7 @@
name: Armadillo OS
short_name: ARM
version: ""
platform: ARM
platform: ""
family: Android
-
user_agent: Mozilla/5.0 (Linux; Android 10; Helix Phone) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/mobile_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@
os_family: Android
browser_family: Unknown
-
user_agent: Mozilla/5.0 (Linux; Android 8.0.0; SM-G930W8 Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/102.0.5005.125 Mobile Safari/537.36 GoogleApp/13.22.15.26.arm6
user_agent: Mozilla/5.0 (Linux; Android 8.0.0; SM-G930W8 Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/102.0.5005.125 Mobile Safari/537.36 GoogleApp/13.22.15.26.arm64
os:
name: Android
version: 8.0.0
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8624,7 +8624,7 @@
os:
name: Android
version: 4.4.4
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
24 changes: 12 additions & 12 deletions Tests/fixtures/smartphone-15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4105,7 +4105,7 @@
os:
name: Android
version: "6.0"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4123,7 +4123,7 @@
os:
name: Android
version: "7.0"
platform: ARM
platform: ""
client:
type: mobile app
name: Facebook
Expand All @@ -4139,7 +4139,7 @@
os:
name: Android
version: 8.1.0
platform: ARM
platform: ""
client:
type: browser
name: Android Browser
Expand All @@ -4157,7 +4157,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4175,7 +4175,7 @@
os:
name: Android
version: 8.1.0
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4193,7 +4193,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4211,7 +4211,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4229,7 +4229,7 @@
os:
name: Android
version: 8.1.0
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4247,7 +4247,7 @@
os:
name: Android
version: 8.1.0
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4265,7 +4265,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4283,7 +4283,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -4301,7 +4301,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
6 changes: 3 additions & 3 deletions Tests/fixtures/smartphone-17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -6642,7 +6642,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -6660,7 +6660,7 @@
os:
name: Android
version: "9"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3298,7 +3298,7 @@
os:
name: Android
version: "7.0"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
16 changes: 8 additions & 8 deletions Tests/fixtures/smartphone-20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1740,7 +1740,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1758,7 +1758,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1776,7 +1776,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1794,7 +1794,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1812,7 +1812,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Webview
Expand All @@ -1830,7 +1830,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -1848,7 +1848,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8246,7 +8246,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8840,7 +8840,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -8858,7 +8858,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
6 changes: 3 additions & 3 deletions Tests/fixtures/smartphone-26.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6418,7 +6418,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -6436,7 +6436,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -6760,7 +6760,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: UC Browser Turbo
Expand Down
8 changes: 4 additions & 4 deletions Tests/fixtures/smartphone-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4894,7 +4894,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -5020,7 +5020,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -9156,7 +9156,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand All @@ -9174,7 +9174,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9254,7 +9254,7 @@
os:
name: Android
version: "10"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-30.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@
os:
name: Android
version: "11"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -5580,7 +5580,7 @@
os:
name: Android
version: "12"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Webview
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-33.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
os:
name: Android
version: "12"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down Expand Up @@ -9140,7 +9140,7 @@
os:
name: Android
version: "12"
platform: ARM
platform: ""
client:
type: browser
name: Chrome Mobile
Expand Down
Loading

0 comments on commit aef8813

Please sign in to comment.