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

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

Creates a SigningInfoCompat from a list of Signature.

static final @NonNull SigningInfoCompat
@RequiresApi(value = 28)
fromSigningInfo(@NonNull SigningInfo signingInfo)

Creates a SigningInfoCompat from SigningInfo.

final @NonNull List<@NonNull Signature>

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

final @NonNull Collection<@NonNull PublicKey>

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

final int

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

final @NonNull List<@NonNull Signature>

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

final boolean

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

final boolean

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

int

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
kotlin.IllegalArgumentException

If this is invoked on >= API 28

fromSigningInfo

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

Creates a SigningInfoCompat from SigningInfo.

Parameters
@NonNull SigningInfo signingInfo

the signing information of an app package

getApkContentsSigners

Added in 1.5.0-alpha05
public final @NonNull List<@NonNull SignaturegetApkContentsSigners()

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-alpha05
public final @NonNull Collection<@NonNull PublicKeygetPublicKeys()

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-alpha05
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-alpha05
public final @NonNull List<@NonNull SignaturegetSigningCertificateHistory()

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-alpha05
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-alpha05
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()