Change VMStack hidden API

This commit is contained in:
khanhduytran0 2020-03-29 10:47:59 +07:00
parent 79438184f8
commit 23354ab0ca
3 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,6 @@ import org.lwjgl.opengl.*;
import android.app.AlertDialog;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import libcore.util.*;
import dalvik.system.*;
import java.lang.reflect.*;
import net.kdt.pojavlaunch.patcher.*;

View File

@ -16,7 +16,6 @@ import java.util.zip.*;
import net.kdt.pojavlaunch.util.*;
import net.kdt.pojavlaunch.value.*;
import org.apache.commons.codec.digest.*;
import libcore.util.*;
import net.kdt.pojavlaunch.patcher.*;
import java.lang.reflect.*;
import dalvik.system.*;

View File

@ -30,7 +30,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import dalvik.system.VMStack;
// import dalvik.system.VMStack;
/** Common utility routines used by both java.lang and
java.lang.reflect */
@ -74,7 +74,11 @@ public class Reflection {
public static Class<?> getCallerClass() {
// This method (getCallerClass()) constitutes another stack frame,
// so we need to call getStackClass2() rather than getStackClass1().
return VMStack.getStackClass2();
try {
return (Class<?>) Class.forName("dalvik.system.VMStack").getMethod("getStackClass2").invoke(null);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
// END Android-changed: getCallerClass() reimplementation.