PackageIdentifier
class PackageIdentifier
This class represents a uniquely identifiable package.
Summary
Public constructors |
|---|
PackageIdentifier(Creates a unique identifier for a package. |
Public functions |
|
|---|---|
Boolean |
|
String |
Returns the name for a package. |
Array<Byte> |
Returns the SHA-256 certificate for a package. |
Int |
hashCode() |
Public constructors
PackageIdentifier
PackageIdentifier(
packageName: String,
sha256Certificate: ByteArray<Byte>
)
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();
Public functions
getSha256Certificate
fun getSha256Certificate(): Array<Byte>
Returns the SHA-256 certificate for a package.