Loading tools/aapt/Resource.cpp +44 −36 Original line number Diff line number Diff line Loading @@ -1727,18 +1727,27 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass depth++; String8 tag(tree.getElementName(&len)); // printf("Depth %d tag %s\n", depth, tag.string()); bool keepTag = false; if (depth == 1) { if (tag != "manifest") { fprintf(stderr, "ERROR: manifest does not start with <manifest> tag\n"); return -1; } pkg = getAttribute(tree, NULL, "package", NULL); } else if (depth == 2 && tag == "application") { } else if (depth == 2) { if (tag == "application") { inApplication = true; keepTag = true; } else if (tag == "instrumentation") { keepTag = true; } if (inApplication) { if (tag == "application" || tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") { } if (!keepTag && inApplication && depth == 3) { if (tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") { keepTag = true; } } if (keepTag) { String8 name = getAttribute(tree, "http://schemas.android.com/apk/res/android", "name", &error); if (error != "") { Loading Loading @@ -1774,7 +1783,6 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass } } } } return NO_ERROR; } Loading Loading
tools/aapt/Resource.cpp +44 −36 Original line number Diff line number Diff line Loading @@ -1727,18 +1727,27 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass depth++; String8 tag(tree.getElementName(&len)); // printf("Depth %d tag %s\n", depth, tag.string()); bool keepTag = false; if (depth == 1) { if (tag != "manifest") { fprintf(stderr, "ERROR: manifest does not start with <manifest> tag\n"); return -1; } pkg = getAttribute(tree, NULL, "package", NULL); } else if (depth == 2 && tag == "application") { } else if (depth == 2) { if (tag == "application") { inApplication = true; keepTag = true; } else if (tag == "instrumentation") { keepTag = true; } if (inApplication) { if (tag == "application" || tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") { } if (!keepTag && inApplication && depth == 3) { if (tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") { keepTag = true; } } if (keepTag) { String8 name = getAttribute(tree, "http://schemas.android.com/apk/res/android", "name", &error); if (error != "") { Loading Loading @@ -1774,7 +1783,6 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass } } } } return NO_ERROR; } Loading