summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dan Morrill <morrildl@google.com> 2012-04-03 12:44:40 -0700
committer Dan Morrill <morrildl@google.com> 2012-04-03 14:42:05 -0700
commitb6ec11ef372a498c4d5fd2317a015b808495a2ed (patch)
tree529b04c2ffa8665181f94555c601aaca496a094d
parentb3fa3960a03ef553e58bf1add88029a6c072c6b6 (diff)
Adding a line for android-debuggable to 'dump badging' if AndroidManifest.xml
is configured as such. This is to be used by e.g. Play Store to warn the developer that they are about to publish a security hole. Change-Id: Ib6f8537462cbc00ed0504435bdeee2aae0c5b69b
-rw-r--r--tools/aapt/Command.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 198fce40ec8c..0238119a4579 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -345,6 +345,7 @@ enum {
LABEL_ATTR = 0x01010001,
ICON_ATTR = 0x01010002,
NAME_ATTR = 0x01010003,
+ DEBUGGABLE_ATTR = 0x0101000f,
VERSION_CODE_ATTR = 0x0101021b,
VERSION_NAME_ATTR = 0x0101021c,
SCREEN_ORIENTATION_ATTR = 0x0101001e,
@@ -824,6 +825,15 @@ int doDump(Bundle* bundle)
if (testOnly != 0) {
printf("testOnly='%d'\n", testOnly);
}
+
+ int32_t debuggable = getResolvedIntegerAttribute(&res, tree, DEBUGGABLE_ATTR, &error, 0);
+ if (error != "") {
+ fprintf(stderr, "ERROR getting 'android:debuggable' attribute: %s\n", error.string());
+ goto bail;
+ }
+ if (debuggable != 0) {
+ printf("application-debuggable\n");
+ }
} else if (tag == "uses-sdk") {
int32_t code = getIntegerAttribute(tree, MIN_SDK_VERSION_ATTR, &error);
if (error != "") {