TLC also supports lib directory
authorj-h.choi <j-h.choi@samsung.com>
Mon, 4 Nov 2024 07:23:47 +0000 (16:23 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Wed, 20 Nov 2024 05:18:19 +0000 (14:18 +0900)
Change-Id: I45ec7529922710b06f38c99237d5b9dc3c95a519

NativeLauncher/tool/tac_common.cc

index 9dbe5ef81a63c4085ef1410befd72a662e45d04b..99a9f13377091c605bf8ba0a5483a6a90ad63aa2 100644 (file)
@@ -427,18 +427,22 @@ std::vector<std::string> depsJsonParser(const std::string& rootPath, const std::
 std::vector<std::string> getLibrariesInfo(const std::string& rootPath)
 {
        std::vector<std::string> LibrariesInfo;
-       std::string binDir = concatPath(rootPath, "bin");
-       if (!exist(binDir))
-               return LibrariesInfo;
+       std::vector<std::string> paths = {concatPath(rootPath, "bin"), concatPath(rootPath, "lib")};
 
        auto convert = [&LibrariesInfo](const std::string& filepath, const std::string& filename) {
                if (filename.find(".so", filename.size() - 3) != std::string::npos || filepath.rfind(".so.") != std::string::npos) {
-                       std::string buffer = SHA256(filepath);
-                       LibrariesInfo.push_back(filepath + ":" + buffer);
-                       _INFO("Library : [%s] / SHA256 : [%s]", filename.c_str(), buffer.c_str());
+                       // Skip symlink file
+                       if (!isSymlinkFile(filepath)) {
+                               std::string buffer = SHA256(filepath);
+                               LibrariesInfo.push_back(filepath + ":" + buffer);
+                               _INFO("Library : [%s] / SHA256 : [%s]", filename.c_str(), buffer.c_str());
+                       }
                }
        };
-       scanFilesInDirectory(binDir, convert, -1);
+
+       for (auto& path : paths) {
+               scanFilesInDirectory(path, convert, -1);
+       }
 
        return LibrariesInfo;
 }