Share via


PackageInstaller.Session.SetChecksums Method

Definition

Sets installer-provided checksums for the APK file in session.

[Android.Runtime.Register("setChecksums", "(Ljava/lang/String;Ljava/util/List;[B)V", "GetSetChecksums_Ljava_lang_String_Ljava_util_List_arrayBHandler", ApiSince=31)]
public virtual void SetChecksums (string name, System.Collections.Generic.IList<Android.Content.PM.Checksum> checksums, byte[]? signature);
[<Android.Runtime.Register("setChecksums", "(Ljava/lang/String;Ljava/util/List;[B)V", "GetSetChecksums_Ljava_lang_String_Ljava_util_List_arrayBHandler", ApiSince=31)>]
abstract member SetChecksums : string * System.Collections.Generic.IList<Android.Content.PM.Checksum> * byte[] -> unit
override this.SetChecksums : string * System.Collections.Generic.IList<Android.Content.PM.Checksum> * byte[] -> unit

Parameters

name
String

previously written as part of this session. #openWrite

checksums
IList<Checksum>

installer intends to make available via PackageManager#requestChecksums or #requestChecksums.

signature
Byte[]

DER PKCS#7 detached signature bytes over binary serialized checksums to enable integrity checking for the checksums or null for no integrity checking. PackageManager#requestChecksums will return the certificate used to create signature. Binary format for checksums: <pre>DataOutputStream dos; dos.writeInt(checksum.getType()); dos.writeInt(checksum.getValue().length); dos.write(checksum.getValue());</pre> If using <b>openssl cms</b>, make sure to specify -binary -nosmimecap.

Attributes

Remarks

Sets installer-provided checksums for the APK file in session.

This member is deprecated. do not use installer-provided checksums, use platform-enforced checksums e.g. Checksum#TYPE_WHOLE_MERKLE_ROOT_4K_SHA256 in PackageManager#requestChecksums.

Java documentation for android.content.pm.PackageInstaller.Session.setChecksums(java.lang.String, java.util.List<android.content.pm.Checksum>, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to