Skip to content

Commit 386d49c

Browse files
committed
Update Mobile
1 parent 63b928d commit 386d49c

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

  • src/Analyser/Header/Useragent/Device

src/Analyser/Header/Useragent/Device/Mobile.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ class Mobile {
120120
return;
121121
}
122122
if ((match = /(?:SAMSUNG; )?SAMSUNG ?[-\/]?([^;\/\)_,]+)/iu.exec(ua))) {
123+
if (match[1] === 'Browser') {
124+
return;
125+
}
123126
this.data.device.manufacturer = 'Samsung';
124127
this.data.device.model = DeviceModels.cleanup(match[1]);
125128
this.data.device.identifier = match[0];
@@ -208,7 +211,7 @@ class Mobile {
208211
return;
209212
}
210213
if (
211-
!/(T-Mobile|Danger|HPiPAQ|Acer|Amoi|AIRNESS|ASUS|BenQ|maui|ALCATEL|Bird|COOLPAD|CELKON|Coship|Cricket|DESAY|Diamond|dopod|Ericsson|FLY|GIONEE|Haier|HIKe|Hisense|HS|HTC|T[0-9]{4,4}|HUAWEI|Karbonn|KWC|KONKA|KTOUCH|K-Touch|Lenovo|Lephone|LG|Micromax|MOT|Nexian|NEC|NGM|OPPO|Panasonic|Pantech|Philips|Sagem|Sanyo|Sam|SEC|SGH|SCH|SIE|Sony|SE|SHARP|Spice|Tecno|T-smart|TCL|Tiphone|Toshiba|UTStar|Videocon|vk|Vodafone|Xiaomi|ZTE|WAP)/iu.test(
214+
!/(T-Mobile|Danger|HPiPAQ|Acer|Amoi|AIRNESS|ASUS|BenQ|maui|ALCATEL|Bird|COOLPAD|CELKON|Coship|Cricket|DESAY|Diamond|dopod|Ericsson|FLY|GIONEE|GT-|Haier|HIKe|Hisense|HS|HTC|T[0-9]{4,4}|HUAWEI|Karbonn|KWC|KONKA|KTOUCH|K-Touch|Lenovo|Lephone|LG|Micromax|MOT|Nexian|NEC|NGM|OPPO|Panasonic|Pantech|Philips|Sagem|Sanyo|Sam|SEC|SGH|SCH|SIE|Sony|SE|SHARP|Spice|Tecno|T-smart|TCL|Tiphone|Toshiba|UTStar|Videocon|vk|Vodafone|VSUN|Wynncom|Xiaomi|YUANDA|Zen|Ziox|ZTE|WAP)/iu.test(
212215
ua
213216
)
214217
) {
@@ -405,7 +408,7 @@ class Mobile {
405408
manufacturer: 'Motorola',
406409
model: (model) => model.toUpperCase(),
407410
});
408-
this.data.device.identifyModel(/Motorola[_ ]([^\/_;]+)/iu, ua, {
411+
this.data.device.identifyModel(/Motorola[_ ]([^\/_;\)]+)/iu, ua, {
409412
type: Constants.deviceType.MOBILE,
410413
manufacturer: 'Motorola',
411414
});
@@ -556,17 +559,33 @@ class Mobile {
556559
type: Constants.deviceType.MOBILE,
557560
manufacturer: 'Videocon',
558561
});
559-
this.data.device.identifyModel(/Vodafone(?:[ _-]Chat)?[ _-]?([0-9]+)/u, ua, {
562+
this.data.device.identifyModel(/Vodafone(?:[ _-]Chat)?[ _-]?([0-9]+)/iu, ua, {
560563
type: Constants.deviceType.MOBILE,
561564
manufacturer: 'Vodafone',
562565
});
563566
this.data.device.identifyModel(/Vodafone\/[0-9.]+\/(v[0-9]+)[^\/]*\//u, ua, {
564567
type: Constants.deviceType.MOBILE,
565568
manufacturer: 'Vodafone',
566569
});
567-
this.data.device.identifyModel(/Xiaomi[_]?([^\s]+)/iu, ua, {
570+
this.data.device.identifyModel(/^VSUN([0-9]+[A-Z]?)/iu, ua, {
571+
type: Constants.deviceType.MOBILE,
572+
manufacturer: 'Vsun',
573+
});
574+
this.data.device.identifyModel(/Wynncom[\-\s]([A-Z0-9\s]+\+?)/iu, ua, {
575+
type: Constants.deviceType.MOBILE,
576+
manufacturer: 'Wynncom',
577+
});
578+
this.data.device.identifyModel(/^YUANDA([0-9]+[A-Z]?)/iu, ua, {
579+
type: Constants.deviceType.MOBILE,
580+
manufacturer: 'Yuanda',
581+
});
582+
this.data.device.identifyModel(/^ZEN[_\s]([A-Z0-9\s\+]+)\*?[\s_]?(|\/|-|;|Dorado|MAUI|WAP|R2AE|Q03C)/iu, ua, {
583+
type: Constants.deviceType.MOBILE,
584+
manufacturer: 'Zen',
585+
});
586+
this.data.device.identifyModel(/^(?:Ziox[_\s])?Ziox[_\s](ZX?[0-9]+)/iu, ua, {
568587
type: Constants.deviceType.MOBILE,
569-
manufacturer: 'Xiaomi',
588+
manufacturer: 'Ziox',
570589
});
571590
this.data.device.identifyModel(/ZTE[-_\s]?([^\s\/();,]+)/iu, ua, {
572591
type: Constants.deviceType.MOBILE,

0 commit comments

Comments
 (0)