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 |
|
static final @NonNull SigningInfoCompat |
@DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")Creates a |
static final @NonNull SigningInfoCompat |
@RequiresApi(value = 28)Creates a |
final @NonNull List<@NonNull Signature> |
for API 28 and above, this is the same as the app's |
final @NonNull Collection<@NonNull PublicKey> |
for API 35 and above, this is the same as the app's |
final int |
for API 35 and above, this is the same as the app's |
final @NonNull List<@NonNull Signature> |
for API 28 and above, this is the same as the app's |
final boolean |
for API 28 and above, this is the same as the app's |
final boolean |
for API 28 and above, this is the same as the app's |
int |
hashCode() |
Public methods
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 |
| Throws | |
|---|---|
IllegalArgumentException |
If this is invoked on >= API 28 |
fromSigningInfo
@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
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
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
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
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
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
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