summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
AgeCommit message (Collapse)Author
2021-05-10Fix aapt badging segmentation faultRyan Mitchell
Unsigned subtraction lead to arithmetic overflow which caused aapt to reference the vector out of its bounds. Bug: 175789289 Test: dump badging on a manifest with no uses-sdk tag Change-Id: Id1b96376a8bfe13c0c195bb6f62b681c3d686034
2021-05-03AAPT: Only print last uses-sdk tagRyan Mitchell
When an APK defines multiple "uses-sdk" tags, the Android runtime only uses the minSdkVersion and targetSdkVersion values from the last occurrence of the "uses-sdk" tag. For example an application with the following tags: <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/> <uses-sdk android:maxSdkVersion="28"/> Will have the following version codes at runtime: minSdk=1 targetSdk=1 Another example: <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/> <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/> Will have the following version codes at runtime: minSdk=5 targetSdk=19 AAPT must print the version data from only the last tag, skipping other occurrences of the tag. Bug: 175789289 Test: manual Change-Id: Ic855ff920d0b7abedd250d977bfa55189f4c8946
2019-10-17Allow for RRO internal referencingRyan Mitchell
This change allows RROs to reference their own internal resources as expected. Overlays are loaded as shared libraries so they can have their own resource id space that does not conflict with the resource id space of the target or other overlays. References to overlay resources that override target resources now appear as references to the target resources. Overlay values that are inlined into the xml file specified using android:overlayResources are now able to be used at runtime. See go/rro-references for more information. Bug: 135943783 Test: idmap2_tests Test: libandroidfw_tests Change-Id: Ie349c56d7fd3f7d94b7d595ed6d01dc6b59b6178
2017-12-04AAPT v1 embed compile SDK version and codename into appAlan Viverette
Also adds support for dumping compile SDK attributes. Bug: 63388434 Fixes: 68854953 Test: manual, compiled & dumped ApiDemos APK Change-Id: I2eef812bd957950cdef5f1257b73b57044a1e731
2017-10-12AAPT: treat "-I" with lower precedence than main APK for dumping.Donald Chai
This is the desired behavior if resource IDs may overlap, and also happens to improve the behavior of: aapt dump -I base.apk badging feature.apk when both APKs use the same package name with different package IDs (base=0x7F, feature=0x80). Previously, the final call to DynamicRefTable::addMapping was for base.apk, and all references to 0x80 were rewritten in DynamicRefTable::lookupResourceId to 0x7F. After this change resources defined in both APKs are resolved correctly. Note that this is a bit of kludge, and APKs should use different names to avoid conflating the package IDs. Fixes: 67070085 Bug: 64058531 Test: manual with sample in b/67070085#comment2 Change-Id: I285adb6f44a297440b08fc7a1f9ad73c700eb9bc
2017-09-08Don't compile libaapt with the build numberDan Willemsen
Only do that for the aapt binary itself. This will allow libaapt to be converted to Soong. Also remove a few lines that weren't doing anything: aaptCppflags was never set, LOCAL_C_INCLUDES := $(LOCAL_PATH) is implied. Test: m aapt Test: aapt version Change-Id: Ia3bcece14921417e1bfd3406630961c013bd497c
2017-05-10AAPT: Allow including dependencies in dump commandAdam Lesinski
Feature splits depend on their base. The dump badging command does resource resolution, and needs to be able to find resources located in the base APK of a feature split. Bug: 38038608 Test: manual Change-Id: I8c22f0083c46a853a3a56a4049715409ac2723fe
2017-03-21Revert "AAPT: Version <adaptive-icon> to v26"Guang Zhu
Bug: 36462965 Bug: 35908647 This reverts commit c7614e5d1e8f9139cccf6ab9b78dda16b98f7656. Change-Id: I25279e7c53823dad0703c7e2ea8ff91bdbc1a0f2
2017-03-16AAPT: Version <adaptive-icon> to v26Adam Lesinski
Bug: 35908647 Change-Id: I307fb2f666cb8519adb9a7f676b87706dc6c683f Test: manual
2017-03-01Implement issue #34842682: Add ability to limit permissions based on featuresDianne Hackborn
Two new attributes for <uses-permission>: android:requiredFeature and android:requiredNotFeature. Also update aapt to include this information in badging: uses-permission: name='android.content.cts.REQUIRED_NOT_FEATURE_UNDEFINED' requiredNotFeature='android.software.cts.undefined' uses-permission: name='android.content.cts.REQUIRED_MULTI_DENY' requiredFeature='android.software.cts.undefined' requiredNotFeature='android.software.cts' Test: new PermissionFeatureTest suite. Change-Id: Icc1f815a4675ae9dd2cb7f61730ab28b5c11228a
2016-12-28AAPT: Dump maxSdkVersion for implicit permissionsAdam Lesinski
Bug: 32599997 Test: Manual Change-Id: I13bdcf097625e3cb5fb35da1eb2544b0f8906e79
2016-11-02AAPT: fix error messageAdam Lesinski
Test: none Bug:9779154 Change-Id: Iebda7d4f0061cdc51db0103977195964fcc1211d
2016-10-03Remove unused methods from AssetManager.cppAdam Lesinski
A lot of the vendor/locale specific code existed pre-1.0 and was reworked into the current system. Test: refactoring CL, all code except setLocale() was not being executed. Test: setLocale() change tested manually Change-Id: Ifb098f9808763a6cf5fb4336e089430adc09e198
2016-09-22AAPT: Don't imply specific location hardware for dump badging am: 43158773b4 ↵Adam Lesinski
am: 7f56759cfd am: 5c60cb9208 Change-Id: I7251036c3212a576fb68023d05687d0e10a9f6b5
2016-09-22AAPT: Don't imply specific location hardware for dump badging am: 43158773b4Adam Lesinski
am: 7f56759cfd Change-Id: Id54d729793267634f1ade9073395ed6d6921ce60
2016-09-21AAPT: Don't imply specific location hardware for dump badgingAdam Lesinski
Permissions such as android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION assumed the underlying feature technology and aapt dump badging would emit an implied feature. This is no longer accurate, so the only implied feature is on the general android.hardware.location when the target SDK of the app is 21+. Bug:25218770 Change-Id: Ica9ebf7d4f360b137af54a8c8fd6c0358cd9be6a
2016-08-12resolve merge conflicts of 17bd236 to stage-aosp-master am: b3d46b44a3Chih-Hung Hsieh
am: c76aa69207 Change-Id: I6bb066d131dde297612c5dcbf5051f4964e62a8b
2016-08-12resolve merge conflicts of 17bd236 to stage-aosp-masterChih-Hung Hsieh
Change-Id: I08d4500aaa378b08d41e8d046c62101e08dbfba8
2016-08-11Fix clang-tidy warnings in aapt and aapt2.Chih-Hung Hsieh
* Add explicit keyword to conversion constructors. * Add NOLINT(implicit) comments for implicit conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1 Merged-In: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
2016-08-11Fix clang-tidy warnings in aapt and aapt2.Chih-Hung Hsieh
* Add explicit keyword to conversion constructors. * Add NOLINT(implicit) comments for implicit conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
2016-08-02AAPT: faketouch feature implied if no touchscreen feature requested. am: ↵Adam Lesinski
ca955a4c3a am: 76cbcd495e am: 12e5b87771 Change-Id: Idf7c77d4122ab88b0fe1a1b3c42a196fd532d45c
2016-08-01AAPT: faketouch feature implied if no touchscreen feature requested.Adam Lesinski
This changes the default implied feature of 'android.hardware.touchscreen' to 'android.hardware.faketouch' if no 'android.hardware.touchscreen' feature is requested, required or otherwise. Bug:30571641 Change-Id: I1e41242d4b1dc549cf69741d2a309baf476d084e
2016-07-13AAPT: Improve debuggability of aapt dump badging errorsAdam Lesinski
AAPT dump badging errors have been cryptic and difficult to debug for app developers. Added some line info to the error statements. Change-Id: Ieeeb903a1274a91b77329b445e0248b1e67c9568
2016-05-03Fix google-explicit-constructor warnings.Chih-Hung Hsieh
Bug: 28341362 Change-Id: I080090d50f1a368a4e7c1a0732297bb6a295e34f
2016-04-28Merge "AAPT: ProGuard config for components in main dex." am: da66fa7526Adam Lesinski
am: 1d58c18081 * commit '1d58c18081a2f17afc964de2f261a699e11d6f02': AAPT: ProGuard config for components in main dex. Change-Id: I156e1805ad64798be891747a81561589d9543424
2016-04-27AAPT: ProGuard config for components in main dex.Rohit Agrawal
Create an analogue of "aapt -G" which outputs a proguard configuration that keeps only components which need to be in the main dex. Bug: 27383099 Bug: 28425556 Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1 (cherry picked from commit 86229cb622fccde8ab8cbe85eead91a34313a708)
2016-04-27AAPT: ProGuard config for components in main dex.Rohit Agrawal
Create an analogue of "aapt -G" which outputs a proguard configuration that keeps only components which need to be in the main dex. BUG: 27383099 Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1 (cherry picked from commit 86229cb622fccde8ab8cbe85eead91a34313a708)
2016-04-21AAPT: ProGuard config for components in main dex.Rohit Agrawal
Create an analogue of "aapt -G" which outputs a proguard configuration that keeps only components which need to be in the main dex. BUG: 27383099 Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1
2016-04-06AAPT: Dump uses-feature version in dump badgingAdam Lesinski
Bug:27162500 Change-Id: I4f82cdd8ef1801c92d4ea6b4bb982c6e7d91edb5
2015-12-16DO NOT MERGE: AAPT: Dump uses-permission-sdk-23 am: b2c5155638 am: ↵Adam Lesinski
40d1ab91d2 am: 8c9209183f am: 7f5ad22330 am: 1f7a36b8e6 * commit '1f7a36b8e6aa55dcb22a63c250fb318260ac349f': DO NOT MERGE: AAPT: Dump uses-permission-sdk-23
2015-12-16DO NOT MERGE: AAPT: Dump uses-permission-sdk-23Adam Lesinski
Include <uses-permission-sdk-23> permissions in dump badging and dump permissions. This will also add implied features for that permission, marked as -sdk-23 features. Ex: uses-permission: name='android.permission.ACCESS_FINE_LOCATION' uses-permission-sdk-23: name='android.permission.CAMERA' feature-group: label='' uses-feature: name='android.hardware.location' uses-implied-feature: name='android.hardware.location' reason='...' uses-feature-sdk-23: name='android.hardware.camera' uses-implied-feature-sdk-23: name='android.hardware.camera' reason='...' Bug:24939655 Change-Id: Ifb374696ed4760b0ba2f1cc3516f3bf08e6cb6a3 (cherry picked from commit 5f3b2ecb3e9d27e77bd59c7b9006a6239b773944)
2015-12-10AAPT: Dump uses-permission-sdk-23Adam Lesinski
Include <uses-permission-sdk-23> permissions in dump badging and dump permissions. This will also add implied features for that permission, marked as -sdk-23 features. Ex: uses-permission: name='android.permission.ACCESS_FINE_LOCATION' uses-permission-sdk-23: name='android.permission.CAMERA' feature-group: label='' uses-feature: name='android.hardware.location' uses-implied-feature: name='android.hardware.location' reason='...' uses-feature-sdk-23: name='android.hardware.camera' uses-implied-feature-sdk-23: name='android.hardware.camera' reason='...' Bug:24939655 Change-Id: Ifb374696ed4760b0ba2f1cc3516f3bf08e6cb6a3
2015-09-08Load app resource as shared library.Tao Bai
- Added aapt command line flag --app-as-shared-lib to build app resources that could be loaded as shared lib at runtime. - Added new method AssetManager.addAssetPathAsSharedLibrary() to load an app resource as shared library. Bug 22487604 Change-Id: Ib9b33c35f9c2b7129f3ba205de03d4564623ea39
2015-08-12Lose HAVE_ANDROID_OS from frameworks/base.Elliott Hughes
Change-Id: I713881fdbaec7cbbb5e7f2f4be6f9b8be3d2ca4e
2015-02-10am 510c24e8: Merge "Fix AAPT daemon mode with paths containg spaces." into ↵Chris Warrington
lmp-mr1-dev automerge: 4499888 * commit '449988872be61f273c91db13069d5b7172429032': Fix AAPT daemon mode with paths containg spaces.
2015-02-09Fix AAPT daemon mode with paths containg spaces.Chris Warrington
Use new line as a delimiter rather than space. Fixes: https://code.google.com/p/android/issues/detail?id=135757 Gradle CL: https://android-review.googlesource.com/130423 Change-Id: I7c73e680b0417b0e7cff9e0110822675c53ae20f
2014-12-09am c765655a: am fbba9b57: Merge "AAPT: Dump status of required flag for ↵Adam Lesinski
uses-feature" into lmp-mr1-dev * commit 'c765655ae1ae35f9d5f0958295f0b71270132ca7': AAPT: Dump status of required flag for uses-feature
2014-12-08AAPT: Dump status of required flag for uses-featureAdam Lesinski
Outside of a feature-group, the legacy uses-feature tag has a boolean required flag that should be emitted in dump badging. Bug:17790999 Change-Id: I43023af00e9c9ed4bc35795c3a983fc719bf9b7a
2014-10-24Merge "aapt updates for Android TV" into lmp-mr1-dev automerge: 6af7d76Tim Kilbourn
automerge: 181c18e * commit '181c18efd438f7a5e8cc18327367c49bf51795be': aapt updates for Android TV
2014-10-24aapt updates for Android TVTim Kilbourn
- Output whether an app claims to be a game (android:isGame) - Output android:banner if it is specified at the application level. Change-Id: I7118b524f62cdfc4effeef21b32b3cdd814d9bfa
2014-10-10am e36550dc: am 0757e5fd: am c9c512e0: am f47f8855: Merge "Added a daemon ↵Jerome Dochez
mode to aapt to receive streams of commands from gradle." into lmp-dev * commit 'e36550dc9e202450d0921bf65d00d14e7e3e8a54': Added a daemon mode to aapt to receive streams of commands from gradle.
2014-10-02Added a daemon mode to aapt to receive streams of commands from gradle.Jerome Dochez
When crunching png, we used to spawn a separate aapt process from java which is slow and resource intensive. Introduced a daemon mode to appt which when invoked with -m parameter will listen from commands on stdin and give report of command execution on stdout. One one command is supported so far : s f1 f2 This command perform a single png crunch, f1 pointing to the input png file to crunch, and f2 pointing to the path for the resulting crunced file. Expected output from the command is "Done" or "Error". Change-Id: Iaf1d865e8d5ee5d36abe39dea6443715865a98d3
2014-10-02am 152d9aae: am 31629651: Merge "Frameworks/base: Fix more aapt issues"Andreas Gampe
* commit '152d9aae631381ea28f5701168d372a1486a7502': Frameworks/base: Fix more aapt issues
2014-10-01Frameworks/base: Fix more aapt issuesAndreas Gampe
Change-Id: I6da7dc674e9f9e3b0886a3cfd1e3194d6b5ac948
2014-09-11am 972628dc: am 5128e88e: Merge "Don\'t use reflection when generating the ↵Marcin Kosiba
onResourcesLoaded callback." into lmp-dev * commit '972628dc8c63b02b75f9e976b3ab67e3913da1a8': Don't use reflection when generating the onResourcesLoaded callback.
2014-09-11Don't use reflection when generating the onResourcesLoaded callback.Marcin Kosiba
BUG: 17466240 Change-Id: I74608f3d8b3617281639a9d387face97e15fb616
2014-09-09resolved conflicts for merge of 1d99636f to lmp-dev-plus-aospDan Albert
Change-Id: Ic5f808de7d9722056112c6a73c718892e00bc9df
2014-09-09Merge "Don't check for null references."Dan Albert
2014-09-08Don't check for null references.Dan Albert
The address of a reference will never be null in well formed C++ code. The function returning the value being checked simply returns a dereferenced pointer (which is just going to segfault if it is null!). Change-Id: I3a4eb6adfc003c63ebf21b81d46088d52154d99d
2014-09-08Use char16_t for char things.Dan Albert
When compiling in C++ mode, the compiler will complain about conversions from uint16_t to char16_t. Be consistent in using char16_t for strings. Change-Id: I052b6176ced635162920b31560052d9a64f92764