次の方法で共有


PackageManager.SetInstallerPackageName(String, String) Method

Definition

Change the installer associated with a given package.

[Android.Runtime.Register("setInstallerPackageName", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetInstallerPackageName_Ljava_lang_String_Ljava_lang_String_Handler")]
public abstract void SetInstallerPackageName (string targetPackage, string? installerPackageName);
[<Android.Runtime.Register("setInstallerPackageName", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetInstallerPackageName_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member SetInstallerPackageName : string * string -> unit

Parameters

targetPackage
String

The installed package whose installer will be changed.

installerPackageName
String

The package name of the new installer. May be null to clear the association.

Attributes

Remarks

Change the installer associated with a given package. There are limitations on how the installer package can be changed; in particular: <ul> <li> A SecurityException will be thrown if <var>installerPackageName</var> is not signed with the same certificate as the calling application. <li> A SecurityException will be thrown if <var>targetPackage</var> already has an installer package, and that installer package is not signed with the same certificate as the calling application. </ul>

Java documentation for android.content.pm.PackageManager.setInstallerPackageName(java.lang.String, java.lang.String).

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