PackageIdentifier

public class PackageIdentifier


This class represents a uniquely identifiable package.

Summary

Public constructors

PackageIdentifier(
    @NonNull String packageName,
    @NonNull byte[] sha256Certificate
)

Creates a unique identifier for a package.

Public methods

boolean
@NonNull String
@NonNull byte[]
int

Public constructors

PackageIdentifier

Added in 1.1.0-alpha04
public PackageIdentifier(
    @NonNull String packageName,
    @NonNull byte[] sha256Certificate
)

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
@NonNull String packageName

Name of the package.

@NonNull byte[] sha256Certificate

SHA-256 certificate digest of the package.

Public methods

equals

public boolean equals(@Nullable Object obj)

getPackageName

Added in 1.1.0-alpha04
public @NonNull String getPackageName()

getSha256Certificate

Added in 1.1.0-alpha04
public @NonNull byte[] getSha256Certificate()

hashCode

public int hashCode()