Loading tools/aapt2/cmd/Compile.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "Flags.h" #include "ResourceParser.h" #include "ResourceTable.h" #include "cmd/Util.h" #include "compile/IdAssigner.h" #include "compile/InlineXmlFormatParser.h" #include "compile/Png.h" Loading Loading @@ -328,6 +329,12 @@ static bool CompileTable(IAaptContext* context, const CompileOptions& options, // nested under their parent and use its visibility. r_txt_printer.Print("default int styleable "); r_txt_printer.Print(entry->name); // If the package name is present, also include it in the mangled name (e.g. // "android") if (!attr.name.value().package.empty()) { r_txt_printer.Print("_"); r_txt_printer.Print(MakePackageSafeName(attr.name.value().package)); } r_txt_printer.Print("_"); r_txt_printer.Println(attr.name.value().entry); } Loading tools/aapt2/cmd/Util.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ static xml::NamespaceDecl CreateAndroidNamespaceDecl() { // // See frameworks/base/core/java/android/content/pm/PackageParser.java which // checks this at runtime. static std::string MakePackageSafeName(const std::string &name) { std::string MakePackageSafeName(const std::string &name) { std::string result(name); bool first = true; for (char &c : result) { Loading tools/aapt2/cmd/Util.h +7 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,13 @@ std::unique_ptr<xml::XmlResource> GenerateSplitManifest(const AppInfo& app_info, Maybe<AppInfo> ExtractAppInfoFromBinaryManifest(const xml::XmlResource& xml_res, IDiagnostics* diag); // Returns a copy of 'name' which conforms to the regex '[a-zA-Z]+[a-zA-Z0-9_]*' by // replacing nonconforming characters with underscores. // // See frameworks/base/core/java/android/content/pm/PackageParser.java which // checks this at runtime. std::string MakePackageSafeName(const std::string &name); } // namespace aapt #endif /* AAPT_SPLIT_UTIL_H */ Loading
tools/aapt2/cmd/Compile.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "Flags.h" #include "ResourceParser.h" #include "ResourceTable.h" #include "cmd/Util.h" #include "compile/IdAssigner.h" #include "compile/InlineXmlFormatParser.h" #include "compile/Png.h" Loading Loading @@ -328,6 +329,12 @@ static bool CompileTable(IAaptContext* context, const CompileOptions& options, // nested under their parent and use its visibility. r_txt_printer.Print("default int styleable "); r_txt_printer.Print(entry->name); // If the package name is present, also include it in the mangled name (e.g. // "android") if (!attr.name.value().package.empty()) { r_txt_printer.Print("_"); r_txt_printer.Print(MakePackageSafeName(attr.name.value().package)); } r_txt_printer.Print("_"); r_txt_printer.Println(attr.name.value().entry); } Loading
tools/aapt2/cmd/Util.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ static xml::NamespaceDecl CreateAndroidNamespaceDecl() { // // See frameworks/base/core/java/android/content/pm/PackageParser.java which // checks this at runtime. static std::string MakePackageSafeName(const std::string &name) { std::string MakePackageSafeName(const std::string &name) { std::string result(name); bool first = true; for (char &c : result) { Loading
tools/aapt2/cmd/Util.h +7 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,13 @@ std::unique_ptr<xml::XmlResource> GenerateSplitManifest(const AppInfo& app_info, Maybe<AppInfo> ExtractAppInfoFromBinaryManifest(const xml::XmlResource& xml_res, IDiagnostics* diag); // Returns a copy of 'name' which conforms to the regex '[a-zA-Z]+[a-zA-Z0-9_]*' by // replacing nonconforming characters with underscores. // // See frameworks/base/core/java/android/content/pm/PackageParser.java which // checks this at runtime. std::string MakePackageSafeName(const std::string &name); } // namespace aapt #endif /* AAPT_SPLIT_UTIL_H */