From bc2503a230b08e3bf80f3c55bfe9b9dfbd3044ef Mon Sep 17 00:00:00 2001 From: Adrian Catana Date: Mon, 30 Sep 2024 13:33:19 -0700 Subject: [PATCH] Remove denylist Reviewed By: michalgr Differential Revision: D63632310 fbshipit-source-id: 7d0b24223570dca49cec8dc4b8c7d4fdf17e2e98 --- .../facebook/soloader/DirectorySoSource.java | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/java/com/facebook/soloader/DirectorySoSource.java b/java/com/facebook/soloader/DirectorySoSource.java index 97cec4b..aee6d66 100644 --- a/java/com/facebook/soloader/DirectorySoSource.java +++ b/java/com/facebook/soloader/DirectorySoSource.java @@ -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. */ @@ -32,7 +30,6 @@ public class DirectorySoSource extends SoSource { protected final File soDirectory; protected int flags; - protected final List denyList; /** * Make a new DirectorySoSource. If {@code flags} contains {@link @@ -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 { @@ -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());