From c2addd8492099c2094f5df8d61086fb7c05ee42c Mon Sep 17 00:00:00 2001 From: sanchezzzhak Date: Thu, 29 Jun 2023 17:19:20 +0300 Subject: [PATCH] fix: htc detect models feat: added tests for detect brand htc: Desire 10 Pro, Desire 20 Pro, Desire 21 Pro 5G, Desire 22 Pro, Desire 628 Dual SIM, Desire 630 Dual SIM, Desire 728 Dual SIM, Desire 728G Dual SIM, Desire 828 Dual SIM, Desire 830 Dual SIM ref: 7139 #issuecomment-1613190577 --- Tests/fixtures/smartphone-36.yml | 160 +++++++++++++++++++++++++++++++ regexes/device/mobiles.yml | 26 ++--- 2 files changed, 173 insertions(+), 13 deletions(-) diff --git a/Tests/fixtures/smartphone-36.yml b/Tests/fixtures/smartphone-36.yml index 83257380b1..236a01355e 100644 --- a/Tests/fixtures/smartphone-36.yml +++ b/Tests/fixtures/smartphone-36.yml @@ -6538,3 +6538,163 @@ model: Edge Plus (2022) os_family: Android browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 6.0; HTC Desire 10 pro Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/104.0.5112.97 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (23/6.0; 480dpi; 1080x1920; HTC/htc; HTC Desire 10 pro; htc_a56dj_pro_dugl; mt6755; en_US; 471827231) + os: + name: Android + version: "6.0" + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 10 Pro + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 10; HTC Desire 20 Pro Build/QQ1A.200205.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.70 Mobile Safari/537.36 Instagram 281.0.0.19.105 Android (29/10; 400dpi; 1080x2124; HTC; HTC Desire 20 Pro; htc_bymdugl; qcom; de_DE; 470774573) + os: + name: Android + version: "10" + platform: "" + client: + type: mobile app + name: Instagram App + version: 281.0.0.19.105 + device: + type: smartphone + brand: HTC + model: Desire 20 Pro + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 10; HTC Desire 21 pro 5G Build/QKQ1.200927.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.135 Mobile Safari/537.36 Instagram 285.0.0.25.62 Android (29/10; 340dpi; 1080x2204; HTC; HTC Desire 21 pro 5G; htc_thudugl; qcom; pl_PL; 479968475) + os: + name: Android + version: "10" + platform: "" + client: + type: mobile app + name: Instagram App + version: 285.0.0.25.62 + device: + type: smartphone + brand: HTC + model: Desire 21 Pro 5G + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 12; HTC Desire 22 pro Build/SKQ1.220201.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/105.0.5195.136 Mobile Safari/537.36 Instagram 267.0.0.18.93 Android (31/12; 480dpi; 1080x2132; HTC; HTC Desire 22 pro; htc_botdugls; qcom; de_DE; 440638617) + os: + name: Android + version: "12" + platform: "" + client: + type: mobile app + name: Instagram App + version: 267.0.0.18.93 + device: + type: smartphone + brand: HTC + model: Desire 22 Pro + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 628 dual sim Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (22/5.1; 320dpi; 720x1184; HTC/htc; HTC Desire 628 dual sim; htc_v36bml_dugl; mt6735; ar_EG; 471827227) + os: + name: Android + version: "5.1" + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 628 Dual SIM + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 6.0.1; HTC Desire 630 dual sim Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.71 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (23/6.0.1; 320dpi; 720x1184; HTC/htc; HTC Desire 630 dual sim; htc_a16dwgl; qcom; fa_IR; 471827227) + os: + name: Android + version: 6.0.1 + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 630 Dual SIM + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 728 dual sim Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (22/5.1; 320dpi; 720x1184; HTC/htc; HTC Desire 728 dual sim; htc_a50cml_dtul; mt6735; ar_EG; 471827227) + os: + name: Android + version: "5.1" + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 728 Dual SIM + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 728G dual sim Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (22/5.1; 320dpi; 720x1184; HTC/htc; HTC Desire 728G dual sim; htc_a50cmg_dwg; mt6735; tr_TR; 471827227) + os: + name: Android + version: "5.1" + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 728G Dual SIM + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 828 dual sim Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 Instagram 198.0.0.32.120 Android (22/5.1; 480dpi; 1080x1776; HTC/htc; HTC Desire 828 dual sim; htc_a51bml_dwgl; mt6735; ar_SA; 307053300) + os: + name: Android + version: "5.1" + platform: "" + client: + type: mobile app + name: Instagram App + version: 198.0.0.32.120 + device: + type: smartphone + brand: HTC + model: Desire 828 Dual SIM + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 5.1; HTC Desire 830 dual sim Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.166 Mobile Safari/537.36 Instagram 278.0.0.22.117 Android (22/5.1; 480dpi; 1080x1776; HTC/htc; HTC Desire 830 dual sim; htc_a51cml_dtul; mt6735; en_US; 471827237) + os: + name: Android + version: "5.1" + platform: "" + client: + type: mobile app + name: Instagram App + version: 278.0.0.22.117 + device: + type: smartphone + brand: HTC + model: Desire 830 Dual SIM + os_family: Android + browser_family: Unknown diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml index 86b7737891..d5a375bf8d 100644 --- a/regexes/device/mobiles.yml +++ b/regexes/device/mobiles.yml @@ -278,7 +278,7 @@ HTC: model: 'One M9' - regex: 'One[ _](X9|[EM]8) dual sim(?:[);/ ]|$)' model: 'One $1 Dual SIM' - - regex: 'Desire[ _](.+) dual sim(?:[);/ ]|$)' + - regex: 'Desire[ _]([\d\w]+) dual sim(?:[);/ ]|$)' model: 'Desire $1 Dual SIM' - regex: 'HTC(?: One m7|6500LVW|PN071)(?:[);/ ]|$)' model: 'One M7' @@ -356,9 +356,9 @@ HTC: model: 'Desire 10 Pro' - regex: 'HTC[ _](?:10[ _]evo|M10f)(?:[);/ ]|$)' model: '10 Evo' - - regex: 'HTC Desire (.+) pro 5G(?:[);/ ]|$)' + - regex: 'HTC Desire (\d+) pro 5G(?:[);/ ]|$)' model: 'Desire $1 Pro 5G' - - regex: 'HTC Desire (.+) pro(?:[);/ ]|$)' + - regex: 'HTC Desire (\d+) pro(?:[);/ ]|$)' model: 'Desire $1 Pro' - regex: 'Desire 10 lifestyle(?:[);/ ]|$)' model: 'Desire 10 Life Style' @@ -380,12 +380,6 @@ HTC: - regex: 'HTC(?:[ _-])?(?:One[ _\-]max|6600LVW|0P3P7)(?:[);/ ]|$)' device: 'phablet' model: 'One Max' - - regex: 'HTC[ _]([^/;]+) [0-9]+(?:\.[0-9]+)+ Build' - model: '$1' - - regex: 'HTC[ _]([^/;]+) Build' - model: '$1' - - regex: 'HTC[ _]([a-z0-9]+[ _\-]?(?:[a-z0-9_+\-])*)' - model: '$1' - regex: 'USCCHTC(\d+)' model: '$1' - regex: 'Sprint (ATP.*) Build' @@ -393,13 +387,19 @@ HTC: model: '$1 (Sprint)' - regex: 'Sprint (APA.*) Build' model: '$1 (Sprint)' - - regex: '(?:HTC-)?HTC(?:[\-/ ])?([a-z0-9\-_]+)' + - regex: 'Wildfire (E2?) plus' + model: 'Wildfire $1 Plus' + - regex: 'HTC[ _]([^/;]+) [0-9]+(?:\.[0-9]+)+ Build' + model: '$1' + - regex: 'HTC[ _]([^/;]+) Build' + model: '$1' + - regex: 'HTC[ _]([a-z0-9]+[ _\-]?(?:[a-z0-9_+\-])*)' + model: '$1' + - regex: '(?:HTC-)?HTC(?:[-/ ])?([a-z0-9\-_]+)' model: '$1' - regex: 'HTC;(?: )?([a-z0-9 ]+)' model: '$1' - - regex: 'Wildfire (E2?) plus' - model: 'Wildfire $1 Plus' - - regex: '(Desire|Sensation|Evo ?3D|IncredibleS|Wildfire|Butterfly)[ _]?([^;/)]+)(?: Build|\))' + - regex: '(Desire|Sensation|Evo ?3D|IncredibleS|Wildfire|Butterfly)[ _]?([^;/)]+)(?: Build|[);])' model: '$1 $2' - regex: '(Amaze[ _]4G|One ?[XELSV\+]*) Build' model: '$1'