public final class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ANDROID_APP_ASSET_FIELD_CERT_FPS |
static String |
ANDROID_APP_ASSET_FIELD_PACKAGE_NAME
Field names in a Android app asset descriptor.
|
static String |
ASSET_DESCRIPTOR_FIELD_RELATION
Field names in a statement.
|
static String |
ASSET_DESCRIPTOR_FIELD_TARGET |
static String |
DELEGATE_FIELD_DELEGATE |
static String |
NAMESPACE_ANDROID_APP |
static String |
NAMESPACE_FIELD
Field name for namespace.
|
static String |
NAMESPACE_WEB
Supported asset namespaces.
|
static String |
WEB_ASSET_FIELD_SITE
Field names in a web asset descriptor.
|
Modifier and Type | Method and Description |
---|---|
static String |
computeNormalizedSha256Fingerprint(byte[] signature)
Computes the hash of the byte array using the specified algorithm, returning a hex string
with a colon between each byte.
|
static List<String> |
getCertFingerprintsFromPackageManager(String packageName,
Context context)
Returns the normalized sha-256 fingerprints of a given package according to the Android
package manager.
|
static boolean |
hasCommonString(List<String> list1,
List<String> list2)
Returns true if there is at least one common string between the two lists of string.
|
static String |
joinStrings(String separator,
List<String> strings)
Joins a list of strings, by placing separator between each string.
|
public static final String NAMESPACE_FIELD
public static final String NAMESPACE_WEB
public static final String NAMESPACE_ANDROID_APP
public static final String WEB_ASSET_FIELD_SITE
public static final String ANDROID_APP_ASSET_FIELD_PACKAGE_NAME
public static final String ANDROID_APP_ASSET_FIELD_CERT_FPS
public static final String ASSET_DESCRIPTOR_FIELD_RELATION
public static final String ASSET_DESCRIPTOR_FIELD_TARGET
public static final String DELEGATE_FIELD_DELEGATE
public static String joinStrings(String separator, List<String> strings)
joinStrings("; ", Arrays.asList(new String[]{"a", "b", "c"}))
returns
"a; b; c
".public static List<String> getCertFingerprintsFromPackageManager(String packageName, Context context) throws PackageManager.NameNotFoundException
public static String computeNormalizedSha256Fingerprint(byte[] signature)