summaryrefslogtreecommitdiff
path: root/tools/aapt/Resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r--tools/aapt/Resource.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 3e8abb121c42..75a316092a02 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2930,6 +2930,19 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass
if (!keepTag && inApplication && depth == 3) {
if (tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") {
keepTag = true;
+
+ if (mainDex) {
+ String8 componentProcess = AaptXml::getAttribute(tree,
+ "http://schemas.android.com/apk/res/android", "process", &error);
+ if (error != "") {
+ fprintf(stderr, "ERROR: %s\n", error.string());
+ return -1;
+ }
+
+ const String8& process =
+ componentProcess.length() > 0 ? componentProcess : defaultProcess;
+ keepTag = process.length() > 0 && process.find(":") != 0;
+ }
}
}
if (keepTag) {
@@ -2942,19 +2955,6 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass
keepTag = name.length() > 0;
- if (keepTag && mainDex) {
- String8 componentProcess = AaptXml::getAttribute(tree,
- "http://schemas.android.com/apk/res/android", "process", &error);
- if (error != "") {
- fprintf(stderr, "ERROR: %s\n", error.string());
- return -1;
- }
-
- const String8& process =
- componentProcess.length() > 0 ? componentProcess : defaultProcess;
- keepTag = process.length() > 0 && process.find(":") != 0;
- }
-
if (keepTag) {
addProguardKeepRule(keep, name, pkg.string(),
assFile->getPrintableSource(), tree.getLineNumber());