X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/7e029053aff869f4592a2a0cbf2fd98ad3651133..1782ef54064d06ed12eea07fee7e1f802db84645:/Command.cpp diff --git a/Command.cpp b/Command.cpp index f4afd7f..f2cdf75 100644 --- a/Command.cpp +++ b/Command.cpp @@ -233,7 +233,7 @@ static ssize_t indexOfAttribute(const ResXMLTree& tree, uint32_t attrRes) return -1; } -static String8 getAttribute(const ResXMLTree& tree, const char* ns, +String8 getAttribute(const ResXMLTree& tree, const char* ns, const char* attr, String8* outError) { ssize_t idx = tree.indexOfAttribute(ns, attr); @@ -730,8 +730,6 @@ int doDump(Bundle* bundle) } else if (tag == "uses-permission") { String8 name = getAttribute(tree, NAME_ATTR, &error); if (error == "") { - int opt = getIntegerAttribute(tree, - REQUIRED_ATTR, NULL, 1); if (name == "android.permission.CAMERA") { hasCameraPermission = true; } @@ -772,7 +770,10 @@ int doDump(Bundle* bundle) fprintf(stderr, "ERROR getting 'android:name' attribute for uses-library: %s\n", error.string()); goto bail; } - printf("uses-library:'%s'\n", libraryName.string()); + int req = getIntegerAttribute(tree, + REQUIRED_ATTR, NULL, 1); + printf("uses-library%s:'%s'\n", + req ? "" : "-not-required", libraryName.string()); } else if (tag == "receiver") { withinReceiver = true; receiverName = getAttribute(tree, NAME_ATTR, &error); @@ -1157,6 +1158,12 @@ int doPackage(Bundle* bundle) } } + // Write out the ProGuard file + err = writeProguardFile(bundle, assets); + if (err < 0) { + goto bail; + } + // Write the apk if (outputAPKFile) { err = writeAPK(bundle, assets, String8(outputAPKFile));