parent
c16176c637
commit
88e5869642
|
|
@ -47,11 +47,7 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
|
|||
String apk) {
|
||||
super(dexBuffers, parent);
|
||||
this.apk = apk;
|
||||
try {
|
||||
fixDexName(apk);
|
||||
} catch (Throwable e) {
|
||||
Utils.logE("fix name", e);
|
||||
}
|
||||
setDexName(apk);
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
|
|
@ -62,11 +58,7 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
|
|||
super(dexBuffers, librarySearchPath, parent);
|
||||
initNativeLibraryDirs(librarySearchPath);
|
||||
this.apk = apk;
|
||||
try {
|
||||
fixDexName(apk);
|
||||
} catch (Throwable e) {
|
||||
Utils.logE("fix name", e);
|
||||
}
|
||||
setDexName(apk);
|
||||
}
|
||||
|
||||
private void initNativeLibraryDirs(String librarySearchPath) {
|
||||
|
|
|
|||
|
|
@ -35,8 +35,15 @@ public class ByteBufferDexClassLoader extends BaseDexClassLoader {
|
|||
super(dexFiles, librarySearchPath, parent);
|
||||
}
|
||||
|
||||
public void fixDexName(String name) throws IllegalAccessException {
|
||||
nameField.set(dexFileField.get(((Object[]) dexElementsField.get(pathListField.get(this)))[0]), name);
|
||||
// Some modules get their module paths from this variable
|
||||
// They should use `initZygote.modulePath` instead
|
||||
// Temporarily workaround
|
||||
// TODO(vvb2060): removed in the next major release
|
||||
public void setDexName(String name){
|
||||
try {
|
||||
nameField.set(dexFileField.get(((Object[]) dexElementsField.get(pathListField.get(this)))[0]), name);
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public String getLdLibraryPath() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue