From 5e03d3cd4926fd68f11680331f13371712c6ef84 Mon Sep 17 00:00:00 2001 From: lihuanshuai Date: Fri, 28 Jul 2017 14:17:56 +0800 Subject: [PATCH] fixed some case on gionee device --- regexes.yaml | 7 ++++++- tests/test_device.yaml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/regexes.yaml b/regexes.yaml index 3beb6fbd..2e204704 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -311,7 +311,7 @@ user_agent_parsers: # Slack desktop client (needs to be before Apple Mail, Electron, and Chrome as it gets wrongly detected on Mac OS otherwise) - regex: '(Slack_SSB)/(\d+)\.(\d+)\.(\d+)' family_replacement: 'Slack Desktop Client' - + # HipChat provides a version on Mac, but not on Windows. # Needs to be before Chrome on Windows, and AppleMail on Mac. - regex: '(HipChat)/?(\d+)?' @@ -1991,6 +1991,11 @@ device_parsers: device_replacement: 'Gionee $1' brand_replacement: 'Gionee' model_replacement: '$1' + - regex: '\sGIONEE[-\s_](\w*)' + regex_flag: 'i' + device_replacement: 'Gionee $1' + brand_replacement: 'Gionee' + model_replacement: '$1' ######### # GoClever diff --git a/tests/test_device.yaml b/tests/test_device.yaml index b3572d4d..b93f7314 100644 --- a/tests/test_device.yaml +++ b/tests/test_device.yaml @@ -79995,3 +79995,7 @@ test_cases: brand: 'Nokia' model: 'Lumia 920' + - user_agent_string: 'Mozilla/5.0 (Linux; U; Android 5.1; zh-cn; Build/LMY47D ) AppleWebKit/534.30 (KHTML,like Gecko) Version/5.1 Mobile Safari/534.30 GIONEE-GN3003/GN3003 RV/5.0.16 GNBR/5.1.0.cg Id/8D83E4532006ACCE31D712F4F73C8C70' + family: 'Gionee GN3003' + brand: 'Gionee' + model: 'GN3003'