Skip to content

Commit

Permalink
add base apk paths from classloader into directAPK soSource
Browse files Browse the repository at this point in the history
Reviewed By: michalgr

Differential Revision: D50625811

fbshipit-source-id: 7f4cabf4809d44ee303c95d8873dd76afe6d2fae
  • Loading branch information
simpleton authored and facebook-github-bot committed Oct 25, 2023
1 parent 6b32012 commit 1bd762f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions java/com/facebook/soloader/DirectApkSoSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ public String getLibraryPath(String soName) throws IOException {
/*package*/ static Set<String> getDirectApkLdPaths(Context context) {
Set<String> 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) {
Expand Down

0 comments on commit 1bd762f

Please sign in to comment.