PackageUtils
PackageInfo
Methods:
- GetActivityInfo (Index As Int) As ActivInfo
- GetApplicationInfo As AppInfo
- GetConfigPrefInfo (Index As Int) As ConfigPrefInfo
- GetProviderName (Index As Int) As String
- GetReceiverInfo (Index As Int) As RecvrInfo
- GetRequestedFeatureName (Index As Int) As String
- GetServiceName (Index As Int) As String
- GetSignatureArray (Index As Int) As Byte[]
- GetSignatureString (Index As Int) As String
- IsProviderEnabled (Index As Int) As Boolean
- IsServiceEnabled (Index As Int) As Boolean
Properties:
- FirstInstallTime As Long [read only]
- LastUpdateTime As Long [read only]
- NumberOfActivities As Int [read only]
- NumberOfConfigPreferences As Int [read only]
- NumberOfProviders As Int [read only]
- NumberOfReceivers As Int [read only]
- NumberOfRequestedFeatures As Int [read only]
- NumberOfServices As Int [read only]
- NumberOfSignatures As Int [read only]
- PackageName As String [read only]
- RequestedPermissions() As String [read only]
- VersionCode As Int [read only]
- VersionName As String [read only]
PackageUtils
Fields:
- COMPONENT_STATE_DEFAULT As Int
- COMPONENT_STATE_DISABLED As Int
- COMPONENT_STATE_ENABLED As Int
- FEATURE_AUDIO_LOW_LATENCY As String
- FEATURE_BLUETOOTH As String
- FEATURE_CAMERA As String
- FEATURE_CAMERA_AUTOFOCUS As String
- FEATURE_CAMERA_FLASH As String
- FEATURE_CAMERA_FRONT As String
- FEATURE_LIVE_WALLPAPER As String
- FEATURE_LOCATION As String
- FEATURE_LOCATION_GPS As String
- FEATURE_LOCATION_NETWORK As String
- FEATURE_MICROPHONE As String
- FEATURE_NFC As String
- FEATURE_SENSOR_ACCELEROMETER As String
- FEATURE_SENSOR_BAROMETER As String
- FEATURE_SENSOR_COMPASS As String
- FEATURE_SENSOR_GYROSCOPE As String
- FEATURE_SENSOR_LIGHT As String
- FEATURE_SENSOR_PROXIMITY As String
- FEATURE_SIP As String
- FEATURE_SIP_VOIP As String
- FEATURE_TELEPHONY As String
- FEATURE_TELEPHONY_CDMA As String
- FEATURE_TELEPHONY_GSM As String
- FEATURE_TOUCHSCREEN As String
- FEATURE_TOUCHSCREEN_MULTITOUCH As String
- FEATURE_TOUCHSCREEN_MULTITOUCH_2_OR_MORE As String
- FEATURE_TOUCHSCREEN_MULTITOUCH_5_OR_MORE As String
- FEATURE_WIFI As String
- GET_ACTIVITIES As Int
- GET_ALL As Int
- GET_ALL_APPLICATION_INFO As Int
GET_CONFIGURATIONS + GET_PERMISSIONS + GET_SHARED_LIBRARY_FILES + GET_SIGNATURES
- GET_ALL_COMPONENTS As Int
GET_ACTIVITIES + GET_PROVIDERS + GET_RECEIVERS + GET_SERVICES
- GET_BASIC_INFO As Int
- GET_CONFIGURATIONS As Int
- GET_PERMISSIONS As Int
- GET_PROVIDERS As Int
- GET_RECEIVERS As Int
- GET_SERVICES As Int
- GET_SHARED_LIBRARY_FILES As Int
- GET_SIGNATURES As Int
- SIGNATURE_MATCH As Int
- SIGNATURE_NO_MATCH As Int
- SIGNATURE_UNKNOWN_PACKAGE As Int
Methods:
- CheckSignatures (Pkg1 As String, Pkg2 As String) As Int
Compares the signatures of two packages to determine if the same signature appears in both of them. If they do contain the same signature, then they are allowed special privileges when working with each other.
Returns an integer indicating whether all signatures on the two packages match. The value is >= 0 (SIGNATURE_MATCH) if all signatures match or < 0 if there is not a match (SIGNATURE_NO_MATCH or SIGNATURE_UNKNOWN_PACKAGE).
- ClearPackagePreferredActivities (PackageName As String)
Removes all preferred activity mappings from the system whose activities are implemented in the given package name. An application can only clear its own package(s).
- GetActivityIcon (PackageName As String, ActivityName As String) As Drawable
Retrieves the icon associated with the specified activity.
PackageName: The full name (e.g. com.google.apps.contacts) of the application.
ActivityName: The full name of the activity inside the package.
- GetActivityIcon2 (Intent As Intent) As Drawable
Retrieves the icon associated with the specified intent.
- GetApplicationIcon (Package As String) As Drawable
Retrieves the application icon for the specified package.
- GetApplicationInfo (PackageName As String) As AppInfo
Retrieves all of the information about a particular application.
- GetApplicationLabel (Package As String) As String
Retrieves the application label for the specified package.
- GetComponentEnabled (CompName As String) As Int
Returns the enabled setting for the specified package component (activity, receiver, service, provider). This returns the last value set by SetComponentEnabled; in most cases this value will be COMPONENT_STATE_DEFAULT since the value originally specified in the manifest has not been modified.
- GetDefaultActivityIcon As Drawable
Returns the generic icon for an activity that is used when no specific icon is defined.
- GetInstalledPackages (Flags As Int) As List
Returns a list containing all packages that are installed on the device. Each item of the list is a PackageInfo object.
Flags: Option flags. Use any combination of the GET_ constants, e.g. Bit.OR(PU.GET_ACTIVITIES, PU.GET_PERMISSIONS).
- GetInstallerPackageName (PackageName As String) As String
Retrieves the package name of the application that installed a package. This identifies which market the package came from.
- GetIntentCategories (Intent As Intent) As String[]
Returns an array containing the categories of the specified intent.
- GetIntentComponentName (Intent As Intent) As String
Returns the package and class names of the specified intent.
- GetLaunchIntent (Package As String) As IntentWrapper
Returns a "good" launch intent for the specified package. This fully-qualified intent can be used to launch the main activity in the package.
- GetMyPackageName As String
Returns the package name of this application.
- GetPackageInfo (PackageName As String, Flags As Int) As PkgInfo
Retrieves overall information about an application package that is installed on the system.
Flags: Option flags. Use any combination of the GET_ constants, e.g. Bit.OR(PU.GET_ACTIVITIES, PU.GET_PERMISSIONS).
- GetPreferredActivities (PackageName As String) As List
Retrieves all preferred activities that are currently registered with the system. Each item of the list is a PkgPreferredActivity object.
PackageName: An optional package in which you would like to limit the list. If null or empty, all activities will be returned; otherwise only those activities in the given package are returned.
- GetSystemAvailableFeatures As List
Gets a list of features that are available on the system.
- HasPermission (PkgName As String, PermName As String) As Boolean
Checks whether a particular package has been granted a particular permission.
PkgName: The name of the package you are checking against.
PermName: The name of the permission you are checking for.
- HasSystemFeature (Feature As String) As Boolean
Checks whether the given feature name is one of the available features as returned by GetSystemAvailableFeatures.
- QueryBroadcastReceivers (Intent As Intent) As List
Retrieves all receivers that can handle a broadcast of the given intent. Returns a list ordered from first to last in priority.
- QueryIntentActivities (Intent As Intent) As List
Retrieves all activities that can be performed for the given intent. Returns a list ordered from best to worst match.
- SetComponentEnabled (CompName As String, NewState As Int, KillApp As Boolean)
Sets the enabled setting for a package component (activity, receiver, service, provider). This setting will override any enabled state which may have been set by the component in its manifest.
CompName: The component to enable.
NewState: The new enabled state for the component (one of the COMPONENT_STATE_ constants). COMPONENT_STATE_DEFAULT removes the setting, thereby restoring the component state to whatever was set in its manifest (or enabled, by default).
KillApp: Whether the application containing the component has to be killed. Be careful when you set this to False since changing component states can make the containing application's behavior unpredictable.
Properties:
- InternalPackageManager As PackageManager [read only]
PkgActivityInfo
Fields:
- CONFIG_FONT_SCALE As Int
- CONFIG_KEYBOARD As Int
- CONFIG_KEYBOARD_HIDDEN As Int
- CONFIG_LOCALE As Int
- CONFIG_MCC As Int
- CONFIG_MNC As Int
- CONFIG_NAVIGATION As Int
- CONFIG_ORIENTATION As Int
- CONFIG_SCREEN_LAYOUT As Int
- CONFIG_TOUCHSCREEN As Int
- CONFIG_UI_MODE As Int
- FLAG_ALLOW_TASK_REPARENTING As Int
- FLAG_ALWAYS_RETAIN_TASK_STATE As Int
- FLAG_CLEAR_TASK_ON_LAUNCH As Int
- FLAG_EXCLUDE_FROM_RECENTS As Int
- FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS As Int
- FLAG_FINISH_ON_TASK_LAUNCH As Int
- FLAG_HARDWARE_ACCELERATED As Int
- FLAG_IMMERSIVE As Int
- FLAG_MULTIPROCESS As Int
- FLAG_NO_HISTORY As Int
- FLAG_STATE_NOT_NEEDED As Int
- LAUNCH_MULTIPLE As Int
- LAUNCH_SINGLE_INSTANCE As Int
- LAUNCH_SINGLE_TASK As Int
- LAUNCH_SINGLE_TOP As Int
- SCREEN_ORIENTATION_BEHIND As Int
- SCREEN_ORIENTATION_FULL_SENSOR As Int
- SCREEN_ORIENTATION_LANDSCAPE As Int
- SCREEN_ORIENTATION_LOCKED As Int
- SCREEN_ORIENTATION_NOSENSOR As Int
- SCREEN_ORIENTATION_PORTRAIT As Int
- SCREEN_ORIENTATION_REVERSE_LANDSCAPE As Int
- SCREEN_ORIENTATION_REVERSE_PORTRAIT As Int
- SCREEN_ORIENTATION_SENSOR As Int
- SCREEN_ORIENTATION_SENSOR_LANDSCAPE As Int
- SCREEN_ORIENTATION_SENSOR_PORTRAIT As Int
- SCREEN_ORIENTATION_UNSPECIFIED As Int
- SCREEN_ORIENTATION_USER As Int
Methods:
- IsEnabled As Boolean
- IsExported As Boolean
Properties:
- ConfigChanges As Int [read only]
- Flags As Int [read only]
- LaunchMode As Int [read only]
- Name As String [read only]
- Permission As String [read only]
- ScreenOrientation As Int [read only]
- SoftInputMode As Int [read only]
- TargetActivity As String [read only]
- TaskAffinity As String [read only]
- ThemeResource As Int [read only]
PkgApplicationInfo
Fields:
- FLAG_ALLOW_BACKUP As Int
- FLAG_ALLOW_CLEAR_USER_DATA As Int
- FLAG_ALLOW_TASK_REPARENTING As Int
- FLAG_DEBUGGABLE As Int
- FLAG_EXTERNAL_STORAGE As Int
- FLAG_PERSISTENT As Int
- FLAG_RESIZEABLE_FOR_SCREENS As Int
- FLAG_SUPPORTS_LARGE_SCREENS As Int
- FLAG_SUPPORTS_NORMAL_SCREENS As Int
- FLAG_SUPPORTS_SCREEN_DENSITIES As Int
- FLAG_SUPPORTS_SMALL_SCREENS As Int
- FLAG_SYSTEM As Int
- FLAG_TEST_ONLY As Int
- FLAG_UPDATED_SYSTEM_APP As Int
- FLAG_VM_SAFE_MODE As Int
Methods:
Properties:
- DataDir As String [read only]
- Description As String [read only]
- Flags As Int [read only]
- NativeLibraryDir As String [read only]
- SharedLibraryFiles() As String [read only]
- SourceDir As String [read only]
- TargetSdkVersion As Int [read only]
- TaskAffinity As String [read only]
PkgConfigPrefInfo
Fields:
- GL_ES_VERSION_UNDEFINED As Int
Properties:
- GlEsVersion As String [read only]
- ReqGlEsVersion As Int [read only]
- ReqInputFeatures As Int [read only]
- ReqKeyboardType As Int [read only]
- ReqNavigation As Int [read only]
- ReqTouchScreen As Int [read only]
PkgPreferredActivity
Methods:
- GetAction (Index As Int) As String
- GetCategory (Index As Int) As String
- GetDataPath (Index As Int) As String
- GetDataScheme (Index As Int) As String
- GetDataType (Index As Int) As String
Properties:
- ClassName As String [read only]
- NumberOfActions As Int [read only]
- NumberOfCategories As Int [read only]
- NumberOfDataPaths As Int [read only]
- NumberOfDataSchemes As Int [read only]
- NumberOfDataTypes As Int [read only]
- PackageName As String [read only]
- Priority As Int [read only]
- ShortClassName As String [read only]
PkgReceiverInfo
Methods:
- IsEnabled As Boolean
- IsExported As Boolean
Properties:
- Name As String [read only]
- Permission As String [read only]
- ProcessName As String [read only]
Author: Frédéric Leneuf-Magaud