SigningInfoCompat


public final class SigningInfoCompat

Signing information for an app package.

Backward compatible representation of a SigningInfo. On Android 27 and below where SigningInfo isn't available, this will be initialized from the app's PackageInfo.signatures, in which case only signingCertificateHistory will be set.

Summary

Public methods

equals

public boolean equals(Object other)

fromSignatures

@DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")
public static final @NonNull SigningInfoCompat fromSignatures(@NonNull List<@NonNull Signature> signatures)

Creates a SigningInfoCompat from a list of Signature.

Parameters
@NonNull List<@NonNull Signature> signatures

the app signatures, which should be retrieved from the app's PackageInfo.signatures

Throws
IllegalArgumentException

If this is invoked on >= API 28

fromSigningInfo

Added in 1.5.0
@RequiresApi(value = 28)
public static final @NonNull SigningInfoCompat fromSigningInfo(@NonNull SigningInfo signingInfo)

Creates a SigningInfoCompat from SigningInfo.

getApkContentsSigners

Added in 1.5.0
public final @NonNull List<@NonNull Signature> getApkContentsSigners()

for API 28 and above, this is the same as the app's SigningInfo.getApkContentsSigners; for before API 35, this is empty

getPublicKeys

Added in 1.5.0
public final @NonNull Collection<@NonNull PublicKey> getPublicKeys()

for API 35 and above, this is the same as the app's SigningInfo.getPublicKeys; for before API 28, this is empty

getSchemeVersion

Added in 1.5.0
public final int getSchemeVersion()

for API 35 and above, this is the same as the app's SigningInfo.getSchemeVersion; for before API 35, this is 0 (unknown)

getSigningCertificateHistory

Added in 1.5.0
public final @NonNull List<@NonNull Signature> getSigningCertificateHistory()

for API 28 and above, this is the same as the app's SigningInfo.getSigningCertificateHistory; for before API 28, this is the list of Signatures of the app initialized from the app's PackageInfo.signatures

hasMultipleSigners

Added in 1.5.0
public final boolean hasMultipleSigners()

for API 28 and above, this is the same as the app's SigningInfo.hasMultipleSigners; for before API 28, this is false

hasPastSigningCertificates

Added in 1.5.0
public final boolean hasPastSigningCertificates()

for API 28 and above, this is the same as the app's SigningInfo.hasPastSigningCertificates; for before API 28, this is false

hashCode

public int hashCode()