Class BrowserDetails
-
- All Implemented Interfaces:
-
java.io.Serializable
public class BrowserDetails implements SerializableContains details about a browser. This class is meant to be used with BrowserWhitelist. For convenience, this class has static functions returning browser details for common Android browsers.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringchromePackageNamepublic final static Array<String>chromeSignaturespublic final static StringfirefoxPackageNamepublic final static Array<String>firefoxSignaturespublic final static StringsamsungBrowserPackageNamepublic final static Array<String>samsungBrowserSignaturespublic final static StringedgePackageNamepublic final static Array<String>edgeSignaturespublic Stringversionpublic Array<String>signaturespublic final StringpackageName
-
Constructor Summary
Constructors Constructor Description BrowserDetails(String packageName, Array<String> signatureStrings, String version)Constructs a BrowserDetails object with the given details. BrowserDetails(String packageName, Array<String> signatureStrings)Constructs a BrowserDetails object with the given details.
-
Method Summary
Modifier and Type Method Description StringgetVersion()Returns the version. Array<String>getSignatures()Returns the signatures. StringgetPackageName()Returns the package name. StringtoString()Returns a String representation of this BrowserDetails object. static BrowserDetailschrome()Returns a BrowserDetails object matching any version of the Chrome browser. static BrowserDetailschrome(@Nullable() String version)Returns a BrowserDetails object matching a Chrome browser of greater or equal version. static BrowserDetailsfirefox()Returns a BrowserDetails object matching any version of the Firefox browser. static BrowserDetailsfirefox(@Nullable() String version)Returns a BrowserDetails object matching a Firefox browser of greater or equal version. static BrowserDetailssamsungBrowser()Returns a BrowserDetails object matching any version of the Samsung Browser. static BrowserDetailssamsungBrowser(@Nullable() String version)Returns a BrowserDetails object matching a Samsung Browser of greater or equal version. static BrowserDetailsedge()Returns a BrowserDetails object matching any version of the Edge browser. static BrowserDetailsedge(@Nullable() String version)Returns a BrowserDetails object matching an Edge browser of greater or equal version. -
-
Constructor Detail
-
BrowserDetails
BrowserDetails(String packageName, Array<String> signatureStrings, String version)
Constructs a BrowserDetails object with the given details.- Parameters:
packageName- The package name.signatureStrings- The signature strings.version- The version.
-
BrowserDetails
BrowserDetails(String packageName, Array<String> signatureStrings)
Constructs a BrowserDetails object with the given details.- Parameters:
packageName- The package name.signatureStrings- The signature strings.
-
-
Method Detail
-
getVersion
@Nullable() String getVersion()
Returns the version.
- Returns:
The version.
-
getSignatures
@NonNull() Array<String> getSignatures()
Returns the signatures.
- Returns:
The signatures.
-
getPackageName
@NonNull() String getPackageName()
Returns the package name.
- Returns:
The package name.
-
toString
@NonNull() String toString()
Returns a String representation of this BrowserDetails object. For readability, the signatures will be truncated in the returned String.
- Returns:
A String representation of this BrowserDetails object.
-
chrome
@NonNull() static BrowserDetails chrome()
Returns a BrowserDetails object matching any version of the Chrome browser.
- Returns:
BrowserDetails matching Chrome.
-
chrome
@NonNull() static BrowserDetails chrome(@Nullable() String version)
Returns a BrowserDetails object matching a Chrome browser of greater or equal version.
- Returns:
BrowserDetails matching Chrome.
-
firefox
@NonNull() static BrowserDetails firefox()
Returns a BrowserDetails object matching any version of the Firefox browser.
- Returns:
BrowserDetails matching Firefox.
-
firefox
@NonNull() static BrowserDetails firefox(@Nullable() String version)
Returns a BrowserDetails object matching a Firefox browser of greater or equal version.
- Returns:
BrowserDetails matching Firefox.
-
samsungBrowser
@NonNull() static BrowserDetails samsungBrowser()
Returns a BrowserDetails object matching any version of the Samsung Browser.
- Returns:
BrowserDetails matching the Samsung Browser.
-
samsungBrowser
@NonNull() static BrowserDetails samsungBrowser(@Nullable() String version)
Returns a BrowserDetails object matching a Samsung Browser of greater or equal version.
- Returns:
BrowserDetails matching the Samsung Browser.
-
edge
@NonNull() static BrowserDetails edge()
Returns a BrowserDetails object matching any version of the Edge browser.
- Returns:
BrowserDetails matching the Edge browser.
-
edge
@NonNull() static BrowserDetails edge(@Nullable() String version)
Returns a BrowserDetails object matching an Edge browser of greater or equal version.
- Returns:
BrowserDetails matching the Edge browser.
-
-
-
-