Skip to content

Commit

Permalink
Merge pull request #406 from penghui/master
Browse files Browse the repository at this point in the history
Add regex for Xiaomi MIX, MIX 2 and MIX 2S. And regex for Samsung device with chrome
  • Loading branch information
commenthol authored Jun 10, 2019
2 parents ed16923 + 5e100c3 commit 8b004ba
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3828,6 +3828,10 @@ device_parsers:
device_replacement: 'Samsung $1'
brand_replacement: 'Samsung'
model_replacement: '$1'
- regex: '; *((?:SCH|SGH|SHV|SHW|SPH|SC|SM)\-[A-Za-z0-9]{5})[\)]'
device_replacement: 'Samsung $1'
brand_replacement: 'Samsung'
model_replacement: '$1'

#########
# Sharp
Expand Down Expand Up @@ -4408,6 +4412,14 @@ device_parsers:
device_replacement: 'XiaoMi $1'
brand_replacement: 'XiaoMi'
model_replacement: '$1'
- regex: '; *(MIX) (Build|MIUI)/'
device_replacement: 'XiaoMi $1'
brand_replacement: 'XiaoMi'
model_replacement: '$1'
- regex: '; *((MIX) ([^;/]*)) (Build|MIUI)/'
device_replacement: 'XiaoMi $1'
brand_replacement: 'XiaoMi'
model_replacement: '$1'

#########
# Xolo
Expand Down
25 changes: 25 additions & 0 deletions tests/test_device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58135,6 +58135,16 @@ test_cases:
brand: 'Samsung'
model: 'GT-S8600-ORANGE'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36'
family: 'Samsung SM-G9500'
brand: 'Samsung'
model: 'SM-G9500'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-G9500 Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.3 Chrome/67.0.3396.87 Mobile Safari/537.36'
family: 'Samsung SM-G9500'
brand: 'Samsung'
model: 'SM-G9500'

- user_agent_string: 'UCWEB/2.0 (Symbian; U; S60 V5; Pt-BR; SamsungI8910) U2/1.0.0 UCBrowser/8.9.0.277 U2/1.0.0 Mobile'
family: 'Samsung I8910'
brand: 'Samsung'
Expand Down Expand Up @@ -77515,6 +77525,21 @@ test_cases:
brand: 'XiaoMi'
model: 'Redmi Note 2'

- user_agent_string: 'Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; MIX Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.1.1'
family: 'XiaoMi MIX'
brand: 'XiaoMi'
model: 'MIX'

- user_agent_string: 'Mozilla/5.0 (Linux; U; Android 9; MIX 2S Build/PKQ1.180729.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.7.3'
family: 'XiaoMi MIX 2S'
brand: 'XiaoMi'
model: 'MIX 2S'

- user_agent_string: 'Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; MIX 2 Build/OPR1.170623.027) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.1.1'
family: 'XiaoMi MIX 2'
brand: 'XiaoMi'
model: 'MIX 2'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 4.1.1; XOLO A1000 Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19'
family: 'Xolo A1000'
brand: 'Xolo'
Expand Down

0 comments on commit 8b004ba

Please sign in to comment.