Android 使用aapt工具获取apk信息

aapt 工具的官网说明 https://developer.android.google.cn/studio/command-line/aapt2?hl=zh_cn

功能有很多,本篇记录怎么使用aapt工具获取apk信息。

在 Aosp 源码下,

执行 source 、lunch 后,直接输入 aapt 就可以使用了。

不执行 source 、lunch ,也可以使用,要带上完整路径 ./prebuilts/sdk/tools/linux/bin/aapt

aapt help

输入 aapt help 或者 直接输入,不带参数,都会提示如下,

Android Asset Packaging Tool

Usage:
 aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.

 aapt d[ump] [--values] [--include-meta-data] WHAT file.{apk} [asset [asset ...]]
   strings          Print the contents of the resource table string pool in the APK.
   badging          Print the label and icon for the app declared in APK.
   permissions      Print the permissions from the APK.
   resources        Print the resource table from the APK.
   configurations   Print the configurations in the APK.
   xmltree          Print the compiled xmls in the given assets.
   xmlstrings       Print the strings of the given compiled xml assets.

 aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \
        [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \
        [--debug-mode] [--min-sdk-version VAL] [--target-sdk-version VAL] \
        [--app-version VAL] [--app-version-name TEXT] [--custom-package VAL] \
        [--rename-manifest-package PACKAGE] \
        [--rename-instrumentation-target-package PACKAGE] \
        [--utf16] [--auto-add-overlay] \
        [--max-res-version VAL] \
        [-I base-package [-I base-package ...]] \
        [-A asset-source-dir]  [-G class-list-file] [-P public-definitions-file] \
        [-D main-dex-class-list-file] \
        [-S resource-sources [-S resource-sources ...]] \
        [-F apk-file] [-J R-file-dir] \
        [--product product1,product2,...] \
        [-c CONFIGS] [--preferred-density DENSITY] \
        [--split CONFIGS [--split CONFIGS]] \
        [--feature-of package [--feature-after package]] \
        [raw-files-dir [raw-files-dir] ...] \
        [--output-text-symbols DIR]

   Package the android resources.  It will read assets and resources that are
   supplied with the -M -A -S or raw-files-dir arguments.  The -J -P -F and -R
   options control which files are output.

 aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
   Delete specified files from Zip-compatible archive.

 aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
   Add specified files to Zip-compatible archive.

 aapt c[runch] [-v] -S resource-sources ... -C output-folder ...
   Do PNG preprocessing on one or several resource folders
   and store the results in the output folder.

 aapt s[ingleCrunch] [-v] -i input-file -o outputfile
   Do PNG preprocessing on a single file.

 aapt v[ersion]
   Print program version.

 Modifiers:
   -a  print Android-specific data (resources, manifest) when listing
   -c  specify which configurations to include.  The default is all
       configurations.  The value of the parameter should be a comma
       separated list of configuration values.  Locales should be specified
       as either a language or language-region pair.  Some examples:
            en
            port,en
            port,land,en_US
   -d  one or more device assets to include, separated by commas
   -f  force overwrite of existing files
   -g  specify a pixel tolerance to force images to grayscale, default 0
   -j  specify a jar or zip file containing classes to include
   -k  junk path of file(s) added
   -m  make package directories under location specified by -J
   -u  update existing packages (add new, replace older, remove deleted files)
   -v  verbose output
   -x  create extending (non-application) resource IDs
   -z  require localization of resource attributes marked with
       localization="suggested"
   -A  additional directory in which to find raw asset files
   -G  A file to output proguard options into.
   -D  A file to output proguard options for the main dex into.
   -F  specify the apk file to output
   -I  add an existing package to base include set
   -J  specify where to output R.java resource constant definitions
   -M  specify full path to AndroidManifest.xml to include in zip
   -P  specify where to output public resource definitions
   -S  directory in which to find resources.  Multiple directories will be scanned
       and the first match found (left to right) will take precedence.
   -0  specifies an additional extension for which such files will not
       be stored compressed in the .apk.  An empty string means to not
       compress any files at all.
   --debug-mode
       inserts android:debuggable="true" in to the application node of the
       manifest, making the application debuggable even on production devices.
   --include-meta-data
       when used with "dump badging" also includes meta-data tags.
   --pseudo-localize
       generate resources for pseudo-locales (en-XA and ar-XB).
   --min-sdk-version
       inserts android:minSdkVersion in to manifest.  If the version is 7 or
       higher, the default encoding for resources will be in UTF-8.
   --target-sdk-version
       inserts android:targetSdkVersion in to manifest.
   --max-res-version
       ignores versioned resource directories above the given value.
   --values
       when used with "dump resources" also includes resource values.
   --version-code
       inserts android:versionCode in to manifest.
   --version-name
       inserts android:versionName in to manifest.
   --replace-version
       If --version-code and/or --version-name are specified, these
       values will replace any value already in the manifest. By
       default, nothing is changed if the manifest already defines
       these attributes.
   --custom-package
       generates R.java into a different package.
   --extra-packages
       generate R.java for libraries. Separate libraries with ':'.
   --generate-dependencies
       generate dependency files in the same directories for R.java and resource package
   --auto-add-overlay
       Automatically add resources that are only in overlays.
   --preferred-density
       Specifies a preference for a particular density. Resources that do not
       match this density and have variants that are a closer match are removed.
   --split
       Builds a separate split APK for the configurations listed. This can
       be loaded alongside the base APK at runtime.
   --feature-of
       Builds a split APK that is a feature of the apk specified here. Resources
       in the base APK can be referenced from the the feature APK.
   --feature-after
       An app can have multiple Feature Split APKs which must be totally ordered.
       If --feature-of is specified, this flag specifies which Feature Split APK
       comes before this one. The first Feature Split APK should not define
       anything here.
   --rename-manifest-package
       Rewrite the manifest so that its package name is the package name
       given here.  Relative class names (for example .Foo) will be
       changed to absolute names with the old package so that the code
       does not need to change.
   --rename-instrumentation-target-package
       Rewrite the manifest so that all of its instrumentation
       components target the given package.  Useful when used in
       conjunction with --rename-manifest-package to fix tests against
       a package that has been renamed.
   --product
       Specifies which variant to choose for strings that have
       product variants
   --utf16
       changes default encoding for resources to UTF-16.  Only useful when API
       level is set to 7 or higher where the default encoding is UTF-8.
   --non-constant-id
       Make the resources ID non constant. This is required to make an R java class
       that does not contain the final value but is used to make reusable compiled
       libraries that need to access resources.
   --shared-lib
       Make a shared library resource package that can be loaded by an application
       at runtime to access the libraries resources. Implies --non-constant-id.
   --app-as-shared-lib
       Make an app resource package that also can be loaded as shared library at runtime.
       Implies --non-constant-id.
   --error-on-failed-insert
       Forces aapt to return an error if it fails to insert values into the manifest
       with --debug-mode, --min-sdk-version, --target-sdk-version --version-code
       and --version-name.
       Insertion typically fails if the manifest already defines the attribute.
   --error-on-missing-config-entry
       Forces aapt to return an error if it fails to find an entry for a configuration.
   --output-text-symbols
       Generates a text file containing the resource symbols of the R class in the
       specified folder.
   --ignore-assets
       Assets to be ignored. Default pattern is:
       !.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~
   --skip-symbols-without-default-localization
       Prevents symbols from being generated for strings that do not have a default
       localization
   --no-version-vectors
       Do not automatically generate versioned copies of vector XML resources.
   --no-version-transitions
       Do not automatically generate versioned copies of transition XML resources.
   --private-symbols
       Java package name to use when generating R.java for private resources.

aapt dump

aapt dump strings

以 packages/apps/TvSettings/Settings 为例,
执行 aapt dump strings out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk

部分结果如下

String pool of 3476 unique UTF-8 non-sorted strings, 3476 entries and 0 styles using 127860 bytes:
String #0: res/anim/abc_fade_in.xml
String #1: res/anim/abc_fade_out.xml
String #2: res/anim/abc_grow_fade_in_from_bottom.xml
String #3: res/anim/abc_popup_enter.xml
String #4: res/anim/abc_popup_exit.xml
String #5: res/anim/abc_shrink_fade_out_from_bottom.xml
String #6: res/anim/abc_slide_in_bottom.xml
String #7: res/anim/abc_slide_in_top.xml
String #8: res/anim/abc_slide_out_bottom.xml
String #9: res/anim/abc_slide_out_top.xml
String #10: res/anim/abc_tooltip_enter.xml
String #11: res/anim/abc_tooltip_exit.xml
...
String #937: Bluetooth
String #938: Bluetooth AVRCP Version
String #939: Bluetooth Audio Bits Per Sample
String #940: Bluetooth Audio Channel Mode
String #941: Bluetooth Audio Codec
String #942: Bluetooth Audio LDAC Codec: Playback Quality
String #943: Bluetooth Audio Sample Rate
String #944: Bluetooth devices without names (MAC addresses only) will be displayed
String #945: Bluetooth tethering
String #946: Bug report shortcut
...
String #2156: 动画缩放 0.5x
String #2157: 动画缩放 1.5x
String #2158: 动画缩放 10x
String #2159: 动画缩放 1x
String #2160: 动画缩放 2x
String #2161: 动画缩放 5x
String #2162: 助听器
String #2163: 单声道
String #2164: 卧室电视
String #2165: 卸载
String #2166: 卸载更新
String #2167: 发现了一部设备,将会在%1$s秒后自动配对

aapt dump badging

执行 aapt dump badging out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk

得到 包名、lable 、versionCode 、versionName 、compileSdkVersion 、compileSdkVersionCodename 、sdkVersion 、targetSdkVersion 、申请的权限、uses-feature 、支持的语言和分辨率等信息。

运行结果,

package: name='com.android.tv.settings' versionCode='1' versionName='1.0' compileSdkVersion='29' compileSdkVersionCodename='10'
sdkVersion:'29'
targetSdkVersion:'29'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.BACKUP'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.BLUETOOTH_ADMIN'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.CLEAR_APP_USER_DATA'
uses-permission: name='android.permission.DELETE_CACHE_FILES'
uses-permission: name='android.permission.DUMP'
uses-permission: name='android.permission.FORCE_STOP_PACKAGES'
uses-permission: name='android.permission.GET_ACCOUNTS_PRIVILEGED'
uses-permission: name='android.permission.GET_PACKAGE_SIZE'
uses-permission: name='android.permission.INJECT_EVENTS'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.MANAGE_ACCOUNTS'
uses-permission: name='android.permission.MANAGE_DEBUGGING'
uses-permission: name='android.permission.MANAGE_SCOPED_ACCESS_DIRECTORY_PERMISSIONS'
uses-permission: name='android.permission.MANAGE_USERS'
uses-permission: name='android.permission.NETWORK_SETTINGS'
uses-permission: name='android.permission.OVERRIDE_WIFI_CONFIG'
uses-permission: name='android.permission.PEERS_MAC_ADDRESS'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.REBOOT'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.SET_PREFERRED_APPLICATIONS'
uses-permission: name='android.permission.SET_TIME'
uses-permission: name='android.permission.SET_TIME_ZONE'
uses-permission: name='android.permission.USE_RESERVED_DISK'
uses-permission: name='android.permission.WRITE_MEDIA_STORAGE'
uses-permission: name='android.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.WRITE_SECURE_SETTINGS'
uses-permission: name='android.permission.REQUEST_DELETE_PACKAGES'
uses-permission: name='com.google.android.assistant.READ_HOTWORD_STATE'
uses-permission: name='com.google.android.assistant.WRITE_HOTWORD_STATE'
application-label:'Settings'
application-label-zh-CN:'设置'
application-icon-160:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application-icon-240:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application-icon-320:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application-icon-640:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application-icon-65534:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application-icon-65535:'res/drawable-xhdpi-v4/logo_settings_color_48dp.png'
application: label='Settings' icon='res/drawable-xhdpi-v4/logo_settings_color_48dp.png' banner='res/drawable-xhdpi-v4/ic_launcher_banner_settings.png'
feature-group: label=''
  uses-feature: name='android.hardware.bluetooth'
  uses-implied-feature: name='android.hardware.bluetooth' reason='requested android.permission.BLUETOOTH permission, requested android.permission.BLUETOOTH_ADMIN permission, and targetSdkVersion > 4'
  uses-feature: name='android.hardware.faketouch'
  uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
  uses-feature: name='android.hardware.microphone'
  uses-implied-feature: name='android.hardware.microphone' reason='requested android.permission.RECORD_AUDIO permission'
  uses-feature: name='android.hardware.wifi'
  uses-implied-feature: name='android.hardware.wifi' reason='requested android.permission.ACCESS_WIFI_STATE permission, and requested android.permission.CHANGE_WIFI_STATE permission'
provides-component:'launcher'
main
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'zh-CN'
densities: '160' '240' '320' '640' '65534' '65535'

aapt dump permissions

执行 aapt dump permissions out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk

运行结果只包含包名和权限信息。

package: com.android.tv.settings
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.BACKUP'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.BLUETOOTH_ADMIN'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.CLEAR_APP_USER_DATA'
uses-permission: name='android.permission.DELETE_CACHE_FILES'
uses-permission: name='android.permission.DUMP'
uses-permission: name='android.permission.FORCE_STOP_PACKAGES'
uses-permission: name='android.permission.GET_ACCOUNTS_PRIVILEGED'
uses-permission: name='android.permission.GET_PACKAGE_SIZE'
uses-permission: name='android.permission.INJECT_EVENTS'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.MANAGE_ACCOUNTS'
uses-permission: name='android.permission.MANAGE_DEBUGGING'
uses-permission: name='android.permission.MANAGE_SCOPED_ACCESS_DIRECTORY_PERMISSIONS'
uses-permission: name='android.permission.MANAGE_USERS'
uses-permission: name='android.permission.NETWORK_SETTINGS'
uses-permission: name='android.permission.OVERRIDE_WIFI_CONFIG'
uses-permission: name='android.permission.PEERS_MAC_ADDRESS'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.REBOOT'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.SET_PREFERRED_APPLICATIONS'
uses-permission: name='android.permission.SET_TIME'
uses-permission: name='android.permission.SET_TIME_ZONE'
uses-permission: name='android.permission.USE_RESERVED_DISK'
uses-permission: name='android.permission.WRITE_MEDIA_STORAGE'
uses-permission: name='android.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.WRITE_SECURE_SETTINGS'
uses-permission: name='android.permission.REQUEST_DELETE_PACKAGES'
uses-permission: name='com.google.android.assistant.READ_HOTWORD_STATE'
uses-permission: name='com.google.android.assistant.WRITE_HOTWORD_STATE'

aapt dump resources

执行 aapt dump resources out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk

部分运行结果

Package Groups (1)
Package Group 0 id=0x7f packageCount=1 name=com.android.tv.settings
  Package 0 id=0x7f name=com.android.tv.settings
    type 0 configCount=1 entryCount=47
      spec resource 0x7f010000 com.android.tv.settings:anim/abc_fade_in: flags=0x00000000
      spec resource 0x7f010001 com.android.tv.settings:anim/abc_fade_out: flags=0x00000000
      spec resource 0x7f010002 com.android.tv.settings:anim/abc_grow_fade_in_from_bottom: flags=0x00000000
...

type 19 configCount=1 entryCount=47
      spec resource 0x7f140000 com.android.tv.settings:xml/about_legal: flags=0x00000000
      spec resource 0x7f140001 com.android.tv.settings:xml/accessibility: flags=0x00000000
      spec resource 0x7f140002 com.android.tv.settings:xml/accessibility_shortcut: flags=0x00000000
      spec resource 0x7f140003 com.android.tv.settings:xml/accessibility_shortcut_service: flags=0x00000000
      spec resource 0x7f140004 com.android.tv.settings:xml/account_preference: flags=0x00000000
      spec resource 0x7f140005 com.android.tv.settings:xml/accounts: flags=0x00000000
      spec resource 0x7f140006 com.android.tv.settings:xml/all_apps: flags=0x00000000
      spec resource 0x7f140007 com.android.tv.settings:xml/app_usage_access: flags=0x00000000
      spec resource 0x7f140008 com.android.tv.settings:xml/apps: flags=0x00000000
      spec resource 0x7f140009 com.android.tv.settings:xml/autofill_picker: flags=0x00000000
      spec resource 0x7f14000a com.android.tv.settings:xml/bluetooth_accessory: flags=0x00000000
      spec resource 0x7f14000b com.android.tv.settings:xml/caption: flags=0x00000000
      spec resource 0x7f14000c com.android.tv.settings:xml/caption_custom: flags=0x00000000
      spec resource 0x7f14000d com.android.tv.settings:xml/date_time: flags=0x00000000
      spec resource 0x7f14000e com.android.tv.settings:xml/daydream: flags=0x00000000
      spec resource 0x7f14000f com.android.tv.settings:xml/development_prefs: flags=0x00000000
      spec resource 0x7f140010 com.android.tv.settings:xml/development_prefs_not_available: flags=0x00000000
      spec resource 0x7f140011 com.android.tv.settings:xml/device: flags=0x00000000
      spec resource 0x7f140012 com.android.tv.settings:xml/device_info_settings: flags=0x00000000
      spec resource 0x7f140013 com.android.tv.settings:xml/device_info_status: flags=0x00000000
      spec resource 0x7f140014 com.android.tv.settings:xml/device_restricted: flags=0x00000000
      spec resource 0x7f140015 com.android.tv.settings:xml/directory_access: flags=0x00000000
      spec resource 0x7f140016 com.android.tv.settings:xml/directory_access_details: flags=0x00000000
      spec resource 0x7f140017 com.android.tv.settings:xml/file_paths: flags=0x00000000
      spec resource 0x7f140018 com.android.tv.settings:xml/help_and_feedback: flags=0x00000000
      spec resource 0x7f140019 com.android.tv.settings:xml/input_options: flags=0x00000000
      spec resource 0x7f14001a com.android.tv.settings:xml/inputs: flags=0x00000000
      spec resource 0x7f14001b com.android.tv.settings:xml/keyboard: flags=0x00000000
      spec resource 0x7f14001c com.android.tv.settings:xml/main_prefs: flags=0x00000000
      spec resource 0x7f14001d com.android.tv.settings:xml/manage_external_sources: flags=0x00000000
      spec resource 0x7f14001e com.android.tv.settings:xml/manage_high_power: flags=0x00000000
      spec resource 0x7f14001f com.android.tv.settings:xml/missing_storage: flags=0x00000000
      spec resource 0x7f140020 com.android.tv.settings:xml/network: flags=0x00000000
      spec resource 0x7f140021 com.android.tv.settings:xml/notification_access: flags=0x00000000
      spec resource 0x7f140022 com.android.tv.settings:xml/picture_in_picture: flags=0x00000000
      spec resource 0x7f140023 com.android.tv.settings:xml/remotes_and_accessories: flags=0x00000000
      spec resource 0x7f140024 com.android.tv.settings:xml/security: flags=0x00000000
      spec resource 0x7f140025 com.android.tv.settings:xml/sound: flags=0x00000000
      spec resource 0x7f140026 com.android.tv.settings:xml/special_app_access: flags=0x00000000
      spec resource 0x7f140027 com.android.tv.settings:xml/storage: flags=0x00000000
      spec resource 0x7f140028 com.android.tv.settings:xml/storage_summary: flags=0x00000000
      spec resource 0x7f140029 com.android.tv.settings:xml/system_alert_window: flags=0x00000000
      spec resource 0x7f14002a com.android.tv.settings:xml/timezones: flags=0x00000000
      spec resource 0x7f14002b com.android.tv.settings:xml/tts_engine_settings: flags=0x00000000
      spec resource 0x7f14002c com.android.tv.settings:xml/tts_settings: flags=0x00000000
      spec resource 0x7f14002d com.android.tv.settings:xml/wifi_details: flags=0x00000000
      spec resource 0x7f14002e com.android.tv.settings:xml/write_settings: flags=0x00000000
      config (default):
        resource 0x7f140000 com.android.tv.settings:xml/about_legal: t=0x03 d=0x000006c2 (s=0x0008 r=0x00)
        resource 0x7f140001 com.android.tv.settings:xml/accessibility: t=0x03 d=0x000006c3 (s=0x0008 r=0x00)
        resource 0x7f140002 com.android.tv.settings:xml/accessibility_shortcut: t=0x03 d=0x000006c4 (s=0x0008 r=0x00)
        resource 0x7f140003 com.android.tv.settings:xml/accessibility_shortcut_service: t=0x03 d=0x000006c5 (s=0x0008 r=0x00)

aapt dump configurations

执行 aapt dump configurations out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk

运行结果,

h720dp
sw360dp
sw600dp
sw720dp
watch
night
large
xlarge
ldrtl
port
land
hdpi
xhdpi
ldrtl-xhdpi
xxxhdpi
anydpi
nodpi
zh-rCN

aapt dump xmltree

执行 aapt dump xmltree out/target/product/<product_name>/system/priv-app/TvSettings/TvSettings.apk AndroidManifest.xml

得到 AndroidManifest.xml 文件中的信息

部分运行结果,

N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=2)
    A: android:sharedUserId(0x0101000b)="android.uid.system" (Raw: "android.uid.system")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1
    A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1d
    A: android:compileSdkVersionCodename(0x01010573)="10" (Raw: "10")
    A: package="com.android.tv.settings" (Raw: "com.android.tv.settings")
    A: platformBuildVersionCode=(type 0x10)0x1d
    A: platformBuildVersionName=(type 0x10)0xa
    E: uses-sdk (line=9)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1d
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1d
    E: uses-permission (line=13)
      A: android:name(0x01010003)="android.permission.ACCESS_WIFI_STATE" (Raw: "android.permission.ACCESS_WIFI_STATE")
