]> git.saurik.com Git - android/aapt.git/blobdiff - Command.cpp
am 3c05f1fb: am b5fb50a1: Merge "Add instrumentation as a source tag for proguard...
[android/aapt.git] / Command.cpp
index 3019bd0f5e9e828dc8c68a961fcd9336044c8bdf..5d345e6d246ba79a18113c27e58384b877338572 100644 (file)
@@ -412,6 +412,7 @@ int doDump(Bundle* bundle)
             }
             tree.restart();
             printXMLBlock(&tree);
+            tree.uninit();
             delete asset;
             asset = NULL;
         }
@@ -678,7 +679,7 @@ int doDump(Bundle* bundle)
                                 REQ_NAVIGATION_ATTR, NULL, 0);
                         int32_t reqFiveWayNav = getIntegerAttribute(tree,
                                 REQ_FIVE_WAY_NAV_ATTR, NULL, 0);
-                        printf("uses-configuation:");
+                        printf("uses-configuration:");
                         if (reqTouchScreen != 0) {
                             printf(" reqTouchScreen='%d'", reqTouchScreen);
                         }
@@ -848,7 +849,7 @@ int doDump(Bundle* bundle)
                 printf("uses-feature:'android.hardware.camera'\n");
                 printf("uses-feature:'android.hardware.camera.autofocus'\n");
             }
-            
+
             if (hasMainActivity) {
                 printf("main\n");
             }
@@ -997,8 +998,15 @@ int doAdd(Bundle* bundle)
             printf(" '%s'... (from gzip)\n", fileName);
             result = zip->addGzip(fileName, String8(fileName).getBasePath().string(), NULL);
         } else {
-            printf(" '%s'...\n", fileName);
-            result = zip->add(fileName, bundle->getCompressionMethod(), NULL);
+            if (bundle->getJunkPath()) {
+                String8 storageName = String8(fileName).getPathLeaf();
+                printf(" '%s' as '%s'...\n", fileName, storageName.string());
+                result = zip->add(fileName, storageName.string(),
+                                  bundle->getCompressionMethod(), NULL);
+            } else {
+                printf(" '%s'...\n", fileName);
+                result = zip->add(fileName, bundle->getCompressionMethod(), NULL);
+            }
         }
         if (result != NO_ERROR) {
             fprintf(stderr, "Unable to add '%s' to '%s'", bundle->getFileSpecEntry(i), zipFileName);
@@ -1144,7 +1152,12 @@ int doPackage(Bundle* bundle)
 
     // Write out R.java constants
     if (assets->getPackage() == assets->getSymbolsPrivatePackage()) {
-        err = writeResourceSymbols(bundle, assets, assets->getPackage(), true);
+        if (bundle->getCustomPackage() == NULL) {
+            err = writeResourceSymbols(bundle, assets, assets->getPackage(), true);
+        } else {
+            const String8 customPkg(bundle->getCustomPackage());
+            err = writeResourceSymbols(bundle, assets, customPkg, true);
+        }
         if (err < 0) {
             goto bail;
         }