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

Method getLibString

java/com/facebook/soloader/NativeDeps.java:411–435  ·  view source on GitHub ↗
(int depIndex)

Source from the content-addressed store, hash-verified

409 // the name of that library. The string is prefixed with "lib" and suffixed
410 // with ".so".
411 private static @Nullable String getLibString(int depIndex) {
412 if (depIndex >= sPrecomputedLibs.size()) {
413 return null;
414 }
415
416 int initialOffset = sPrecomputedLibs.get(depIndex);
417 int byteOffset = initialOffset;
418 while (byteOffset < sEncodedDeps.length && sEncodedDeps[byteOffset] > ' ') {
419 ++byteOffset;
420 }
421
422 int libNameLength = (byteOffset - initialOffset) + LIB_PREFIX_SUFFIX_LEN;
423 char[] libBytes = new char[libNameLength];
424 libBytes[0] = 'l';
425 libBytes[1] = 'i';
426 libBytes[2] = 'b';
427 for (int i = 0; i < libNameLength - LIB_PREFIX_SUFFIX_LEN; ++i) {
428 libBytes[LIB_PREFIX_LEN + i] = (char) sEncodedDeps[initialOffset + i];
429 }
430 libBytes[libNameLength - 3] = '.';
431 libBytes[libNameLength - 2] = 's';
432 libBytes[libNameLength - 1] = 'o';
433
434 return new String(libBytes);
435 }
436
437 private static @Nullable String[] getDepsForLibAtOffset(int offset, int libNameLength) {
438 List<String> deps = new ArrayList<>();

Callers 1

getDepsForLibAtOffsetMethod · 0.95

Calls 2

sizeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected