From 1bd762fc486238d0114a914a9e00e27c45f55419 Mon Sep 17 00:00:00 2001 From: Sim Sun Date: Wed, 25 Oct 2023 12:40:37 -0700 Subject: [PATCH] add base apk paths from classloader into directAPK soSource Reviewed By: michalgr Differential Revision: D50625811 fbshipit-source-id: 7f4cabf4809d44ee303c95d8873dd76afe6d2fae --- java/com/facebook/soloader/DirectApkSoSource.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/com/facebook/soloader/DirectApkSoSource.java b/java/com/facebook/soloader/DirectApkSoSource.java index 05b2a77..1a0492a 100644 --- a/java/com/facebook/soloader/DirectApkSoSource.java +++ b/java/com/facebook/soloader/DirectApkSoSource.java @@ -115,6 +115,17 @@ public String getLibraryPath(String soName) throws IOException { /*package*/ static Set getDirectApkLdPaths(Context context) { Set directApkPathSet = new HashSet<>(); + final String classLoaderLdLibraryPath = SysUtil.getClassLoaderLdLoadLibrary(); + if (classLoaderLdLibraryPath != null) { + LogUtil.w(SoLoader.TAG, "ClassLoader LdLibrary Path: " + classLoaderLdLibraryPath); + final String[] paths = classLoaderLdLibraryPath.split(":"); + for (final String path : paths) { + if (path.contains(".apk!/")) { + directApkPathSet.add(path); + } + } + } + final String apkPath = context.getApplicationInfo().sourceDir; final @Nullable String fallbackApkLdPath = getFallbackApkLdPath(apkPath); if (fallbackApkLdPath != null) {