Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sharp devices(SH-L02) misjudged as Huawei devices #625

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@
], [MODEL, [VENDOR, APPLE]], [

// Huawei
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
/\b((?:ag[rs][23]?|bah2?|sht|btv)-a?[lw]\d{2})\b/i
], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [
/(?:huawei|honor)([-\w ]+)[;\)]/i,
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
/\b(nexus 6p|(BKK|DRA|WAS|SNE|ART|AMN|JKM|MRD|JSN|LDN|YAL|VOG|ELE|CLT|EML|ANE|LYA|TET|TAH)e?-[atu]?[ln][\dx][012359c][adn]?)\b/i
], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [

// Xiaomi
Expand Down
2 changes: 1 addition & 1 deletion test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@
},
{
"desc": "Sharp Aquos L2",
"ua": "Mozilla/5.0 (Linux; Android 7.0; SH-L02 Build/S4045) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
"ua": "Mozilla/5.0 (Linux; Android 7.0; SH-L02) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
"expect": {
"vendor": "Sharp",
"model": "SH-L02",
Expand Down