Skip to content

Commit

Permalink
improved detection of Xiaomi devices
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jun 23, 2015
1 parent 37ee3b9 commit 436c261
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
72 changes: 72 additions & 0 deletions Tests/fixtures/smartphone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28764,6 +28764,24 @@
model: Hongmi
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; 2014011 Build/HM2014011) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30; 360 Aphone Browser (6.9.0)
os:
name: Android
short_name: AND
version: "4.2.2"
client:
type: browser
name: 360 Phone Browser
short_name: 36
version: "6.9.0"
engine: WebKit
device:
type: smartphone
brand: XI
model: Hongmi 1S
os_family: Android
browser_family: Unknown
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; 2014011 Build/HM2014011) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1
os:
Expand All @@ -28782,6 +28800,42 @@
model: Hongmi 1S
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.4.4; it-it; 2014811 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1
os:
name: Android
short_name: AND
version: "4.4.4"
client:
type: browser
name: MIUI Browser
short_name: MU
version: "2.1.1"
engine: WebKit
device:
type: smartphone
brand: XI
model: Hongmi 2 4G
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.4.4; it-it; 2014813 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1
os:
name: Android
short_name: AND
version: "4.4.4"
client:
type: browser
name: MIUI Browser
short_name: MU
version: "2.1.1"
engine: WebKit
device:
type: smartphone
brand: XI
model: Hongmi 2 4G
os_family: Android
browser_family: Android Browser
-
user_agent: Xiaomi_2014501_TD-LTE/V1 Linux/3.10.0 Android/4.4 Release/04.07.2014 Browser/AppleWebKit537.36 Chrome/30.0.0.0 Mobile Safari/537.36 System/Android 4.4 XiaoMi/MiuiBrowser/1.0
os:
Expand Down Expand Up @@ -28818,6 +28872,24 @@
model: Hongmi 4G
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.4.2; zh-CN; 2014501 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/10.2.0.535 U3/0.8.0 Mobile Safari/534.30
os:
name: Android
short_name: AND
version: "4.4.2"
client:
type: browser
name: UC Browser
short_name: UC
version: "10.2.0.535"
engine: WebKit
device:
type: smartphone
brand: XI
model: Hongmi 4G
os_family: Android
browser_family: Unknown
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.0.4; zh-tw; MI 1S Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
os:
Expand Down
4 changes: 3 additions & 1 deletion regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3064,14 +3064,16 @@ Woxter:

#Xiaomi
Xiaomi:
regex: 'Xiaomi|(MI [a-z0-9]+|MI-One[ _]Plus) Build|HM ([^/;]+) Build'
regex: 'Xiaomi|(MI [a-z0-9]+|MI-One[ _]Plus) Build|HM ([^/;]+) Build|(2014501|2014011|201481[13]|201302[23]|2013061) Build'
device: 'smartphone'
models:
# specific smartphone models
- regex: 'Xiaomi_2014501|2014501 Build'
model: 'Hongmi 4G'
- regex: 'Xiaomi_2014011|2014011 Build'
model: 'Hongmi 1S'
- regex: 'Xiaomi_201481[13]|201481[13] Build'
model: 'Hongmi 2 4G'
- regex: 'Xiaomi_201302[23]|201302[23] Build'
model: 'Hongmi'
- regex: 'Xiaomi_2013061|2013061 Build'
Expand Down

0 comments on commit 436c261

Please sign in to comment.