SigningInfoCompat


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 companion functions

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

Creates a SigningInfoCompat from a list of Signature.

SigningInfoCompat
@RequiresApi(value = 28)
fromSigningInfo(signingInfo: SigningInfo)

Creates a SigningInfoCompat from SigningInfo.

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public properties

List<Signature>

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

Boolean

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

Boolean

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

Collection<PublicKey>
@RequiresApi(value = 35)
publicKeys

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

Int

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

List<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

Public companion functions

fromSignatures

@DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")
fun fromSignatures(signatures: List<Signature>): SigningInfoCompat

Creates a SigningInfoCompat from a list of Signature.

Parameters
signatures: List<Signature>

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)
fun fromSigningInfo(signingInfo: SigningInfo): SigningInfoCompat

Creates a SigningInfoCompat from SigningInfo.

Parameters
signingInfo: SigningInfo

the signing information of an app package

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

apkContentsSigners

Added in 1.5.0-alpha05
@RequiresApi(value = 28)
val apkContentsSignersList<Signature>

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

hasMultipleSigners

Added in 1.5.0-alpha05
@RequiresApi(value = 28)
val hasMultipleSignersBoolean

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
@RequiresApi(value = 28)
val hasPastSigningCertificatesBoolean

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

publicKeys

Added in 1.5.0-alpha05
@RequiresApi(value = 35)
val publicKeysCollection<PublicKey>

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

schemeVersion

Added in 1.5.0-alpha05
@RequiresApi(value = 35)
val schemeVersionInt

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

signingCertificateHistory

Added in 1.5.0-alpha05
val signingCertificateHistoryList<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