解析器
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 |
取得本地代碼
publicgetNativeCode ()
退貨 | |
---|---|
取得包名
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 | 如果提取資訊失敗,則AaptParser 或null |
解析
public static AaptParser parse (File apkFile)
從 apk 解析資訊。
參數 | |
---|---|
apkFile | File :apk文件 |
退貨 | |
---|---|
AaptParser | 如果提取資訊失敗,則AaptParser 或null |