Permalink
Browse files

Updates user agent detection in client library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Nov 21, 2018
1 parent bf59956 commit 79e3ff6c428185896fb72b311a82838f5106605f
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/client.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.44
* @version 1.0.45
* @date Creation: Jun 2007
* @date Modification: Nov 2018
* @copyright 2007 - 2018 CaMykS Team
@@ -839,7 +839,7 @@ function client_getUAInfos($ua=false) {
}
/* check Xiaomi mobiles */
elseif (preg_match('/(Redmi|MI) ?([A-Za-z0-9 ]{1,})( Build|\))/i', $ua, $matches)) {
elseif (preg_match('/(Redmi|MI|Pocophone) ?([A-Za-z0-9 ]{1,})( Build|\))/i', $ua, $matches)) {
include_once ('clientDevices/Xiaomi.php.inc');
$infos = array_merge($infos, get_XiaomiClientDevice($matches[1].' '.$matches[2]));
} elseif (preg_match('/HM NOTE 1LTE/', $ua, $matches))
@@ -1131,7 +1131,7 @@ function client_getUAInfos($ua=false) {
}
/* check Blackview mobiles */
elseif (preg_match('/ BV([a-zA-Z0-9\-]*) Build/', $ua, $matches)) {
elseif (preg_match('/ BV([a-zA-Z0-9\-]*)( Build|\))/', $ua, $matches)) {
include_once ('clientDevices/Blackview.php.inc');
$infos = array_merge($infos, get_BlackviewClientDevice($matches[1]));
}
@@ -1424,7 +1424,7 @@ function client_getUAInfos($ua=false) {
/* check unsmartly written browser, non case sensitive */
elseif (preg_match('/(Maxthon|Opera|webissimo|NintendoBrowser|Acoo ?Browser|Deepnet Explorer|Avant Browser|BrowseX|OffByOne|KKman|LBBROWSER|Maemo Browser|BIDUBrowser|UBrowser|Airmail|EmbeddedWB|DX-Browser|Links|Sputnik|Instagram|Microsoft Outlook|Chromeless)(?:\/| )?([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('BIDUBrowser'=>'Baidu Brower', 'AcooBrowser' => 'Acoo Browser', 'EmbeddedWB'=>'Delphi Embedded Web Browser');
$rep = array('BIDUBrowser'=>'Baidu Brower', 'AcooBrowser' => 'Acoo Browser', 'EmbeddedWB'=>'Delphi Embedded Web Browser', 'LBBROWSER'=>'Liebao');
$infos = array_merge($infos, array(
'browser_title' => isset($rep[$matches[1]])?$rep[$matches[1]]:$matches[1],
'browser_version' => isset($matches[2])?$matches[2]:'',
@@ -1453,8 +1453,8 @@ function client_getUAInfos($ua=false) {
}
/* check Chrome/Safari/Firefox/Explorer compatible browsers, to be tested before usual browsers */
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|FocusiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive|Avast)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Dragon'=>'IceDragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'C&ocirc;t&eacute; Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'FocusiOS'=>'Firefox Focus', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'Blazer'=> 'Palm Blazer', 'MicroMessenger' => 'WeChat', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'C&ocirc;c c&ocirc;c', 'MZBrowser' => 'Meizu Browser', 'Avast' => 'Avast Browser');
elseif (preg_match('/(YaBrowser|OPR|IceDragon|Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|MicroMessenger|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|FocusiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive|Avast|VivoBrowser)\/([a-z0-9\._]*)?/i', $ua, $matches)) {
$rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Dragon'=>'IceDragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'C&ocirc;t&eacute; Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'FocusiOS'=>'Firefox Focus', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'Blazer'=> 'Palm Blazer', 'MicroMessenger' => 'WeChat', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'C&ocirc;c c&ocirc;c', 'MZBrowser' => 'Meizu Browser', 'Avast' => 'Avast Browser', 'VivoBrowser' => 'Vivo Browser');
$infos = array_merge($infos, array(
'browser_title' => isset($rep[$matches[1]])?$rep[$matches[1]]:$matches[1],
'browser_version' => isset($matches[2])?$matches[2]:'',
@@ -1479,7 +1479,7 @@ function client_getUAInfos($ua=false) {
}
/* check gen computer browsers */
elseif (preg_match('/(Chromium|Netscape|Camino|Minefield|Fennec|Firefox|Galeon|iCab|Konqueror|IEMobile|Shiira|NetNewsWire|Symphony|Lynx|Crazy Browser|UCBrowser|GoBrowser|Cobra|ELinks|HotJava|Tor Browser|Dillo|FortiMail|VSE|MultiZilla|UCWEB|Otter|Netbox|AvantGo|NetFront|WhatsApp)(?:\/| )?([a-z0-9\._]*)/i', $ua, $matches)) {
elseif (preg_match('/(Chromium|Netscape|Camino|Minefield|Fennec|Firefox|Galeon|iCab|Konqueror|IEMobile|Shiira|NetNewsWire|Symphony|Lynx|Crazy Browser|UCBrowser|GoBrowser|Cobra|ELinks|HotJava|Tor Browser|Dillo|FortiMail|VSE|MultiZilla|UCWEB|Otter|Netbox|AvantGo|NetFront|WhatsApp|Dalvik)(?:\/| )?([a-z0-9\._]*)/i', $ua, $matches)) {
$rep = array('VSE'=>'VSE Link Tester', 'UCWEB' => 'UC Browser', 'NetFront' => 'Access NetFront');
$infos = array_merge(array(
'platform_type' => 'computer',
@@ -4,7 +4,7 @@
* @details Engine / Bot Library
* @file engine/lib/tool/clientBots/Bots.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.19
* @version 1.0.20
* @date Creation: May 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
@@ -4296,6 +4296,26 @@ function _client_getKnownBots() {
'engine_url' => '',
);
/* HoneyBee Bot - unknown bot */
$knownBots['honeybee'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'HoneyBee (Unknown bot)',
'bot_url' => '',
'engine_title' => '',
'engine_url' => '',
);
/* Blackboard Safeassign Bot - unknown bot */
$knownBots['blackboard safeassign'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'Blackboard Safeassign (Unknown bot)',
'bot_url' => '',
'engine_title' => '',
'engine_url' => '',
);
/* return bot list */
return $knownBots;
}
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientBots/Tools.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.9
* @version 1.0.10
* @date Creation: May 2018
* @date Modification: Oct 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -1101,6 +1101,16 @@ function _client_getKnownTools() {
'engine_url' => 'http://www.siteliner.com',
);
/* Discordbot */
$knownTools['discordbot'] = array(
'platform_type' => 'tool',
'platform_format' => 'desktop',
'tool_title' => 'Discordbot',
'tool_url' => '',
'engine_title' => 'Discord',
'engine_url' => 'https://discordapp.com',
);
/* return list */
return $knownTools;
}
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Blackview.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.1
* @version 1.0.2
* @date Creation: Jul 2018
* @date Modification: Aug 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -20,8 +20,10 @@
*/
function get_BlackviewClientDevice($deviceCode='') {
$deviceList = array(
'9000Pro-F' => array('platform_model' => 'BV9000Pro F', 'platform_year' => 2017),
'8000Pro' => array('platform_model' => 'BV8000Pro', 'platform_year' => 2017),
'9000Pro-F' => array('platform_model' => '9000Pro F', 'platform_year' => 2017),
'8000Pro' => array('platform_model' => '8000Pro', 'platform_year' => 2017),
'9500' => array('platform_model' => '9500', 'platform_year' => 2018),
'9500Pro' => array('platform_model' => '9500Pro', 'platform_year' => 2018),
);
/* Check for returning list */
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Huawei.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.20
* @version 1.0.21
* @date Creation: Apr 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
@@ -37,6 +37,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'GRA-L09' => array('platform_model' => 'P8', 'platform_year' => 2015),
'EVA-L09' => array('platform_model' => 'P9', 'platform_year' => 2016),
'EVA-L19' => array('platform_model' => 'P9 (Dual Sim)', 'platform_year' => 2016),
'VNS-L21' => array('platform_model' => 'P9 Lite', 'platform_year' => 2016),
'VNS-L31' => array('platform_model' => 'P9 Lite', 'platform_year' => 2016),
'VNS-L53' => array('platform_model' => 'P9 Lite', 'platform_year' => 2016),
'PRA-LX3' => array('platform_model' => 'P9 Lite', 'platform_year' => 2017),
@@ -50,6 +51,8 @@ function get_HuaweiClientDevice($deviceCode='') {
'ANE-LX3' => array('platform_model' => 'P20 Lite', 'platform_year' => 2018),
'CLT-L09' => array('platform_model' => 'P20 Pro', 'platform_year' => 2018),
'CLT-L29' => array('platform_model' => 'P20 Pro', 'platform_year' => 2018),
'CRR-L09' => array('platform_model' => 'Mate S', 'platform_year' => 2015),
'BND-L34' => array('platform_model' => 'Mate SE', 'platform_year' => 2016),
'NXT-L09' => array('platform_model' => 'Mate 8', 'platform_year' => 2015),
'NXT-L29' => array('platform_model' => 'Mate 8', 'platform_year' => 2015),
'MHA-L09' => array('platform_model' => 'Mate 8\'', 'platform_year' => 2016),
@@ -61,8 +64,8 @@ function get_HuaweiClientDevice($deviceCode='') {
'BLA-L09S' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'BLA-L29' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'BLA-L29S' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'CRR-L09' => array('platform_model' => 'Mate S', 'platform_year' => 2015),
'BND-L34' => array('platform_model' => 'Mate SE', 'platform_year' => 2016),
'SNE-L21' => array('platform_model' => 'Mate 20 Lite', 'platform_year' => 2018),
'SNE-LX1' => array('platform_model' => 'Mate 20 Lite', 'platform_year' => 2018),
'LYO-L21' => array('platform_model' => 'Honor 5A', 'platform_year' => 2016),
'NEM-L51' => array('platform_model' => 'Honor 5C', 'platform_year' => 2016),
'KIW-L21' => array('platform_model' => 'Honor 5X', 'platform_year' => 2015),
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Samsung.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.21
* @version 1.0.22
* @date Creation: Apr 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
@@ -52,6 +52,7 @@ function get_SamsungClientDevice($deviceCode='') {
'SM-T810' => array('platform_model' => 'Galaxy Tab S2', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2015),
'SM-T713' => array('platform_model' => 'Galaxy Tab S2', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016),
'SM-T813' => array('platform_model' => 'Galaxy Tab S2', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016),
'SM-T820' => array('platform_model' => 'Galaxy Tab S3', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017),
/* Samsung phones */
'GT-C3590' => array('platform_model' => 'C3590', 'platform_year' => 2013, 'system_title' => 'Symbian'),
@@ -227,6 +228,8 @@ function get_SamsungClientDevice($deviceCode='') {
'GT-S7392' => array('platform_model' => 'Galaxy Trend', 'platform_year' => 2014),
'GT-S7560' => array('platform_model' => 'Galaxy Trend', 'platform_year' => 2013),
'GT-S7580' => array('platform_model' => 'Galaxy Trend+', 'platform_year' => 2013),
'GT-S7390' => array('platform_model' => 'Galaxy Trend lite', 'platform_year' => 2013),
'GT-S7390G' => array('platform_model' => 'Galaxy Trend lite', 'platform_year' => 2013),
'SM-G318H' => array('platform_model' => 'Galaxy Trend 2 lite', 'platform_year' => 2015),
'GT-S5660' => array('platform_model' => 'Galaxy Gio', 'platform_year' => 2011),
'GT-S5660M' => array('platform_model' => 'Galaxy Gio', 'platform_year' => 2011),
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Xiaomi.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.9
* @version 1.0.10
* @date Creation: May 2018
* @date Modification: Oct 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -40,6 +40,8 @@ function get_XiaomiClientDevice($deviceCode='') {
'redmi 5a' => array('platform_model' => 'Redmi 5A', 'platform_year' => 2017),
'redmi 5 plus' => array('platform_model' => 'Redmi 5 Plus', 'platform_year' => 2018),
'redmi 6a' => array('platform_model' => 'Redmi 6A', 'platform_year' => 2018),
'pocophone f1' => array('platform_model' => 'Pocophone F1', 'platform_year' => 2018),
);
/* Check for returning list */

0 comments on commit 79e3ff6

Please sign in to comment.