AaptParser

public class AaptParser
extends Object

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


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

aapt 必须位于 PATH 中

摘要

公共方法

String getLabel()
List<String> 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 中的信息。

公共方法

getLabel

public String getLabel ()

返回
String

getNativeCode

public List<String> getNativeCode ()

返回
List<String>

getPackageName

public String getPackageName ()

返回
String

getSdkVersion

public int getSdkVersion ()

返回
int

getTargetSdkVersion

public int getTargetSdkVersion ()

返回
int

getVersionCode

public String getVersionCode ()

返回
String

getVersionName

public String getVersionName ()

返回
String

isRequestingLegacyStorage

public boolean isRequestingLegacyStorage ()

检查应用是否请求旧版存储空间。

返回
boolean 如果 AndroidManifest.xml 中的 requestLegacyExternalStorage 为 true,则返回 true

isUsingPermissionManageExternalStorage

public boolean isUsingPermissionManageExternalStorage ()

返回
boolean

parse

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

解析 APK 中的信息。

参数
apkFile File:APK 文件

aaptVersion AaptParser.AaptVersion:aapt 版本

返回
AaptParser 如果提取信息失败,则返回 AaptParsernull

parse

public static AaptParser parse (File apkFile)

解析 APK 中的信息。

参数
apkFile File:APK 文件

返回
AaptParser 如果提取信息失败,则返回 AaptParsernull