Fix library search path on Android 9- (#1913)

This commit is contained in:
LoveSy 2022-05-04 11:07:06 +08:00 committed by GitHub
parent 779c178d0a
commit d54eddbb25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -46,9 +46,10 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
private LspModuleClassLoader(ByteBuffer[] dexBuffers,
ClassLoader parent,
String apk) {
String apk,
String librarySearchPath) {
super(dexBuffers, parent);
nativeLibraryDirs = new File[0];
nativeLibraryDirs = initNativeLibraryDirs(librarySearchPath);
this.apk = apk;
}
@ -200,8 +201,7 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
cl = new LspModuleClassLoader(dexBuffers, librarySearchPath,
parent, apk);
} else {
cl = new LspModuleClassLoader(dexBuffers, parent, apk);
cl.initNativeLibraryDirs(librarySearchPath);
cl = new LspModuleClassLoader(dexBuffers, parent, apk, librarySearchPath);
}
Arrays.stream(dexBuffers).parallel().forEach(SharedMemory::unmap);
dexes.stream().parallel().forEach(SharedMemory::close);