getSignatures

open fun getSignatures(@NonNull packageManager: PackageManager, @NonNull packageName: String): List<Signature>(source)

Retrieve the Signature array for the given package. This returns some of certificates, depending on whether the package in question is multi-signed or has signing history.

Security/identity verification should not be done with this method. This is only intended to return some array of certificates that correspond to a package.

If verification if required, either use hasSignatures or manually verify the set of certificates using GET_SIGNING_CERTIFICATES or GET_SIGNATURES.

Return

an array of certificates the app is signed with

Parameters

packageManager

The PackageManager instance to query against.

packageName

The package to query the {@param packageManager} for. Query by app UID is only supported by manually choosing a package name returned in getPackagesForUid.

Throws

if the package cannot be found through the provided {@param packageManager}