Loading tools/aapt/Bundle.h +7 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,12 @@ public: const android::String8& getPlatformBuildVersionName() { return mPlatformVersionName; } void setPlatformBuildVersionName(const android::String8& name) { mPlatformVersionName = name; } const android::String8& getPrivateSymbolsPackage() const { return mPrivateSymbolsPackage; } void setPrivateSymbolsPackage(const android::String8& package) { mPrivateSymbolsPackage = package; } bool getUTF16StringsOption() { return mWantUTF16 || !isMinSdkAtLeast(SDK_FROYO); } Loading Loading @@ -333,6 +339,7 @@ private: bool mBuildAppAsSharedLibrary; android::String8 mPlatformVersionCode; android::String8 mPlatformVersionName; android::String8 mPrivateSymbolsPackage; /* file specification */ int mArgc; Loading tools/aapt/Main.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ void usage(void) " Prevents symbols from being generated for strings that do not have a default\n" " localization\n" " --no-version-vectors\n" " Do not automatically generate versioned copies of vector XML resources.\n", " Do not automatically generate versioned copies of vector XML resources.\n" " --private-symbols\n" " Java package name to use when generating R.java for private resources.\n", gDefaultIgnoreAssets); } Loading Loading @@ -689,6 +691,16 @@ int main(int argc, char* const argv[]) bundle.setPseudolocalize(PSEUDO_ACCENTED | PSEUDO_BIDI); } else if (strcmp(cp, "-no-version-vectors") == 0) { bundle.setNoVersionVectors(true); } else if (strcmp(cp, "-private-symbols") == 0) { argc--; argv++; if (!argc) { fprintf(stderr, "ERROR: No argument supplied for " "'--private-symbols' option\n"); wantUsage = true; goto bail; } bundle.setPrivateSymbolsPackage(String8(argv[0])); } else { fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp); wantUsage = true; Loading tools/aapt/Resource.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1161,6 +1161,12 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil printf("Creating resources for package %s\n", assets->getPackage().string()); } // Set the private symbols package if it was declared. // This can also be declared in XML as <private-symbols name="package" /> if (bundle->getPrivateSymbolsPackage().size() != 0) { assets->setSymbolsPrivatePackage(bundle->getPrivateSymbolsPackage()); } ResourceTable::PackageType packageType = ResourceTable::App; if (bundle->getBuildSharedLibrary()) { packageType = ResourceTable::SharedLibrary; Loading tools/aapt/ResourceTable.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -1141,8 +1141,16 @@ status_t compileResourceFile(Bundle* bundle, } pkg = String16(block.getAttributeStringValue(pkgIdx, &len)); if (!localHasErrors) { SourcePos(in->getPrintableSource(), block.getLineNumber()).warning( "<private-symbols> is deprecated. Use the command line flag " "--private-symbols instead.\n"); if (assets->havePrivateSymbols()) { SourcePos(in->getPrintableSource(), block.getLineNumber()).warning( "private symbol package already specified. Ignoring...\n"); } else { assets->setSymbolsPrivatePackage(String8(pkg)); } } while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) { if (code == ResXMLTree::END_TAG) { Loading Loading
tools/aapt/Bundle.h +7 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,12 @@ public: const android::String8& getPlatformBuildVersionName() { return mPlatformVersionName; } void setPlatformBuildVersionName(const android::String8& name) { mPlatformVersionName = name; } const android::String8& getPrivateSymbolsPackage() const { return mPrivateSymbolsPackage; } void setPrivateSymbolsPackage(const android::String8& package) { mPrivateSymbolsPackage = package; } bool getUTF16StringsOption() { return mWantUTF16 || !isMinSdkAtLeast(SDK_FROYO); } Loading Loading @@ -333,6 +339,7 @@ private: bool mBuildAppAsSharedLibrary; android::String8 mPlatformVersionCode; android::String8 mPlatformVersionName; android::String8 mPrivateSymbolsPackage; /* file specification */ int mArgc; Loading
tools/aapt/Main.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ void usage(void) " Prevents symbols from being generated for strings that do not have a default\n" " localization\n" " --no-version-vectors\n" " Do not automatically generate versioned copies of vector XML resources.\n", " Do not automatically generate versioned copies of vector XML resources.\n" " --private-symbols\n" " Java package name to use when generating R.java for private resources.\n", gDefaultIgnoreAssets); } Loading Loading @@ -689,6 +691,16 @@ int main(int argc, char* const argv[]) bundle.setPseudolocalize(PSEUDO_ACCENTED | PSEUDO_BIDI); } else if (strcmp(cp, "-no-version-vectors") == 0) { bundle.setNoVersionVectors(true); } else if (strcmp(cp, "-private-symbols") == 0) { argc--; argv++; if (!argc) { fprintf(stderr, "ERROR: No argument supplied for " "'--private-symbols' option\n"); wantUsage = true; goto bail; } bundle.setPrivateSymbolsPackage(String8(argv[0])); } else { fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp); wantUsage = true; Loading
tools/aapt/Resource.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1161,6 +1161,12 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil printf("Creating resources for package %s\n", assets->getPackage().string()); } // Set the private symbols package if it was declared. // This can also be declared in XML as <private-symbols name="package" /> if (bundle->getPrivateSymbolsPackage().size() != 0) { assets->setSymbolsPrivatePackage(bundle->getPrivateSymbolsPackage()); } ResourceTable::PackageType packageType = ResourceTable::App; if (bundle->getBuildSharedLibrary()) { packageType = ResourceTable::SharedLibrary; Loading
tools/aapt/ResourceTable.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -1141,8 +1141,16 @@ status_t compileResourceFile(Bundle* bundle, } pkg = String16(block.getAttributeStringValue(pkgIdx, &len)); if (!localHasErrors) { SourcePos(in->getPrintableSource(), block.getLineNumber()).warning( "<private-symbols> is deprecated. Use the command line flag " "--private-symbols instead.\n"); if (assets->havePrivateSymbols()) { SourcePos(in->getPrintableSource(), block.getLineNumber()).warning( "private symbol package already specified. Ignoring...\n"); } else { assets->setSymbolsPrivatePackage(String8(pkg)); } } while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) { if (code == ResXMLTree::END_TAG) { Loading