Skip to content

Commit

Permalink
品牌识别优化
Browse files Browse the repository at this point in the history
  • Loading branch information
heeroluo committed Jan 22, 2025
1 parent b40f270 commit d5755b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ console.dir(detector.client.exec(USER_AGENT));
- 优化 Realme 平板设备的识别规则。
- 优化三星设备的识别规则。
- 优化天语设备的识别规则。
- 优化中兴设备的识别规则。
- 新增「小课屏」品牌的识别。
- 优化识别结果名称:「HeyTap浏览器」 -> 「HeyTap 浏览器」。

### v2.3.0
Expand Down
4 changes: 4 additions & 0 deletions rules/device-brand.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ exports.otherRules = [
{ name: 'TCL', keywords: ['tcl'] },
{ name: '中兴', keywords: ['zte'] },
{ name: '传音', keywords: ['infinix', 'tecno'] },
{ name: '小课屏', keywords: ['funbook'] },
{ name: '比亚迪', keywords: ['byd auto'] },

// 特定型号
{ name: '华为', modelRegExp: /^H60-L0[12]$/ },
{ name: '魅族', keywords: ['M3 Max', 'm1 metal'] },
{ name: '魅族', modelRegExp: 'M040' },
{ name: 'OPPO', modelRegExp: /^R7(?:Plust|s?Plus|Plusm|sf|t|c)/ },
{ name: '小课屏', keywords: ['A127CS'] },
{ name: '小课屏', modelRegExp: /^21A[89]00$/ },

// 品牌型号规则
{ name: '华为', modelRegExp: /^Mate\s*\d{2}/i },
Expand Down Expand Up @@ -118,6 +121,7 @@ exports.otherRules = [
{ name: '海信', modelRegExp: /^H(?:ITV|LTEM?|NR)\d+/ },
{ name: '小度', modelRegExp: /^(?:XD|XDH)-/ },
{ name: '中兴', modelRegExp: /^NX\d{2,}[A-Z]?(\b|_)/ },
{ name: '中兴', modelRegExp: /^W20\dDS$/ },
{ name: '美图', modelRegExp: /^MP\d+$/ },
{ name: '锤子', modelRegExp: /^(SM|YQ|OS|OD|OE|OC|DE)\d{3}$/ },
{ name: '锤子', modelRegExp: /^DT\d{4}[A-Z]$/ },
Expand Down

0 comments on commit d5755b6

Please sign in to comment.