Added in API level 31

Checksum

class Checksum : Parcelable
kotlin.Any
   ↳ android.content.pm.Checksum

A typed checksum.

Summary

Constants
static Int

Root SHA256 hash of a 1M Merkle tree computed over protected content.

static Int

Root SHA512 hash of a 1M Merkle tree computed over protected content.

static Int

MD5 hash computed over all file bytes.

static Int

Root SHA256 hash of a 4K Merkle tree computed over all file bytes.

static Int

SHA1 hash computed over all file bytes.

static Int

SHA256 hash computed over all file bytes.

static Int

SHA512 hash computed over all file bytes.

Inherited constants
Public constructors
Checksum(type: Int, value: ByteArray)

Creates a new Checksum.

Public methods
Int

Int

Checksum type.

ByteArray

Checksum value.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<Checksum!>

Constants

TYPE_PARTIAL_MERKLE_ROOT_1M_SHA256

Added in API level 31
static val TYPE_PARTIAL_MERKLE_ROOT_1M_SHA256: Int

Root SHA256 hash of a 1M Merkle tree computed over protected content. Excludes signing block. See APK Signature Scheme V2.

Value: 32

TYPE_PARTIAL_MERKLE_ROOT_1M_SHA512

Added in API level 31
static val TYPE_PARTIAL_MERKLE_ROOT_1M_SHA512: Int

Root SHA512 hash of a 1M Merkle tree computed over protected content. Excludes signing block. See APK Signature Scheme V2.

Value: 64

TYPE_WHOLE_MD5

Added in API level 31
Deprecated in API level 31
static val TYPE_WHOLE_MD5: Int

Deprecated: Not platform enforced. Cryptographically broken and unsuitable for further use. Use platform enforced digests e.g. TYPE_WHOLE_MERKLE_ROOT_4K_SHA256. Provided for completeness' sake and to support legacy usecases.

MD5 hash computed over all file bytes.

Value: 2

TYPE_WHOLE_MERKLE_ROOT_4K_SHA256

Added in API level 31
static val TYPE_WHOLE_MERKLE_ROOT_4K_SHA256: Int

Root SHA256 hash of a 4K Merkle tree computed over all file bytes. See APK Signature Scheme V4. See fs-verity. Recommended for all new applications. Can be used by kernel to enforce authenticity and integrity of the APK. See fs-verity for details

Value: 1

TYPE_WHOLE_SHA1

Added in API level 31
Deprecated in API level 31
static val TYPE_WHOLE_SHA1: Int

Deprecated: Not platform enforced. Broken and should not be used. Use platform enforced digests e.g. TYPE_WHOLE_MERKLE_ROOT_4K_SHA256. Provided for completeness' sake and to support legacy usecases.

SHA1 hash computed over all file bytes.

Value: 4

TYPE_WHOLE_SHA256

Added in API level 31
Deprecated in API level 31
static val TYPE_WHOLE_SHA256: Int

Deprecated: Not platform enforced. Use platform enforced digests e.g. TYPE_WHOLE_MERKLE_ROOT_4K_SHA256. Provided for completeness' sake and to support legacy usecases.

SHA256 hash computed over all file bytes.

Value: 8

TYPE_WHOLE_SHA512

Added in API level 31
Deprecated in API level 31
static val TYPE_WHOLE_SHA512: Int

Deprecated: Not platform enforced. Use platform enforced digests e.g. TYPE_WHOLE_MERKLE_ROOT_4K_SHA256. Provided for completeness' sake and to support legacy usecases.

SHA512 hash computed over all file bytes.

Value: 16

Public constructors

Public methods

describeContents

Added in API level 31
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getValue

Added in API level 31
fun getValue(): ByteArray

Checksum value.

Return
ByteArray This value cannot be null.

writeToParcel

Added in API level 31
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 31
static val CREATOR: Parcelable.Creator<Checksum!>