Loading cmds/idmap2/idmap2/CreateMultiple.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ #include <sys/types.h> // umask #include <fstream> #include <iostream> #include <memory> #include <ostream> #include <string> #include <vector> Loading Loading @@ -51,7 +51,7 @@ using android::idmap2::utils::UidHasWriteAccessToPath; Result<Unit> CreateMultiple(const std::vector<std::string>& args) { SYSTRACE << "CreateMultiple " << args; std::string target_apk_path; std::string idmap_dir = kIdmapCacheDir; std::string idmap_dir{kIdmapCacheDir}; std::vector<std::string> overlay_apk_paths; std::vector<std::string> policies; bool ignore_overlayable = false; Loading @@ -67,7 +67,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) { .OptionalOption("--idmap-dir", StringPrintf("output: path to the directory in which to write idmap file" " (defaults to %s)", kIdmapCacheDir), kIdmapCacheDir.data()), &idmap_dir) .OptionalOption("--policy", "input: an overlayable policy this overlay fulfills" Loading Loading @@ -142,7 +142,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) { } for (const std::string& idmap_path : idmap_paths) { std::cout << idmap_path << std::endl; std::cout << idmap_path << '\n'; } return Unit{}; Loading cmds/idmap2/idmap2/Lookup.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ #include <algorithm> #include <fstream> #include <iostream> #include <iterator> #include <memory> #include <ostream> #include <string> #include <utility> #include <vector> Loading Loading @@ -230,7 +230,7 @@ Result<Unit> Lookup(const std::vector<std::string>& args) { if (!value) { return Error(value.GetError(), "resource 0x%08x not found", *resid); } std::cout << *value << std::endl; std::cout << *value << '\n'; } return Unit{}; Loading cmds/idmap2/idmap2/Main.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ void PrintUsage(const NameToFunctionMap& commands, std::ostream& out) { } out << iter->first; } out << "]" << std::endl; out << "]" << '\n'; } } // namespace Loading @@ -65,18 +65,18 @@ int main(int argc, char** argv) { const std::unique_ptr<std::vector<std::string>> args = CommandLineOptions::ConvertArgvToVector(argc - 1, const_cast<const char**>(argv + 1)); if (!args) { std::cerr << "error: failed to parse command line options" << std::endl; std::cerr << "error: failed to parse command line options" << '\n'; return EXIT_FAILURE; } const auto iter = commands.find(argv[1]); if (iter == commands.end()) { std::cerr << argv[1] << ": command not found" << std::endl; std::cerr << argv[1] << ": command not found" << '\n'; PrintUsage(commands, std::cerr); return EXIT_FAILURE; } const auto result = iter->second(*args); if (!result) { std::cerr << "error: " << result.GetErrorMessage() << std::endl; std::cerr << "error: " << result.GetErrorMessage() << '\n'; return EXIT_FAILURE; } return EXIT_SUCCESS; Loading cmds/idmap2/idmap2d/Idmap2Service.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -257,7 +257,7 @@ Status Idmap2Service::createFabricatedOverlay( const std::string random_suffix = RandomStringForPath(kSuffixLength); file_name = StringPrintf("%s-%s-%s.frro", overlay.packageName.c_str(), overlay.overlayName.c_str(), random_suffix.c_str()); path = StringPrintf("%s/%s", kIdmapCacheDir, file_name.c_str()); path = StringPrintf("%s/%s", kIdmapCacheDir.data(), file_name.c_str()); // Invoking std::filesystem::exists with a file name greater than 255 characters will cause this // process to abort since the name exceeds the maximum file name size. Loading cmds/idmap2/include/idmap2/BinaryStreamVisitor.h +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #define IDMAP2_INCLUDE_IDMAP2_BINARYSTREAMVISITOR_H_ #include <cstdint> #include <iostream> #include <ostream> #include <string> #include "idmap2/Idmap.h" Loading Loading
cmds/idmap2/idmap2/CreateMultiple.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ #include <sys/types.h> // umask #include <fstream> #include <iostream> #include <memory> #include <ostream> #include <string> #include <vector> Loading Loading @@ -51,7 +51,7 @@ using android::idmap2::utils::UidHasWriteAccessToPath; Result<Unit> CreateMultiple(const std::vector<std::string>& args) { SYSTRACE << "CreateMultiple " << args; std::string target_apk_path; std::string idmap_dir = kIdmapCacheDir; std::string idmap_dir{kIdmapCacheDir}; std::vector<std::string> overlay_apk_paths; std::vector<std::string> policies; bool ignore_overlayable = false; Loading @@ -67,7 +67,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) { .OptionalOption("--idmap-dir", StringPrintf("output: path to the directory in which to write idmap file" " (defaults to %s)", kIdmapCacheDir), kIdmapCacheDir.data()), &idmap_dir) .OptionalOption("--policy", "input: an overlayable policy this overlay fulfills" Loading Loading @@ -142,7 +142,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) { } for (const std::string& idmap_path : idmap_paths) { std::cout << idmap_path << std::endl; std::cout << idmap_path << '\n'; } return Unit{}; Loading
cmds/idmap2/idmap2/Lookup.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ #include <algorithm> #include <fstream> #include <iostream> #include <iterator> #include <memory> #include <ostream> #include <string> #include <utility> #include <vector> Loading Loading @@ -230,7 +230,7 @@ Result<Unit> Lookup(const std::vector<std::string>& args) { if (!value) { return Error(value.GetError(), "resource 0x%08x not found", *resid); } std::cout << *value << std::endl; std::cout << *value << '\n'; } return Unit{}; Loading
cmds/idmap2/idmap2/Main.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ void PrintUsage(const NameToFunctionMap& commands, std::ostream& out) { } out << iter->first; } out << "]" << std::endl; out << "]" << '\n'; } } // namespace Loading @@ -65,18 +65,18 @@ int main(int argc, char** argv) { const std::unique_ptr<std::vector<std::string>> args = CommandLineOptions::ConvertArgvToVector(argc - 1, const_cast<const char**>(argv + 1)); if (!args) { std::cerr << "error: failed to parse command line options" << std::endl; std::cerr << "error: failed to parse command line options" << '\n'; return EXIT_FAILURE; } const auto iter = commands.find(argv[1]); if (iter == commands.end()) { std::cerr << argv[1] << ": command not found" << std::endl; std::cerr << argv[1] << ": command not found" << '\n'; PrintUsage(commands, std::cerr); return EXIT_FAILURE; } const auto result = iter->second(*args); if (!result) { std::cerr << "error: " << result.GetErrorMessage() << std::endl; std::cerr << "error: " << result.GetErrorMessage() << '\n'; return EXIT_FAILURE; } return EXIT_SUCCESS; Loading
cmds/idmap2/idmap2d/Idmap2Service.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -257,7 +257,7 @@ Status Idmap2Service::createFabricatedOverlay( const std::string random_suffix = RandomStringForPath(kSuffixLength); file_name = StringPrintf("%s-%s-%s.frro", overlay.packageName.c_str(), overlay.overlayName.c_str(), random_suffix.c_str()); path = StringPrintf("%s/%s", kIdmapCacheDir, file_name.c_str()); path = StringPrintf("%s/%s", kIdmapCacheDir.data(), file_name.c_str()); // Invoking std::filesystem::exists with a file name greater than 255 characters will cause this // process to abort since the name exceeds the maximum file name size. Loading
cmds/idmap2/include/idmap2/BinaryStreamVisitor.h +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #define IDMAP2_INCLUDE_IDMAP2_BINARYSTREAMVISITOR_H_ #include <cstdint> #include <iostream> #include <ostream> #include <string> #include "idmap2/Idmap.h" Loading