@Implements(value=android.content.pm.PackageParser.class, isInAndroidSdk=false) public class ShadowPackageParser extends java.lang.Object
Shadow for PackageParser
Constructor and Description |
---|
ShadowPackageParser() |
Modifier and Type | Method and Description |
---|---|
static android.content.pm.PackageParser.Package |
callParsePackage(FsFile manifestFile)
Parses an AndroidManifest.xml file using the framework PackageParser.
|
static java.lang.Object |
parseApkLite(java.io.File apkFile,
int flags) |
android.content.pm.PackageParser.Package |
parseBaseApk(java.io.File apkFile,
android.content.res.AssetManager assets,
int flags) |
android.os.Bundle |
parseMetaData(android.content.res.Resources res,
org.xmlpull.v1.XmlPullParser parser,
android.util.AttributeSet attrs,
android.os.Bundle data,
java.lang.String[] outError) |
android.content.pm.PackageParser.Package |
parsePackage(java.io.File sourceFile,
java.lang.String destCodePath,
android.util.DisplayMetrics metrics,
int flags)
We only need to implement this method because the framework expects the AndroidManifest.xml file to exist in the root of the apk.
|
public static android.content.pm.PackageParser.Package callParsePackage(FsFile manifestFile)
Parses an AndroidManifest.xml file using the framework PackageParser.
@Implementation(minSdk=16, maxSdk=19) public android.content.pm.PackageParser.Package parsePackage(java.io.File sourceFile, java.lang.String destCodePath, android.util.DisplayMetrics metrics, int flags)
We only need to implement this method because the framework expects the AndroidManifest.xml file to exist in the root of the apk. We can’t set the field statically since its final and therefore inlined by the compiler. We should be able to remove this method and others below for other framework versions if we move to a model that mirrors what the framework expects, e.g: the AndroidManifest.xml at the root of the resources.ap_
@Implementation public android.os.Bundle parseMetaData(android.content.res.Resources res, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs, android.os.Bundle data, java.lang.String[] outError) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
@Implementation(minSdk=21) public android.content.pm.PackageParser.Package parseBaseApk(java.io.File apkFile, android.content.res.AssetManager assets, int flags)
@Implementation(minSdk=24) public static java.lang.Object parseApkLite(java.io.File apkFile, int flags)