...

    E: application (line=50)
      A: android:theme(0x01010000)=@0x7f1101bf
      A: android:label(0x01010001)=@0x7f10031d
      A: android:icon(0x01010002)=@0x7f0801b1
      A: android:allowClearUserData(0x01010005)=(type 0x12)0x0
      A: android:supportsRtl(0x010103af)=(type 0x12)0xffffffff
      A: android:banner(0x010103f2)=@0x7f0800b9
      A: android:extractNativeLibs(0x010104ea)=(type 0x12)0x0
      A: android:usesCleartextTraffic(0x010104ec)=(type 0x12)0xffffffff
      A: android:defaultToDeviceProtectedStorage(0x01010504)=(type 0x12)0xffffffff
      A: android:directBootAware(0x01010505)=(type 0x12)0xffffffff
      A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
      A: android:usesNonSdkApi(0x0101058e)=(type 0x12)0xffffffff
      E: activity (line=63)
        A: android:theme(0x01010000)=@0x7f1101c1
        A: android:label(0x01010001)=@0x7f10031d
        A: android:name(0x01010003)="com.android.tv.settings.MainSettings" (Raw: "com.android.tv.settings.MainSettings")
        A: android:excludeFromRecents(0x01010017)=(type 0x12)0xffffffff
        A: android:configChanges(0x0101001f)=(type 0x11)0x70
        E: intent-filter (line=69)
          E: action (line=70)
            A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
          E: action (line=71)
            A: android:name(0x01010003)="android.settings.SETTINGS" (Raw: "android.settings.SETTINGS")

