Skip to content

Incorrect Device Parsing for Nexus 5X in User-Agent Strings #132

Open
@IvanKorshunovE

Description

@IvanKorshunovE

The DeviceParser incorrectly parses certain user-agent strings, resulting in wrong values for the family, brand, and model fields.

Example of the Issue:
User-Agent String:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko) Chrome/51.0.2702.81 Mobile Safari/537.36

Current Output:

{
  "family": "Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko",
  "brand": "Generic_Android",
  "model": "Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko"
}

Expected Output (not sure that it should be exactly like this):

{
  "family": "Nexus",
  "brand": "Generic_Android",
  "model": "Nexus 5x"
}

Steps to Reproduce:

  1. Provide the above user-agent string to the DeviceParser.

Perhaps this instance of DeviceParser is responsible for this:

DeviceParser(
    'Android \\d+?(?:\\.\\d+|)(?:\\.\\d+|); ([^;]+?)(?: Build|\\))',
    None,
    None,
    'Generic_Android',
    '$1',
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions