Skip to content

Commit

Permalink
Remove denyList
Browse files Browse the repository at this point in the history
Reviewed By: simpleton

Differential Revision: D50302417

fbshipit-source-id: b8bdacc777e5ae90bcbfe1d5f9671382b3fde69e
  • Loading branch information
adicatana authored and facebook-github-bot committed Oct 17, 2023
1 parent ce0df71 commit 7bd11f3
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ public class SoLoader {
/** Name of the directory we use for extracted DSOs from split APKs */
private static final String SO_STORE_NAME_SPLIT = "lib-";

private static final String[] DEFAULT_DENY_LIST =
new String[] {System.mapLibraryName("breakpad")};

/** Enable the exopackage SoSource. */
public static final int SOLOADER_ENABLE_EXOPACKAGE = (1 << 0);

Expand Down Expand Up @@ -231,12 +228,7 @@ interface AppType {
}

public static void init(Context context, int flags) throws IOException {
init(context, flags, null, DEFAULT_DENY_LIST);
}

public static void init(Context context, int flags, @Nullable SoFileLoader soFileLoader)
throws IOException {
init(context, flags, soFileLoader, DEFAULT_DENY_LIST);
init(context, flags, null);
}

/**
Expand All @@ -247,11 +239,9 @@ public static void init(Context context, int flags, @Nullable SoFileLoader soFil
* @param context application context
* @param flags Zero or more of the SOLOADER_* flags
* @param soFileLoader the custom {@link SoFileLoader}, you can implement your own loader
* @param denyList Skip load libs from system soSource, due to the linker namespace restriction
* @throws IOException IOException
*/
public static void init(
Context context, int flags, @Nullable SoFileLoader soFileLoader, String[] denyList)
public static void init(Context context, int flags, @Nullable SoFileLoader soFileLoader)
throws IOException {
if (isInitialized()) {
LogUtil.w(TAG, "SoLoader already initialized");
Expand All @@ -271,7 +261,7 @@ public static void init(
}

initSoLoader(context, soFileLoader);
initSoSources(context, flags, denyList);
initSoSources(context, flags);
LogUtil.v(TAG, "Init SoLoader delegate");
NativeLoader.initIfUninitialized(new NativeLoaderToSoLoaderDelegate());
} else {
Expand All @@ -294,7 +284,7 @@ public static void init(
*/
public static void init(Context context, boolean nativeExopackage) {
try {
init(context, nativeExopackage ? SOLOADER_ENABLE_EXOPACKAGE : 0, null, DEFAULT_DENY_LIST);
init(context, nativeExopackage ? SOLOADER_ENABLE_EXOPACKAGE : 0, null);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
Expand Down Expand Up @@ -331,8 +321,7 @@ private static boolean initEnableConfig(Context context) {
return (null == metaData || metaData.getBoolean(name, true));
}

private static void initSoSources(Context context, int flags, String[] denyList)
throws IOException {
private static void initSoSources(Context context, int flags) throws IOException {
if (sSoSources != null) {
return;
}
Expand All @@ -347,7 +336,7 @@ private static void initSoSources(Context context, int flags, String[] denyList)
sFlags = flags;

ArrayList<SoSource> soSources = new ArrayList<>();
addSystemLibSoSource(soSources, denyList);
addSystemLibSoSource(soSources);

// We can only proceed forward if we have a Context. The prominent case
// where we don't have a Context is barebones dalvikvm instantiations. In
Expand Down Expand Up @@ -501,9 +490,8 @@ private static void addBackupSoSourceFromSplitApk(
* Add SoSource objects for each of the system library directories.
*
* @param soSources target soSource list
* @param denyList Skip load libs from current soSource, due to the linker namespace restriction
*/
private static void addSystemLibSoSource(ArrayList<SoSource> soSources, String[] denyList) {
private static void addSystemLibSoSource(ArrayList<SoSource> soSources) {
String systemLibPaths =
SysUtil.is64Bit() ? "/system/lib64:/vendor/lib64" : "/system/lib:/vendor/lib";

Expand All @@ -519,8 +507,7 @@ private static void addSystemLibSoSource(ArrayList<SoSource> soSources, String[]
// these libraries have on each other, so doing that ourselves would be a waste.
LogUtil.d(TAG, "adding system library source: " + libPath);
File systemSoDirectory = new File(libPath);
soSources.add(
new DirectorySoSource(systemSoDirectory, DirectorySoSource.ON_LD_LIBRARY_PATH, denyList));
soSources.add(new DirectorySoSource(systemSoDirectory, DirectorySoSource.ON_LD_LIBRARY_PATH));
}
}

Expand Down

0 comments on commit 7bd11f3

Please sign in to comment.