summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-12-05 16:03:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-12-05 16:03:26 +0000
commit4ab869e1e6f2eb472d34ae18a185ca52ddd98be1 (patch)
tree852085acfc20dcfabb6a20b575a23eb47f09caa4 /tools/aapt/Command.cpp
parentb4de0609711eecc09bcbeed8b3cfd1186f86dff8 (diff)
parent11be9317efffafcac52cd2dc5cce1d951c966dd1 (diff)
Merge changes I2eef812b,I7b607192
* changes: AAPT v1 embed compile SDK version and codename into app AAPT2: Embed version of framework an app was compiled against.
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index cb87737c6868..05375b0cb871 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -293,6 +293,8 @@ enum {
ISGAME_ATTR = 0x10103f4,
REQUIRED_FEATURE_ATTR = 0x1010557,
REQUIRED_NOT_FEATURE_ATTR = 0x1010558,
+ COMPILE_SDK_VERSION_ATTR = 0x01010572, // NOT FINALIZED
+ COMPILE_SDK_VERSION_CODENAME_ATTR = 0x01010573, // NOT FINALIZED
};
String8 getComponentName(String8 &pkgName, String8 &componentName) {
@@ -1247,9 +1249,37 @@ int doDump(Bundle* bundle)
splitName.string()).string());
}
- String8 platformVersionName = AaptXml::getAttribute(tree, NULL,
+ String8 platformBuildVersionName = AaptXml::getAttribute(tree, NULL,
"platformBuildVersionName");
- printf(" platformBuildVersionName='%s'", platformVersionName.string());
+ if (platformBuildVersionName != "") {
+ printf(" platformBuildVersionName='%s'", platformBuildVersionName.string());
+ }
+
+ String8 platformBuildVersionCode = AaptXml::getAttribute(tree, NULL,
+ "platformBuildVersionCode");
+ if (platformBuildVersionCode != "") {
+ printf(" platformBuildVersionCode='%s'", platformBuildVersionCode.string());
+ }
+
+ int32_t compileSdkVersion = AaptXml::getIntegerAttribute(tree,
+ COMPILE_SDK_VERSION_ATTR, &error);
+ if (error != "") {
+ SourcePos(manifestFile, tree.getLineNumber()).error(
+ "ERROR getting 'android:compileSdkVersion' attribute: %s",
+ error.string());
+ goto bail;
+ }
+ if (compileSdkVersion > 0) {
+ printf(" compileSdkVersion='%d'", compileSdkVersion);
+ }
+
+ String8 compileSdkVersionCodename = AaptXml::getResolvedAttribute(res, tree,
+ COMPILE_SDK_VERSION_CODENAME_ATTR, &error);
+ if (compileSdkVersionCodename != "") {
+ printf(" compileSdkVersionCodename='%s'", ResTable::normalizeForOutput(
+ compileSdkVersionCodename.string()).string());
+ }
+
printf("\n");
int32_t installLocation = AaptXml::getResolvedIntegerAttribute(res, tree,