...
      E: provider (line=823)
        A: android:name(0x01010003)="androidx.lifecycle.ProcessLifecycleOwnerInitializer" (Raw: "androidx.lifecycle.ProcessLifecycleOwnerInitializer")
        A: android:exported(0x01010010)=(type 0x12)0x0
        A: android:multiprocess(0x01010013)=(type 0x12)0xffffffff
        A: android:authorities(0x01010018)="com.android.tv.settings.lifecycle-tests" (Raw: "com.android.tv.settings.lifecycle-tests")
      E: receiver (line=830)
        A: android:name(0x01010003)="androidx.remotecallback.ProviderRelayReceiver" (Raw: "androidx.remotecallback.ProviderRelayReceiver")
      E: activity (line=832)
        A: android:name(0x01010003)="androidx.slice.compat.SlicePermissionActivity" (Raw: "androidx.slice.compat.SlicePermissionActivity")
        A: android:excludeFromRecents(0x01010017)=(type 0x12)0xffffffff

aapt dump xmlstrings

执行 aapt dump xmlstrings out/target/product//<product_name>/system/priv-app/TvSettings/TvSettings.apk AndroidManifest.xml

部分运行结果,

String #0: theme
String #1: label
String #2: icon
String #3: name
String #4: allowClearUserData
String #5: permission
String #6: sharedUserId
String #7: enabled
String #8: exported
String #9: process
String #10: taskAffinity
String #11: multiprocess
String #12: clearTaskOnLaunch
String #13: excludeFromRecents
String #14: authorities
String #15: grantUriPermissions
String #16: priority
String #17: launchMode
String #18: configChanges
String #19: resource
String #20: scheme

...

String #217: com.google.android.assistant.READ_HOTWORD_STATE
String #218: com.google.android.assistant.WRITE_HOTWORD_STATE
String #219: com.google.android.intent.action.CONNECT_INPUT
String #220: com.google.android.pano.action.SLEEP
String #221: com.google.android.tungsten.setupwraith.TV_SETTINGS_POST_SETUP
String #222: data
String #223: http://schemas.android.com/apk/res/android
String #224: intent-filter
String #225: manifest
String #226: meta-data
String #227: package
String #228: platformBuildVersionCode
String #229: platformBuildVersionName
String #230: provider
String #231: receiver
String #232: service
String #233: uses-permission
String #234: uses-sdk

猜你喜欢

转载自blog.csdn.net/weixin_44021334/article/details/134790257