PackageIdentifier


class PackageIdentifier


This class represents a uniquely identifiable package.

Summary

Public constructors

PackageIdentifier(packageName: String, sha256Certificate: ByteArray)

Creates a unique identifier for a package.

Public functions

Boolean
equals(obj: Any?)
String

Returns the name for a package.

ByteArray<Byte>

Returns the SHA-256 certificate for a package.

Int

Public constructors

PackageIdentifier

Added in 1.1.0-alpha07
PackageIdentifier(packageName: String, sha256Certificate: ByteArray)

Creates a unique identifier for a package.

SHA-256 certificate digests for a signed application can be retrieved with the apksigner tool that is part of the Android SDK build tools. Use apksigner verify --print-certs path/to/apk.apk to retrieve the SHA-256 certificate digest for the target application. Once retrieved, the SHA-256 certificate digest should be converted to a byte[] by decoding it in base16:

new android.content.pm.Signature(outputDigest).toByteArray();
Parameters
packageName: String

Name of the package.

sha256Certificate: ByteArray

SHA-256 certificate digest of the package.

Public functions

equals

fun equals(obj: Any?): Boolean

getPackageName

Added in 1.1.0-alpha07
fun getPackageName(): String

Returns the name for a package.

getSha256Certificate

Added in 1.1.0-alpha07
fun getSha256Certificate(): ByteArray<Byte>

Returns the SHA-256 certificate for a package.

hashCode

fun hashCode(): Int