Permalink
Browse files

Updates user agent detection in client library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Nov 12, 2018
1 parent f51d482 commit 9325d36c37a7cf5ca42fba56cd15e8e17a316aa4
@@ -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.43
* @version 1.0.44
* @date Creation: Jun 2007
* @date Modification: Nov 2018
* @copyright 2007 - 2018 CaMykS Team
@@ -287,7 +287,7 @@ function client_getUAInfos($ua=false) {
elseif (preg_match('/HTC;([A-Za-z0-9 ]*)/', $ua, $matches)) {
include_once('clientDevices/HTC.php.inc');
$infos = array_merge($infos, get_HTCClientDevice($matches[1]));
} elseif (preg_match('/HTC[ |_]([^\/\-]*)( Build|\-)/', $ua, $matches)) {
} elseif (preg_match('/HTC[ |_]([^\/\-]*)( Build|\-|\))/', $ua, $matches)) {
include_once('clientDevices/HTC.php.inc');
$model = preg_replace('/_/', ' ', $matches[1]);
$infos = array_merge($infos, get_HTCClientDevice($model));
@@ -409,6 +409,22 @@ function client_getUAInfos($ua=false) {
'platform_company' =>'Sony (PC)',
));
/* check Lenovo - before Hawei */
elseif (preg_match('/(IdeaTab|Yoga|Lenovo)[ |_]([A-Z0-9\- ]{3,})( Build|\))/i', $ua, $matches)) {
include_once ('clientDevices/Lenovo.php.inc');
$infos = array_merge($infos, get_LenovoClientDevice(trim($matches[2])));
}
elseif (preg_match('/ (Z2 Plus) Build/i', $ua, $matches)) {
include_once ('clientDevices/Lenovo.php.inc');
$infos = array_merge($infos, get_LenovoClientDevice(trim($matches[1])));
}
/* check Lenovo PCs */
elseif (preg_match('/MALC|MALCJS|MALN|MALNJS|LCJB|LEN2/', $ua, $matches))
$infos = array_merge($infos, array(
'platform_company' =>'Lenovo (PC)',
));
/* check Huawei */
elseif (preg_match('/Build\/(HONOR|HUAWEI)([A-Z0-9\-]{6,})/i', $ua, $matches)) {
include_once ('clientDevices/Huawei.php.inc');
@@ -435,22 +451,6 @@ function client_getUAInfos($ua=false) {
);
}
/* check Lenovo */
elseif (preg_match('/(IdeaTab|Yoga|Lenovo)[ |_]([A-Z0-9\- ]{3,}) Build/i', $ua, $matches)) {
include_once ('clientDevices/Lenovo.php.inc');
$infos = array_merge($infos, get_LenovoClientDevice(trim($matches[2])));
}
elseif (preg_match('/ (Z2 Plus) Build/i', $ua, $matches)) {
include_once ('clientDevices/Lenovo.php.inc');
$infos = array_merge($infos, get_LenovoClientDevice(trim($matches[1])));
}
/* check Lenovo PCs */
elseif (preg_match('/MALC|MALCJS|MALN|MALNJS|LCJB|LEN2/', $ua, $matches))
$infos = array_merge($infos, array(
'platform_company' =>'Lenovo (PC)',
));
/* check Outikel mobiles */
elseif (preg_match('/(K6000 Pro) Build/', $ua, $matches)) {
$model = trim($matches[1]);
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientBots/Generics.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.5
* @version 1.0.6
* @date Creation: May 2018
* @date Modification: Sep 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.
@@ -611,6 +611,16 @@ function _client_getKnownGenerics() {
'engine_url' => 'https://akka.io/',
);
/* Microsoft URL Control */
$knownGenerics['microsoft url control'] = array(
'platform_type' => 'bot',
'platform_format' => 'desktop',
'bot_title' => 'Microsoft URL Control',
'bot_url' => '',
'engine_title' => 'Microsoft',
'engine_url' => 'https://www.microsoft.com/',
);
/* obot */
$knownGenerics[' obot'] = array(
'platform_type' => 'bot',
@@ -4,7 +4,7 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/HTC.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.1
* @version 1.0.2
* @date Creation: Aug 2018
* @date Modification: Sep 2018
* @copyright 2018 CaMykS Team
@@ -20,14 +20,15 @@
*/
function get_HTCClientDevice($deviceCode='') {
$deviceList = array(
'IncredibleS' => array('platform_model' => 'Incredible S', 'platform_year' => 2011),
'T329t' => array('platform_model' => 'Proto', 'platform_year' => 2012 , 'browser_title' => 'Android browser',),
'8088;' => array('platform_model' => 'One Max', 'platform_year' => 2013),
'M8Sx' => array('platform_model' => 'One (E8)', 'platform_year' => 2014),
'One M8' => array('platform_model' => 'One (M8)', 'platform_year' => 2014),
'D820u' => array('platform_model' => 'Desire 820 Dual SIM', 'platform_year' => 2014),
'2PYB2' => array('platform_model' => 'Bolt', 'platform_year' => 2016),
'Desire 626' => array('platform_model' => 'Desire 626', 'platform_year' => 2015),
'IncredibleS' => array('platform_model' => 'Incredible S', 'platform_year' => 2011),
'T329t' => array('platform_model' => 'Proto', 'platform_year' => 2012 , 'browser_title' => 'Android browser',),
'8088;' => array('platform_model' => 'One Max', 'platform_year' => 2013),
'M8Sx' => array('platform_model' => 'One (E8)', 'platform_year' => 2014),
'One M8' => array('platform_model' => 'One (M8)', 'platform_year' => 2014),
'D820u' => array('platform_model' => 'Desire 820 Dual SIM', 'platform_year' => 2014),
'Desire 626' => array('platform_model' => 'Desire 626', 'platform_year' => 2015),
'2PYB2' => array('platform_model' => 'Bolt', 'platform_year' => 2016),
'Desire 628 dual sim' => array('platform_model' => 'Desire 628 Dual SIM', 'platform_year' => 2016),
);
/* 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.19
* @version 1.0.20
* @date Creation: Apr 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
@@ -57,6 +57,7 @@ function get_HuaweiClientDevice($deviceCode='') {
'RNE-L21' => array('platform_model' => 'Mate 10 Lite', 'platform_year' => 2017),
'BLA-A09' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'BLA-AL00' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'BLA-L09' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017),
'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),
@@ -4,9 +4,9 @@
* @details Engine / Tool Library
* @file engine/lib/tool/clientDevices/Lenovo.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.8
* @version 1.0.9
* @date Creation: Apr 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.
@@ -30,6 +30,7 @@ function get_LenovoClientDevice($deviceCode='') {
'PB1-770P' => array('platform_model' => 'PHAB Plus', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2015),
'TAB 2 A10-70LC' => array('platform_model' => 'Tab 2', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2015),
'YB1-X90F' => array('platform_model' => 'Yoga Book', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016),
'YT3-X50F' => array('platform_model' => 'Yoga Tab 3', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016),
'YT-X703F' => array('platform_model' => 'Yoga Tab 3 Plus', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016),
/* Lenovo phones */
@@ -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.20
* @version 1.0.21
* @date Creation: Apr 2018
* @date Modification: Nov 2018
* @copyright 2018 CaMykS Team
@@ -199,6 +199,7 @@ function get_SamsungClientDevice($deviceCode='') {
'GT-N7005' => array('platform_model' => 'Galaxy Note (4G)', 'platform_year' => 2011),
'GT-N8000' => array('platform_model' => 'Galaxy Note 10.1 (3G)', 'platform_year' => 2012),
'GT-N8010' => array('platform_model' => 'Galaxy Note 10.1', 'platform_year' => 2012),
'GT-N8013' => array('platform_model' => 'Galaxy Note 10.1', 'platform_year' => 2012),
'SM-P600' => array('platform_model' => 'Galaxy Note 10.1 2014 Edition', 'platform_year' => 2013),
'GT-N7100' => array('platform_model' => 'Galaxy Note II (3G)', 'platform_year' => 2012),
'GT-N7105' => array('platform_model' => 'Galaxy Note II', 'platform_year' => 2012),

0 comments on commit 9325d36

Please sign in to comment.