解析器

public class AaptParser
extends Object

java.lang.Object
com.android.tradefed.util.AaptParser


通过解析“aapt dump badging”的输出从 apk 中提取信息的类。

aapt 必须位于 PATH 上

概括

公共方法

String getLabel ()
getNativeCode ()
String getPackageName ()
int getSdkVersion ()
int getTargetSdkVersion ()
String getVersionCode ()
String getVersionName ()
boolean isRequestingLegacyStorage ()

检查应用程序是否正在请求旧存储。

boolean isUsingPermissionManageExternalStorage ()
static AaptParser parse (File apkFile, AaptParser.AaptVersion aaptVersion)

从 apk 中解析信息。

static AaptParser parse (File apkFile)

从 apk 中解析信息。

公共方法

获取标签

public String getLabel ()

退货
String

获取本地代码

public  getNativeCode ()

退货

获取包名

public String getPackageName ()

退货
String

获取SDK版本

public int getSdkVersion ()

退货
int

获取目标SdkVersion

public int getTargetSdkVersion ()

退货
int

获取版本号

public String getVersionCode ()

退货
String

获取版本名称

public String getVersionName ()

退货
String

正在请求旧存储

public boolean isRequestingLegacyStorage ()

检查应用程序是否正在请求旧存储。

退货
boolean如果 AndroidManifest.xml 中的 requestLegacyExternalStorage 为 true,则返回 true 布尔值

isUsingPermissionManageExternalStorage

public boolean isUsingPermissionManageExternalStorage ()

退货
boolean

解析

public static AaptParser parse (File apkFile, 
                AaptParser.AaptVersion aaptVersion)

从 apk 中解析信息。

参数
apkFile File :apk文件

aaptVersion AaptParser.AaptVersion :aapt 版本

退货
AaptParser如果提取信息失败,则AaptParsernull

解析

public static AaptParser parse (File apkFile)

从 apk 中解析信息。

参数
apkFile File :apk文件

退货
AaptParser如果提取信息失败,则AaptParsernull