MCPcopy Create free account
hub / github.com/facebook/SoLoader / addSystemLibSoSource

Method addSystemLibSoSource

java/com/facebook/soloader/SoLoader.java:530–548  ·  view source on GitHub ↗

Add SoSource objects for each of the system library directories. @param soSources target soSource list

(ArrayList<SoSource> soSources)

Source from the content-addressed store, hash-verified

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();

Callers 1

initSoSourcesMethod · 0.95

Calls 3

is64BitMethod · 0.95
dMethod · 0.95
equalsMethod · 0.80

Tested by

no test coverage detected