Add SoSource objects for each of the system library directories. @param soSources target soSource list
(ArrayList<SoSource> soSources)
| 528 | * @param soSources target soSource list |
| 529 | */ |
| 530 | private static void addSystemLibSoSource(ArrayList<SoSource> soSources) { |
| 531 | String systemLibPaths = |
| 532 | SysUtil.is64Bit() ? "/system/lib64:/vendor/lib64" : "/system/lib:/vendor/lib"; |
| 533 | |
| 534 | String LD_LIBRARY_PATH = System.getenv("LD_LIBRARY_PATH"); |
| 535 | if (LD_LIBRARY_PATH != null && !LD_LIBRARY_PATH.equals("")) { |
| 536 | systemLibPaths = LD_LIBRARY_PATH + ":" + systemLibPaths; |
| 537 | } |
| 538 | |
| 539 | final Set<String> libPathSet = new HashSet<>(Arrays.asList(systemLibPaths.split(":"))); |
| 540 | for (String libPath : libPathSet) { |
| 541 | // Don't pass DirectorySoSource.RESOLVE_DEPENDENCIES for directories we find on |
| 542 | // LD_LIBRARY_PATH: Bionic's dynamic linker is capable of correctly resolving dependencies |
| 543 | // these libraries have on each other, so doing that ourselves would be a waste. |
| 544 | LogUtil.d(TAG, "adding system library source: " + libPath); |
| 545 | File systemSoDirectory = new File(libPath); |
| 546 | soSources.add(new DirectorySoSource(systemSoDirectory, DirectorySoSource.ON_LD_LIBRARY_PATH)); |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | private static void addSystemLoadWrapperSoSource(Context context, ArrayList<SoSource> soSources) { |
| 551 | SystemLoadWrapperSoSource systemLoadWrapperSoSource = new SystemLoadWrapperSoSource(); |
no test coverage detected