Added Android OS detection from useragent
git-svn-id: https://beef.googlecode.com/svn/trunk@1254 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -85,6 +85,10 @@ beef.os = {
|
||||
return (this.ua.match('(Maemo Browser)|(Symbian)|(Nokia)')) ? true : false;
|
||||
},
|
||||
|
||||
isAndroid: function() {
|
||||
return (this.ua.indexOf('Android')) ? true : false;
|
||||
},
|
||||
|
||||
isBlackBerry: function() {
|
||||
return (this.ua.indexOf('BlackBerry')) ? true : false;
|
||||
},
|
||||
@@ -124,6 +128,9 @@ beef.os = {
|
||||
// BlackBerry
|
||||
if(this.isBlackBerry()) return 'BlackBerry OS';
|
||||
|
||||
// Android
|
||||
if(this.isAndroid()) return 'Android';
|
||||
|
||||
//linux
|
||||
if(this.isLinux()) return 'Linux';
|
||||
if(this.isSunOS()) return 'Sun OS';
|
||||
|
||||
@@ -31,6 +31,8 @@ module Constants
|
||||
OS_IPHONE_IMG = 'iphone.png'
|
||||
OS_BLACKBERRY_UA_STR = 'BlackBerry'
|
||||
OS_BLACKBERRY_IMG = 'blackberry.png'
|
||||
OS_ANDROID_UA_STR = 'Android'
|
||||
OS_ANDROID_IMG = 'android.png'
|
||||
OS_ALL_UA_STR = 'All'
|
||||
|
||||
def self.match_os(name)
|
||||
@@ -45,6 +47,8 @@ module Constants
|
||||
OS_IPHONE_UA_STR
|
||||
when /blackberry/
|
||||
OS_BLACKBERRY_UA_STR
|
||||
when /android/
|
||||
OS_ANDROID_UA_STR
|
||||
else
|
||||
'ALL'
|
||||
end
|
||||
|
||||
BIN
extensions/admin_ui/media/images/icons/android.png
Normal file
BIN
extensions/admin_ui/media/images/icons/android.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -105,6 +105,7 @@ module Models
|
||||
return BeEF::Core::Constants::Os::OS_IPHONE_IMG if ua_string.include? BeEF::Core::Constants::Os::OS_IPHONE_UA_STR
|
||||
return BeEF::Core::Constants::Os::OS_MAC_IMG if ua_string.include? BeEF::Core::Constants::Os::OS_MAC_UA_STR
|
||||
return BeEF::Core::Constants::Os::OS_BLACKBERRY_IMG if ua_string.include? BeEF::Core::Constants::Os::OS_BLACKBERRY_UA_STR
|
||||
return BeEF::Core::Constants::Os::OS_ANDROID_IMG if ua_string.include? BeEF::Core::Constants::Os::OS_ANDROID_UA_STR
|
||||
|
||||
BeEF::Core::Constants::Os::OS_UNKNOWN_IMG
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user