mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 03:15:38 -05:00
getGameVersion android but commented out
This commit is contained in:
parent
21caf514c2
commit
9661693e72
1 changed files with 20 additions and 1 deletions
|
@ -9,6 +9,7 @@ using namespace geode::prelude;
|
|||
|
||||
#ifdef GEODE_IS_ANDROID
|
||||
|
||||
#include <Geode/cocos/platform/android/jni/JniHelper.h>
|
||||
#include <android/log.h>
|
||||
|
||||
namespace {
|
||||
|
@ -25,7 +26,25 @@ namespace {
|
|||
|
||||
std::string Loader::Impl::getGameVersion() {
|
||||
if (m_gdVersion.empty()) {
|
||||
// TODO: detect gd version
|
||||
/*
|
||||
// before uncommenting please note:
|
||||
// getGameVersion can only run after JNI_OnLoad is called. otherwise it crashes
|
||||
|
||||
JniMethodInfo t;
|
||||
if (JniHelper::getStaticMethodInfo(t, "com/geode/launcher/utils/GeodeUtils", "getGameVersion", "()Ljava/lang/String;")) {
|
||||
jstring str = reinterpret_cast<jstring>(t.env->CallStaticObjectMethod(t.classID, t.methodID));
|
||||
t.env->DeleteLocalRef(t.classID);
|
||||
m_gdVersion = JniHelper::jstring2string(str);
|
||||
t.env->DeleteLocalRef(str);
|
||||
} else {
|
||||
auto vm = JniHelper::getJavaVM();
|
||||
|
||||
JNIEnv* env;
|
||||
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) == JNI_OK) {
|
||||
env->ExceptionClear();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
return m_gdVersion;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue