X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/62ebcfc28be6492825957985187968e6aa4c3d72..9171b2f37058b37bf08464cb67286dd2e503c89a:/Command.cpp diff --git a/Command.cpp b/Command.cpp index db4ac97..3a30c0a 100644 --- a/Command.cpp +++ b/Command.cpp @@ -678,7 +678,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); } @@ -712,7 +712,8 @@ int doDump(Bundle* bundle) LARGE_SCREEN_ATTR, NULL, 1); } else if (tag == "uses-feature") { String8 name = getAttribute(tree, NAME_ATTR, &error); - if (error == "") { + + if (name != "" && error == "") { int req = getIntegerAttribute(tree, REQUIRED_ATTR, NULL, 1); if (name == "android.hardware.camera") { @@ -729,7 +730,7 @@ int doDump(Bundle* bundle) } } else if (tag == "uses-permission") { String8 name = getAttribute(tree, NAME_ATTR, &error); - if (error == "") { + if (name != "" && error == "") { if (name == "android.permission.CAMERA") { hasCameraPermission = true; } @@ -847,7 +848,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"); } @@ -996,8 +997,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); @@ -1143,7 +1151,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; }