Skip to content

Commit

Permalink
Detect BQ, Alcatel, Arian Space, Motorola, LG, Polytron (#5987)
Browse files Browse the repository at this point in the history
* Detect BQ-6040L Magic

* Detect Alcatel 1S

* Fix Huawei & create test check regex two  chars
BQ common regex optimized
Detect BQ-5300G - Velvet View

* Detect BQ devices part 1

* Detect BQ devices part 2

* Detect BQ devices part 3

* Detect Arian Space devices

* Detect Infinix Hot 6 & Hot 6 Pro

* Detect Digma, Beeline, BQ

* #5974 Detect Advan S5E NXT

* #5974 Detect Maze SSB-500

* #5974 Detect True devices

* #5974 Detect Polytron Roket

* Detect Politron devices part 1

* Detect Politron devices part 2

* Detect Politron devices part 3

* Detect Motorola Moto X2

* Detect LG V50

* Detect LG Aristo 3

* PR fix remove space

* Detect LG Q9

* Detect LG G8 old versions (Canada prefix QM7, Korea N, Sprint AT&T, Verizon, US Unlock)

* Fix: LG Q Stylus Plus &  Detect LG Q7+, LG Q8+

* Detect Verizon devices

* Detect Samsung Galaxy A10 SM-A105F

* Fix detect Ulefone_X AppleWebKit

* Ulefon fix S1 Pro, S7

* Digi k1, samsung tab a 2019, fix common x-tigi regular

* Detect Assistant & fix Wileyfox

* Detect Ginzzu devices

* Detect Bravis: B501, NP104 3G, NP101, NP107, NB871, NB76, NM106M, NM108, NM851; Ergo: B504 Unit

* Bq devices: BQ-1050L, BQ-1081G, BG-5520, BQ-5060, BQ-5045, BQ-5070, BQ-5025, BQ-7083, BQ-5503, BQ-5201, BQ-5054, BQ-5044, BQ-5022, BQ-4028

* test-file add help used

* fix maze common regex

* PR fix brand shorcode replace to 2 letter

* PR fix LM-Q710.FG

* PR FIX Digi

* PR fix LM-Q710FGN set dot optional

* PR fix Bravis NB106M

* PR fix Digi_K1
  • Loading branch information
sanchezzzhak authored and sgiehl committed Jul 22, 2019
1 parent 648537d commit 46ac92c
Show file tree
Hide file tree
Showing 5 changed files with 5,397 additions and 58 deletions.
9 changes: 8 additions & 1 deletion Parser/Device/DeviceParserAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ abstract class DeviceParserAbstract extends ParserAbstract
'AP' => 'Apple',
'AR' => 'Archos',
'AS' => 'ARRIS',
'AB' => 'Arian Space',
'AT' => 'Airties',
'A6' => 'Ark',
'A4' => 'Ask',
'A8' => 'Assistant',
'A0' => 'ANS',
'AU' => 'Asus',
'AH' => 'AVH',
Expand Down Expand Up @@ -212,6 +214,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'GI' => 'Gionee',
'GG' => 'Gigabyte',
'GS' => 'Gigaset',
'GZ' => 'Ginzzu',
'GC' => 'GOCLEVER',
'GL' => 'Goly',
'GO' => 'Google',
Expand Down Expand Up @@ -311,6 +314,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'MJ' => 'Majestic',
'MA' => 'Manta Multimedia',
'MW' => 'Maxwest',
'M0' => 'Maze',
'MB' => 'Mobistel',
'M3' => 'Mecer',
'MD' => 'Medion',
Expand Down Expand Up @@ -387,6 +391,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'PH' => 'Philips',
'PI' => 'Pioneer',
'PL' => 'Polaroid',
'P5' => 'Polytron',
'P9' => 'Primepad',
'PM' => 'Palm',
'PO' => 'phoneOne',
Expand Down Expand Up @@ -455,7 +460,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'S3' => 'SunVan',
'SZ' => 'Sumvision',
'SS' => 'SWISSMOBILITY',
'S10' => 'Simbans',
'10' => 'Simbans',
'X1' => 'Safaricom',
'TA' => 'Tesla',
'T5' => 'TB Touch',
Expand Down Expand Up @@ -484,6 +489,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'T3' => 'Trevi',
'TU' => 'Tunisie Telecom',
'TR' => 'Turbo-X',
'11' => 'True',
'TV' => 'TVC',
'TX' => 'TechniSat',
'TZ' => 'teXet',
Expand All @@ -505,6 +511,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'VS' => 'ViewSonic',
'VT' => 'Vestel',
'VR' => 'Vernee',
'V4' => 'Verizon',
'VL' => 'Verykool',
'VV' => 'Vivo',
'VX' => 'Vertex',
Expand Down
19 changes: 18 additions & 1 deletion Tests/DeviceDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,28 @@ public function testDevicesYmlFiles()
$ymlData = \Spyc::YAMLLoad($file);
foreach ($ymlData AS $brand => $regex) {
$this->assertArrayHasKey('regex', $regex);
$this->assertTrue(strpos($regex['regex'], '||') === false, sprintf(
"Detect `||` in regex, file %s, brand %s, common regex %s",
$file,
$brand,
$regex['regex']
));
if (array_key_exists('models', $regex)) {
$this->assertInternalType('array', $regex['models']);
foreach ($regex['models'] AS $model) {
$this->assertArrayHasKey('regex', $model);
$this->assertArrayHasKey('model', $model);
$this->assertArrayHasKey('model', $model, sprintf(
"Key model not exist, file %s, brand %s, model regex %s",
$file,
$brand,
$model['regex']
));
$this->assertTrue(strpos($model['regex'], '||') === false, sprintf(
"Detect `||` in regex, file %s, brand %s, model regex %s",
$file,
$brand,
$model['regex']
));
}
} else {
$this->assertArrayHasKey('device', $regex);
Expand Down
Loading

0 comments on commit 46ac92c

Please sign in to comment.