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 | |
|---|---|
| 
            
             Creates a new Checksum.  | 
        |
| Public methods | |
|---|---|
| Int | |
| Int | 
            getType()Checksum type.  | 
        
| ByteArray | 
            getValue()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
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: 32TYPE_PARTIAL_MERKLE_ROOT_1M_SHA512
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: 64TYPE_WHOLE_MD5
static valTYPE_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: 2TYPE_WHOLE_MERKLE_ROOT_4K_SHA256
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: 1TYPE_WHOLE_SHA1
static valTYPE_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: 4TYPE_WHOLE_SHA256
static valTYPE_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: 8TYPE_WHOLE_SHA512
static valTYPE_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: 16Public constructors
Checksum
Checksum(
type: Int,
value: ByteArray)
Creates a new Checksum.
| Parameters | |
|---|---|
type | 
            Int: Checksum type. Value is android.content.pm.Checksum#TYPE_WHOLE_MERKLE_ROOT_4K_SHA256, android.content.pm.Checksum#TYPE_WHOLE_MD5, android.content.pm.Checksum#TYPE_WHOLE_SHA1, android.content.pm.Checksum#TYPE_WHOLE_SHA256, android.content.pm.Checksum#TYPE_WHOLE_SHA512, android.content.pm.Checksum#TYPE_PARTIAL_MERKLE_ROOT_1M_SHA256, or android.content.pm.Checksum#TYPE_PARTIAL_MERKLE_ROOT_1M_SHA512 | 
          
value | 
            ByteArray: Checksum value. This value cannot be null. | 
          
Public methods
describeContents
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 | 
          
getType
fun getType(): Int
Checksum type.
getValue
fun getValue(): ByteArray
Checksum value.
| Return | |
|---|---|
ByteArray | 
            This value cannot be null. | 
          
writeToParcel
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 |