Skip to content

Commit

Permalink
Remove denylist
Browse files Browse the repository at this point in the history
Reviewed By: michalgr

Differential Revision: D63632310

fbshipit-source-id: 7d0b24223570dca49cec8dc4b8c7d4fdf17e2e98
  • Loading branch information
adicatana authored and facebook-github-bot committed Sep 30, 2024
1 parent 5d17873 commit bc2503a
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions java/com/facebook/soloader/DirectorySoSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
import android.os.StrictMode;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nullable;

/** {@link SoSource} that finds shared libraries in a given directory. */
Expand All @@ -32,7 +30,6 @@ public class DirectorySoSource extends SoSource {

protected final File soDirectory;
protected int flags;
protected final List<String> denyList;

/**
* Make a new DirectorySoSource. If {@code flags} contains {@link
Expand All @@ -44,27 +41,14 @@ public class DirectorySoSource extends SoSource {
* @param flags load flags
*/
public DirectorySoSource(File soDirectory, int flags) {
this(soDirectory, flags, new String[0]);
this.soDirectory = soDirectory;
this.flags = flags;
}

public void setExplicitDependencyResolution() {
flags |= RESOLVE_DEPENDENCIES;
}

/**
* This method is similar to {@link #DirectorySoSource(File, int)}, with the following
* differences:
*
* @param soDirectory the dir that contains the so files
* @param flags load flags
* @param denyList the soname list that we won't try to load from this source
*/
public DirectorySoSource(File soDirectory, int flags, String[] denyList) {
this.soDirectory = soDirectory;
this.flags = flags;
this.denyList = Arrays.asList(denyList);
}

@Override
public int loadLibrary(String soName, int loadFlags, StrictMode.ThreadPolicy threadPolicy)
throws IOException {
Expand All @@ -79,13 +63,6 @@ protected int loadLibraryFrom(
throw new IllegalStateException("SoLoader.init() not yet called");
}

if (denyList.contains(soName)) {
LogUtil.d(
SoLoader.TAG,
soName + " is on the denyList, skip loading from " + libDir.getCanonicalPath());
return LOAD_RESULT_NOT_FOUND;
}

File soFile = getSoFileByName(soName);
if (soFile == null) {
LogUtil.v(SoLoader.TAG, soName + " file not found on " + libDir.getCanonicalPath());
Expand Down

0 comments on commit bc2503a

Please sign in to comment.