Skip to content

Commit

Permalink
Many improvements in Ubuntu and Gecko patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes committed Aug 4, 2018
1 parent b6d9323 commit 4b788c6
Show file tree
Hide file tree
Showing 10 changed files with 2,207 additions and 738 deletions.
10 changes: 5 additions & 5 deletions analyzer/src/main/resources/UserAgents/BrokenUseragents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,11 @@ config:
LayoutEngineNameVersionMajor : 'Gecko 1'
LayoutEngineBuild : '20090624'
AgentClass : 'Browser'
AgentName : 'Firefox'
AgentVersion : '3.5'
AgentVersionMajor : '3'
AgentNameVersion : 'Firefox 3.5'
AgentNameVersionMajor : 'Firefox 3'
AgentName : 'AskTb{TB_NAME}'
AgentVersion : '{TB_VERSION}'
AgentVersionMajor : '{TB'
AgentNameVersion : 'AskTb{TB_NAME} {TB_VERSION}'
AgentNameVersionMajor : 'AskTb{TB_NAME} {TB'
AgentLanguage : 'Arabic'
AgentLanguageCode : 'ar'
AgentSecurity : 'Strong security'
Expand Down
20 changes: 17 additions & 3 deletions analyzer/src/main/resources/UserAgents/GeckoFirefox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ config:
- 'AgentName : 2003:@Gecko.name[3]="Firefox"'
- 'AgentVersion : 2003:@Gecko.version'

- matcher:
variable:
- 'Browser: agent.(2-5)product.name="Gecko"^>'
require:
- 'agent.product.name="Firefox"' # Performance trick
- '@Browser>.name="Firefox"'
- 'IsNull[@Browser.name?OSPatterns]'
- 'IsNull[@Browser.name~"toolbar"]'
extract:
- 'AgentClass : 2005:"Browser"'
- 'AgentName : 2005:@Browser.name'
- 'AgentVersion : 2005:@Browser.version'


# In some obscure cases we have a parse problem that sends everything inside a comment block
- matcher:
extract:
Expand Down Expand Up @@ -568,9 +582,9 @@ config:
DeviceCpu : 'x86'
DeviceCpuBits : '32'
OperatingSystemClass : 'Desktop'
OperatingSystemName : 'Linux'
OperatingSystemVersion : 'x86'
OperatingSystemNameVersion : 'Linux x86'
OperatingSystemName : 'Ultimate Edition'
OperatingSystemVersion : '3.8'
OperatingSystemNameVersion : 'Ultimate Edition 3.8'
LayoutEngineClass : 'Browser'
LayoutEngineName : 'Gecko'
LayoutEngineVersion : '8.0'
Expand Down
45 changes: 29 additions & 16 deletions analyzer/src/main/resources/UserAgents/OSDeviceNames/Generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ echo "# limitations under the License."
echo "#"
echo "config:"

echo "- set:"
echo " name: 'OSPatterns'"
echo " values:"
fgrep -v '#' "${INPUT}" | grep . | sed 's/ *|/|/g;s/| */|/g' | while read line
do
ospattern=$(echo "${line}" | cut -d'|' -f1)
echo " - '${ospattern}'"
done
echo ""

