/**@class android.content.pm.PackageParser @extends java.lang.Object Parser for package files (APKs) on disk. This supports apps packaged either as a single "monolithic" APK, or apps packaged as a "cluster" of multiple APKs in a single directory. <p> Apps packaged as multiple APKs always consist of a single "base" APK (with a {@code null} split name) and zero or more "split" APKs (with unique split names). Any subset of those split APKs are a valid install, as long as the following constraints are met: <ul> <li>All APKs must have the exact same package name, version code, and signing certificates. <li>All APKs must have unique split names. <li>All installations must contain a single base APK. </ul> @hide */ var PackageParser = { /**File name in an APK for the Android manifest. */ ANDROID_MANIFEST_FILENAME : "AndroidManifest.xml", /** Total number of packages that were read from the cache. We use it only for logging. */ sCachedPackageReadCount : "null", /**@hide */ APK_FILE_EXTENSION : ".apk", /** List of new permissions that have been added since 1.0. NOTE: These must be declared in SDK version order, with permissions added to older SDKs appearing before those added to newer SDKs. If sdkVersion is 0, then this is not a permission that we want to automatically add to older apps, but we do want to allow it to be granted during a platform update. @hide */ NEW_PERMISSIONS : "null", /***/ PARSE_MUST_BE_APK : "1", /***/ PARSE_IGNORE_PROCESSES : "2", /***/ PARSE_EXTERNAL_STORAGE : "8", /***/ PARSE_IS_SYSTEM_DIR : "16", /***/ PARSE_COLLECT_CERTIFICATES : "32", /***/ PARSE_ENFORCE_CODE : "64", /***/ PARSE_CHATTY : "-2147483648", /** */ setSeparateProcesses : function( ) {}, /**Flag indicating this parser should only consider apps with {@code coreApp} manifest attribute to be valid apps. This is useful when creating a minimalist boot environment. */ setOnlyCoreApps : function( ) {}, /** */ setDisplayMetrics : function( ) {}, /**Sets the cache directory for this package parser. */ setCacheDir : function( ) {}, /**Set the {@link android.content.pm.LauncherApps.Callback} that can be used while parsing. */ setCallback : function( ) {}, /** */ isApkFile : function( ) {}, /** */ isApkPath : function( ) {}, /**Generate and return the {@link android.content.pm.PackageParser.PackageInfo} for a parsed package. @param {Object {PackageParser.Package}} p the parsed package. @param {Object {int[]}} flags indicating which optional information is included. */ generatePackageInfo : function( ) {}, /** */ isAvailable : function( ) {}, /** */ generatePackageInfo : function( ) {}, /**Parse only lightweight details about the package at the given location. Automatically detects if the package is a monolithic style (single APK file) or cluster style (directory of APKs). <p> This performs sanity checking on cluster style packages, such as requiring identical package name and version codes, a single base APK, and unique split names. @see PackageParser#parsePackage(File, int) */ parsePackageLite : function( ) {}, /**Parse the package at the given location. Automatically detects if the package is a monolithic style (single APK file) or cluster style (directory of APKs). <p> This performs sanity checking on cluster style packages, such as requiring identical package name and version codes, a single base APK, and unique split names. <p> Note that this <em>does not</em> perform signature verification; that must be done separately in {@link #collectCertificates(Package, int)}. If {@code useCaches} is true, the package parser might return a cached result from a previous parse of the same {@code packageFile} with the same {@code flags}. Note that this method does not check whether {@code packageFile} has changed since the last parse, it's up to callers to do so. @see #parsePackageLite(File, int) */ parsePackage : function( ) {}, /**Equivalent to {@link #parsePackage(File, int, boolean)} with {@code useCaches == false}. */ parsePackage : function( ) {}, /**static version of {@link #fromCacheEntry} for unit tests. */ fromCacheEntryStatic : function( ) {}, /**static version of {@link #toCacheEntry} for unit tests. */ toCacheEntryStatic : function( ) {}, /**Parse the given APK file, treating it as as a single monolithic package. <p> Note that this <em>does not</em> perform signature verification; that must be done separately in {@link #collectCertificates(Package, int)}. @deprecated external callers should move to {@link #parsePackage(File, int)}. Eventually this method will be marked private. */ parseMonolithicPackage : function( ) {}, /**Parses the public keys from the set of signatures. */ toSigningKeys : function( ) {}, /**Collect certificates from all the APKs described in the given package, populating {@link android.content.pm.PackageParser.Package#mSigningDetails}. Also asserts that all APK contents are signed correctly and consistently. */ collectCertificates : function( ) {}, /**Utility method that retrieves lightweight details about a single APK file, including package name, split name, and install location. @param {Object {File}} apkFile path to a single APK @param {Number} flags optional parse flags, such as {@link #PARSE_COLLECT_CERTIFICATES} */ parseApkLite : function( ) {}, /**Utility method that retrieves lightweight details about a single APK file, including package name, split name, and install location. @param {Object {FileDescriptor}} fd already open file descriptor of an apk file @param {String} debugPathName arbitrary text name for this file, for debug output @param {Number} flags optional parse flags, such as {@link #PARSE_COLLECT_CERTIFICATES} */ parseApkLite : function( ) {}, /**Computes the targetSdkVersion to use at runtime. If the package is not compatible with this platform, populates {@code outError[0]} with an error message. <p> If {@code targetCode} is not specified, e.g. the value is {@code null}, then the {@code targetVers} will be returned unmodified. <p> Otherwise, the behavior varies based on whether the current platform is a pre-release version, e.g. the {@code platformSdkCodenames} array has length > 0: <ul> <li>If this is a pre-release platform and the value specified by {@code targetCode} is contained within the array of allowed pre-release codenames, this method will return {@link Build.VERSION_CODES#CUR_DEVELOPMENT}. <li>If this is a released platform, this method will return -1 to indicate that the package is not compatible with this platform. </ul> @param {Number} targetVers targetSdkVersion number, if specified in the application manifest, or 0 otherwise @param {String} targetCode targetSdkVersion code, if specified in the application manifest, or {@code null} otherwise @param {Object {java.lang.String[]}} platformSdkCodenames array of allowed pre-release SDK codenames for this platform @param {Object {java.lang.String[]}} outError output array to populate with error, if applicable @return {Number} the targetSdkVersion to use at runtime, or -1 if the package is not compatible with this platform @hide Exposed for unit testing only. */ computeTargetSdkVersion : function( ) {}, /**Computes the minSdkVersion to use at runtime. If the package is not compatible with this platform, populates {@code outError[0]} with an error message. <p> If {@code minCode} is not specified, e.g. the value is {@code null}, then behavior varies based on the {@code platformSdkVersion}: <ul> <li>If the platform SDK version is greater than or equal to the {@code minVers}, returns the {@code mniVers} unmodified. <li>Otherwise, returns -1 to indicate that the package is not compatible with this platform. </ul> <p> Otherwise, the behavior varies based on whether the current platform is a pre-release version, e.g. the {@code platformSdkCodenames} array has length > 0: <ul> <li>If this is a pre-release platform and the value specified by {@code targetCode} is contained within the array of allowed pre-release codenames, this method will return {@link Build.VERSION_CODES#CUR_DEVELOPMENT}. <li>If this is a released platform, this method will return -1 to indicate that the package is not compatible with this platform. </ul> @param {Number} minVers minSdkVersion number, if specified in the application manifest, or 1 otherwise @param {String} minCode minSdkVersion code, if specified in the application manifest, or {@code null} otherwise @param {Number} platformSdkVersion platform SDK version number, typically Build.VERSION.SDK_INT @param {Object {java.lang.String[]}} platformSdkCodenames array of allowed prerelease SDK codenames for this platform @param {Object {java.lang.String[]}} outError output array to populate with error, if applicable @return {Number} the minSdkVersion to use at runtime, or -1 if the package is not compatible with this platform @hide Exposed for unit testing only. */ computeMinSdkVersion : function( ) {}, /** @param {Number} configChanges The bit mask of configChanges fetched from AndroidManifest.xml. @param {Number} recreateOnConfigChanges The bit mask recreateOnConfigChanges fetched from AndroidManifest.xml. @hide Exposed for unit testing only. */ getActivityConfigChanges : function( ) {}, /** */ parsePublicKey : function( ) {}, /** */ generateApplicationInfo : function( ) {}, /** */ generateApplicationInfo : function( ) {}, /** */ generateApplicationInfo : function( ) {}, /** */ generatePermissionInfo : function( ) {}, /** */ generatePermissionGroupInfo : function( ) {}, /** */ generateActivityInfo : function( ) {}, /** */ generateActivityInfo : function( ) {}, /** */ generateServiceInfo : function( ) {}, /** */ generateProviderInfo : function( ) {}, /** */ generateInstrumentationInfo : function( ) {}, /** @hide */ setCompatibilityModeEnabled : function( ) {}, /** @hide */ readConfigUseRoundIcon : function( ) {}, /**PackageInfo parser specifically for apex files. NOTE: It will collect certificates @param {Object {ApexInfo}} apexInfo @return {Object {android.content.pm.PackageInfo}} PackageInfo @throws PackageParserException */ generatePackageInfoFromApex : function( ) {}, };