取得apk的套件名稱,權限,AndroidManifest.xml


參考https://elinux.org/Android_aapt

先安裝AAPT(Android Asset Packaging Tool)
Android SDK裏面有或者是安裝Ubuntu的套件
sudo apt-get install google-android-build-tools-installer

取得APK所需權限
aapt dump permissions {apk名稱}

package: apk的套件名稱
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.BLUETOOTH_ADMIN'
uses-permission: name='android.permission.ACCESS_COARSE_LOCATION'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'

取得APK的AndroidManifest.xml
aapt dump xmltree {apk名稱} AndroidManifest.xml

這指令會印出AndroidManifest.xml的內容,但是不是可以直接在Android stuido中可使用的xml檔案

取得APK的套件名稱,vesionCode,sdk,targetSdkVersion,uses-permission,uses-feature,locales,density等資訊
aapt dump badging {apk名稱}


showPermission(){
    aapt dump permissions $1
}
showManifest(){
    aapt dump xmltree $1 AndroidManifest.xml
}
showAppVersion(){
    aapt dump badging $1 | grep "version"
}

留言