fgrep -v '#' "${INPUT}" | grep . | sed 's/ *|/|/g;s/| */|/g' | while read line
do
ospattern=$(echo "${line}" | cut -d'|' -f1)
Expand All @@ -57,16 +67,19 @@ do
devbrand=$( echo "${line}" | cut -d'|' -f5)
osclass=$( echo "${line}" | cut -d'|' -f6)
echo "
- matcher:
require:
- 'agent.(1)product.(1)comments.entry.text=\"${ospattern}\"'
extract:
- 'DeviceClass : 111:\"${devclass}\"'
- 'DeviceName : 111:\"${devname}\"'
- 'DeviceBrand : 111:\"${devbrand}\"'
- 'OperatingSystemClass : 150:\"${osclass}\"'
- 'OperatingSystemName : 150:\"${osname}\"'
- 'OperatingSystemVersion: 149:\"??\"'
# =======================================================================
# ${ospattern}
#- matcher:
# require:
# - 'agent.(1)product.(1)comments.entry.text=\"${ospattern}\"'
# extract:
# - 'DeviceClass : 111:\"${devclass}\"'
# - 'DeviceName : 111:\"${devname}\"'
# - 'DeviceBrand : 111:\"${devbrand}\"'
# - 'OperatingSystemClass : 150:\"${osclass}\"'
# - 'OperatingSystemName : 150:\"${osname}\"'
# - 'OperatingSystemVersion: 149:\"??\"'
- matcher:
extract:
Expand Down Expand Up @@ -98,8 +111,8 @@ echo "
- 'DeviceClass : 111:\"${devclass}\"'
- 'DeviceName : 111:\"${devname}\"'
- 'DeviceBrand : 111:\"${devbrand}\"'
- 'OperatingSystemClass : 150:\"${osclass}\"'
- 'OperatingSystemName : 150:\"${osname}\"'
- 'OperatingSystemClass : 151:\"${osclass}\"'
- 'OperatingSystemName : 151:\"${osname}\"'
- 'OperatingSystemVersion: 149:\"??\"'
- matcher:
Expand Down Expand Up @@ -132,8 +145,8 @@ echo "
- 'DeviceClass : 111:\"${devclass}\"'
- 'DeviceName : 111:\"${devname}\"'
- 'DeviceBrand : 111:\"${devbrand}\"'
- 'OperatingSystemClass : 151:\"${osclass}\"'
- 'OperatingSystemName : 151:\"${osname}\"'
- 'OperatingSystemClass : 152:\"${osclass}\"'
- 'OperatingSystemName : 152:\"${osname}\"'
- 'OperatingSystemVersion: 149:\"??\"'
- matcher:
Expand All @@ -143,8 +156,8 @@ echo "
- 'DeviceClass : 112:\"${devclass}\"'
- 'DeviceName : 112:\"${devname}\"'
- 'DeviceBrand : 112:\"${devbrand}\"'
- 'OperatingSystemClass : 152:\"${osclass}\"'
- 'OperatingSystemName : 152:\"${osname}\"'
- 'OperatingSystemClass : 153:\"${osclass}\"'
- 'OperatingSystemName : 153:\"${osname}\"'
- 'OperatingSystemVersion: 149:\"??\"'
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ Mint | Linux Mint | Desktop | Linux Desktop |
Linux Mint | Linux Mint | Desktop | Linux Desktop | Unknown | Desktop
Edition Linux Mint | Linux Mint | Desktop | Linux Desktop | Unknown | Desktop
Moblin | Moblin | Desktop | Linux Desktop | Unknown | Desktop
Namoroka | Namoroka | Desktop | Linux Desktop | Unknown | Desktop
#Namoroka | Namoroka | Desktop | Linux Desktop | Unknown | Desktop
NaverBot | NaverBot | Desktop | Linux Desktop | Unknown | Desktop
PCLinuxOS | PCLinuxOS | Desktop | Linux Desktop | Unknown | Desktop
Slackware | Slackware | Desktop | Linux Desktop | Unknown | Desktop
SUSE | SUSE | Desktop | Linux Desktop | Unknown | Desktop
Ubuntu | Ubuntu | Desktop | Linux Desktop | Unknown | Desktop
Kubuntu | Kubuntu | Desktop | Linux Desktop | Unknown | Desktop
Xubuntu | Xubuntu | Desktop | Linux Desktop | Unknown | Desktop
Ultimate Edition | Ultimate Edition | Desktop | Linux Desktop | Unknown | Desktop
Yoper | Yoper | Desktop | Linux Desktop | Unknown | Desktop
SugarLabs | SugarLabs | Desktop | Linux Desktop | Unknown | Desktop
SunOS | SunOS | Desktop | SUN Microsystems Desktop | Sun Microsystems | Desktop
Expand Down

0 comments on commit 4b788c6

Please sign in to comment.