From 20c32d79db6c7cb83737ef0142fd75d7ec35c81c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 19 Mar 2016 02:49:56 -0700 Subject: [PATCH] Support 7a09b83's new boolean argument on startVm. --- Java/Execute.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Java/Execute.cpp b/Java/Execute.cpp index 618be7c..7390d30 100644 --- a/Java/Execute.cpp +++ b/Java/Execute.cpp @@ -1515,14 +1515,16 @@ static JavaVM *CYGetJavaVM(JSContextRef context) { if (void *libandroid_runtime = dlopen("libandroid_runtime.so", RTLD_LAZY | RTLD_GLOBAL)) { class AndroidRuntime$; AndroidRuntime$ *(*AndroidRuntime$$init$)(AndroidRuntime$ *self, char *args, unsigned int size)(NULL); - int (*AndroidRuntime$startVm)(AndroidRuntime$ *self, JavaVM **jvm, JNIEnv **env)(NULL); + int (*AndroidRuntime$startVm1)(AndroidRuntime$ *self, JavaVM **jvm, JNIEnv **env)(NULL); + int (*AndroidRuntime$startVm2)(AndroidRuntime$ *self, JavaVM **jvm, JNIEnv **env, bool)(NULL); int (*AndroidRuntime$startReg)(JNIEnv *env)(NULL); int (*AndroidRuntime$addOption)(AndroidRuntime$ *self, const char *option, void *extra)(NULL); int (*AndroidRuntime$addVmArguments)(AndroidRuntime$ *self, int, const char *const argv[])(NULL); AndroidRuntime$ *(*AndroidRuntime$finalize)(AndroidRuntime$ *self)(NULL); dlset(AndroidRuntime$$init$, "_ZN7android14AndroidRuntimeC1EPcj", libandroid_runtime); - dlset(AndroidRuntime$startVm, "_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnv", libandroid_runtime); + dlset(AndroidRuntime$startVm1, "_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnv", libandroid_runtime); + dlset(AndroidRuntime$startVm2, "_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnvb", libandroid_runtime); dlset(AndroidRuntime$startReg, "_ZN7android14AndroidRuntime8startRegEP7_JNIEnv", libandroid_runtime); dlset(AndroidRuntime$addOption, "_ZN7android14AndroidRuntime9addOptionEPKcPv", libandroid_runtime); dlset(AndroidRuntime$addVmArguments, "_ZN7android14AndroidRuntime14addVmArgumentsEiPKPKc", libandroid_runtime); @@ -1545,8 +1547,13 @@ static JavaVM *CYGetJavaVM(JSContextRef context) { int failure; - _assert(AndroidRuntime$startVm != NULL); - failure = AndroidRuntime$startVm(runtime, &jvm, &env); + if (false); + else if (AndroidRuntime$startVm1 != NULL) + failure = AndroidRuntime$startVm1(runtime, &jvm, &env); + else if (AndroidRuntime$startVm2 != NULL) + failure = AndroidRuntime$startVm2(runtime, &jvm, &env, false); + else _assert(false); + _assert(failure == 0); _assert(AndroidRuntime$startReg != NULL); -- 2.45.2