diff options
-rw-r--r-- | tools/aapt/ApkBuilder.cpp | 13 | ||||
-rw-r--r-- | tools/aapt/ApkBuilder.h | 5 | ||||
-rw-r--r-- | tools/aapt/Resource.cpp | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/tools/aapt/ApkBuilder.cpp b/tools/aapt/ApkBuilder.cpp index 12f6040..01e02e2 100644 --- a/tools/aapt/ApkBuilder.cpp +++ b/tools/aapt/ApkBuilder.cpp @@ -85,11 +85,24 @@ ApkSplit::ApkSplit(const std::set<ConfigDescription>& configs, const sp<Resource if (mName.size() > 0) { mName.append(","); mDirName.append("_"); + mPackageSafeName.append("."); } String8 configStr = iter->toString(); + String8 packageConfigStr(configStr); + size_t len = packageConfigStr.length(); + if (len > 0) { + char* buf = packageConfigStr.lockBuffer(len); + for (char* end = buf + len; buf < end; ++buf) { + if (*buf == '-') { + *buf = '_'; + } + } + packageConfigStr.unlockBuffer(len); + } mName.append(configStr); mDirName.append(configStr); + mPackageSafeName.append(packageConfigStr); } } diff --git a/tools/aapt/ApkBuilder.h b/tools/aapt/ApkBuilder.h index db23c84..0d7f06b 100644 --- a/tools/aapt/ApkBuilder.h +++ b/tools/aapt/ApkBuilder.h @@ -95,6 +95,10 @@ public: return mDirName; } + const android::String8& getPackageSafeName() const { + return mPackageSafeName; + } + bool isBase() const { return mIsBase; } @@ -111,6 +115,7 @@ private: const bool mIsBase; String8 mName; String8 mDirName; + String8 mPackageSafeName; std::set<OutputEntry> mFiles; }; diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 2401b3a..010d59b 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -937,8 +937,8 @@ status_t generateAndroidManifestForSplit(Bundle* bundle, const sp<AaptAssets>& a } // Add the 'split' attribute which describes the configurations included. - String8 splitName("config_"); - splitName.append(split->getDirectorySafeName()); + String8 splitName("config."); + splitName.append(split->getPackageSafeName()); manifest->addAttribute(String16(), String16("split"), String16(splitName)); // Build an empty <application> tag (required). |