protected void prepare()

in java/com/facebook/soloader/DirectApkSoSource.java [145:171]


  protected void prepare(int flags) throws IOException {
    String subDir = null;
    if (!TextUtils.isEmpty(mDirectApkLdPath)) {
      final int i = mDirectApkLdPath.indexOf('!');
      if (i >= 0 && i + 2 < mDirectApkLdPath.length()) {
        // Exclude `!` and `/` in the path
        subDir = mDirectApkLdPath.substring(i + 2);
      }
    }
    if (subDir == null) {
      return;
    }

    try (ZipFile mZipFile = new ZipFile(mApkFile)) {
      Enumeration<? extends ZipEntry> entries = mZipFile.entries();
      while (entries.hasMoreElements()) {
        ZipEntry entry = entries.nextElement();
        if (entry != null
            && entry.getName().startsWith(subDir)
            && entry.getName().endsWith(".so")
            && entry.getMethod() == ZipEntry.STORED) {
          final String soName = entry.getName().substring(subDir.length() + 1);
          mLibsInApk.add(soName);
        }
      }
    }
  }