Skip to content

Commit

Permalink
Bump default upstream database release to "6.4.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert committed Sep 11, 2024
1 parent ee022ea commit d3a6324
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 274 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v3.11.0-dev

- Enhancements
- Default upstream database version is now `6.4.0`
- Upstream improvements for ARM platform detection have been integrated
- Upstream improvements for Blink engine version detection have been integrated
- Upstream improvements for browser version detection have been integrated
Expand Down
2 changes: 1 addition & 1 deletion lib/ua_inspector/config.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule UAInspector.Config do
@remote_release "6.3.2"
@remote_release "6.4.0"

@moduledoc """
Module to simplify access to configuration values with default values.
Expand Down
9 changes: 4 additions & 5 deletions verify/lib/ua_inspector_verify/fixtures/generic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule UAInspectorVerify.Fixtures.Generic do
"clienthints.yml",
"console.yml",
"desktop.yml",
"desktop-1.yml",
"feature_phone.yml",
"feed_reader.yml",
"mediaplayer.yml",
Expand Down Expand Up @@ -66,6 +67,7 @@ defmodule UAInspectorVerify.Fixtures.Generic do
"smartphone-37.yml",
"smartphone-38.yml",
"smartphone-39.yml",
"smartphone-40.yml",
"tablet.yml",
"tablet-1.yml",
"tablet-2.yml",
Expand All @@ -82,16 +84,13 @@ defmodule UAInspectorVerify.Fixtures.Generic do
"tv-1.yml",
"tv-2.yml",
"tv-3.yml",
"tv-4.yml",
"unknown.yml",
"wearable.yml"
]

@fixtures_release %{
"master" => [
"desktop-1.yml",
"smartphone-40.yml",
"tv-4.yml"
]
"master" => []
}

def download do
Expand Down
90 changes: 0 additions & 90 deletions verify/lib/ua_inspector_verify/verify/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,96 +21,6 @@ defmodule UAInspectorVerify.Verify.Client do
true
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; Andr0id 11; TY55_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.56 Safari/537.36 OMI/4.24.3.23.StableAVB_Telly.1",
client: %{version: "4.24"} = client
} = testcase,
%{version: "4.24.3.23" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.128 Safari/537.36 SmartTV/10.0 Colt/2.0",
client: %{version: "94"} = client
} = testcase,
%{version: "94.0.4606.128" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.132 Safari/537.36",
client: %{version: "98"} = client
} = testcase,
%{version: "98.0.4758.132" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36",
client: %{version: "106"} = client
} = testcase,
%{version: "106.0.0.0" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
client: %{version: "111"} = client
} = testcase,
%{version: "111.0.0.0" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
client: %{version: "122"} = client
} = testcase,
%{version: "122.0.0.0" = remote_version} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(%{client: %{engine: _} = testcase}, result) do
testcase.name == result.name &&
testcase.type == result.type &&
Expand Down
161 changes: 0 additions & 161 deletions verify/lib/ua_inspector_verify/verify/generic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,167 +3,6 @@ defmodule UAInspectorVerify.Verify.Generic do
Verify a generic fixture against a result.
"""

@unknown_agents [
"Dalvik/2.1.0 (Linux; U; Android 8.1.0; Armor_3 Build/O11019)",
"Mozilla/5.0 (Linux; Android 10; Armadillo Phone) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.81 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 10 5G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 11 5G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.88 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 7E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor 9E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.86 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor X5 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.86 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor X7 Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.66 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor X7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.86 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 10; Armor X8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor 11T 5G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.62 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor 12 5G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.98 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor X10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor X8i) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor X9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.87 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Armor X9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 11; Power Armor 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Armor 12S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Armor 15) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Armor 17 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Armor 20WT) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Armor X6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Power Armor 16 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Power Armor 18T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Power Armor 19) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Power Armor 19T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.192 Mobile Safari/537.36 OPR/74.3.3922.71982",
"Mozilla/5.0 (Linux; Android 12; Power Armor X11 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 12; Power Armor14 Pro Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/101.0.4951.61 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 13; Armor 24) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 13; Armor X12 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 13; Armor X13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 13; Armor_C1w Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.123 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 4.4.4; SANTIN #Armor) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 5.1.1; SANTIN Armor 2 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 6.0; Armor Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 7.0; Armor_2 Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/147.0.0.44.75;]",
"Mozilla/5.0 (Linux; Android 7.0; Armor_2S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36",
"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",
"Mozilla/5.0 (Linux; Android 8.1.0; Armor_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.1.0; Armor_X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.1.0; Armor_X2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor 5S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor X5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor_3W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor_3WT) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor_6E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor_6S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36",
"mozilla/5.0 (linux; android 9; armor_7) applewebkit/537.36 (khtml, like gecko) chrome/83.0.4103.106 mobile safari/537.36",
"Mozilla/5.0 (Linux; Android 9; Armor_X3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36",
"mozilla/5.0 (linux; android 9; armor_x6) applewebkit/537.36 (khtml, like gecko) chrome/83.0.4103.106 mobile safari/537.36",
"Mozilla/5.0 (Linux; U; Android 11; ru; Power Armor 13 Build/RP1A.200720.011) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.10.0.1163 UCTurbo/1.10.3.900 Mobile Safari/537.36"
]

def verify(
%{user_agent: user_agent, os: %{platform: "ARM"} = os} = testcase,
%{os: %{platform: :unknown}} = result
)
when user_agent in @unknown_agents do
# detected as "ARM" in default remote release
# detected as "unknown" in upcoming remote release
verify(
%{testcase | os: %{os | platform: :unknown}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; Android 8.1.0; ZC554KL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36 OPR/67.1.3508.63168",
client: %{version: "96.0.4664.104"} = client
} = testcase,
%{client: %{version: "67.1.3508.63168" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 OPR/84.0.4316.19",
client: %{version: "98.0.4758.82"} = client
} = testcase,
%{client: %{version: "84.0.4316.19" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 OPR/84.0.4316.21",
client: %{version: "98.0.4758.102"} = client
} = testcase,
%{client: %{version: "84.0.4316.21" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36",
client: %{version: "106"} = client
} = testcase,
%{client: %{version: "106.0.0.0" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.128 Safari/537.36 SmartTV/10.0 Colt/2.0",
client: %{version: "94"} = client
} = testcase,
%{client: %{version: "94.0.4606.128" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(
%{
user_agent:
"Mozilla/5.0 (Linux; Andr0id 11; TY55_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.56 Safari/537.36 OMI/4.24.3.23.StableAVB_Telly.1",
client: %{version: "4.24"} = client
} = testcase,
%{client: %{version: "4.24.3.23" = remote_version}} = result
) do
# improved version detection in upcoming remote release
verify(
%{testcase | client: %{client | version: remote_version}},
result
)
end

def verify(%{client: _} = testcase, %{client: _} = result) do
# regular user agent
testcase.user_agent == result.user_agent &&
Expand Down
17 changes: 0 additions & 17 deletions verify/lib/ua_inspector_verify/verify/os.ex
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
defmodule UAInspectorVerify.Verify.OS do
@moduledoc false

@unknown_agents [
"Mozilla/5.0 (Linux; Android 10; Armadillo Phone) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.81 Mobile Safari/537.36"
]

def verify(
%{user_agent: user_agent, os: %{platform: "ARM"} = os} = testcase,
%{platform: :unknown} = result
)
when user_agent in @unknown_agents do
# detected as "ARM" in default remote release
# detected as "unknown" in upcoming remote release
verify(
%{testcase | os: %{os | platform: :unknown}},
result
)
end

def verify(%{os: testcase}, result) do
testcase.name == result.name &&
testcase.platform == result.platform &&
Expand Down

0 comments on commit d3a6324

Please sign in to comment.