X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/5c71c5c30b3e71e70972b55ceda8f123d3b628de..6ceb361b2876b8b4fecbe56cacc187433ba3a0b4:/Command.cpp diff --git a/Command.cpp b/Command.cpp index 1a536d6..ee07415 100644 --- a/Command.cpp +++ b/Command.cpp @@ -401,7 +401,7 @@ int doDump(Bundle* bundle) ResXMLTree tree; asset = assets.openNonAsset(resname, Asset::ACCESS_BUFFER); if (asset == NULL) { - fprintf(stderr, "ERROR: dump failed because resource %p found\n", resname); + fprintf(stderr, "ERROR: dump failed because resource %s found\n", resname); goto bail; } @@ -412,6 +412,7 @@ int doDump(Bundle* bundle) } tree.restart(); printXMLBlock(&tree); + tree.uninit(); delete asset; asset = NULL; } @@ -427,7 +428,7 @@ int doDump(Bundle* bundle) ResXMLTree tree; asset = assets.openNonAsset(resname, Asset::ACCESS_BUFFER); if (asset == NULL) { - fprintf(stderr, "ERROR: dump failed because resource %p found\n", resname); + fprintf(stderr, "ERROR: dump failed because resource %s found\n", resname); goto bail; } @@ -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); } @@ -740,6 +741,15 @@ int doDump(Bundle* bundle) error.string()); goto bail; } + } else if (tag == "original-package") { + String8 name = getAttribute(tree, NAME_ATTR, &error); + if (name != "" && error == "") { + printf("original-package:'%s'\n", name.string()); + } else { + fprintf(stderr, "ERROR getting 'android:name' attribute: %s\n", + error.string()); + goto bail; + } } } else if (depth == 3 && withinApplication) { withinActivity = false; @@ -1151,7 +1161,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; }