parent
c16176c637
commit
88e5869642
|
|
@ -47,11 +47,7 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
|
||||||
String apk) {
|
String apk) {
|
||||||
super(dexBuffers, parent);
|
super(dexBuffers, parent);
|
||||||
this.apk = apk;
|
this.apk = apk;
|
||||||
try {
|
setDexName(apk);
|
||||||
fixDexName(apk);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Utils.logE("fix name", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.Q)
|
@RequiresApi(Build.VERSION_CODES.Q)
|
||||||
|
|
@ -62,11 +58,7 @@ public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
|
||||||
super(dexBuffers, librarySearchPath, parent);
|
super(dexBuffers, librarySearchPath, parent);
|
||||||
initNativeLibraryDirs(librarySearchPath);
|
initNativeLibraryDirs(librarySearchPath);
|
||||||
this.apk = apk;
|
this.apk = apk;
|
||||||
try {
|
setDexName(apk);
|
||||||
fixDexName(apk);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Utils.logE("fix name", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initNativeLibraryDirs(String librarySearchPath) {
|
private void initNativeLibraryDirs(String librarySearchPath) {
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,15 @@ public class ByteBufferDexClassLoader extends BaseDexClassLoader {
|
||||||
super(dexFiles, librarySearchPath, parent);
|
super(dexFiles, librarySearchPath, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fixDexName(String name) throws IllegalAccessException {
|
// 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);
|
nameField.set(dexFileField.get(((Object[]) dexElementsField.get(pathListField.get(this)))[0]), name);
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLdLibraryPath() {
|
public String getLdLibraryPath() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue