2023-06-05 20:42:22 -04:00
|
|
|
#include <Geode/loader/IPC.hpp>
|
|
|
|
#include <loader/LoaderImpl.hpp>
|
2024-01-12 21:15:53 -05:00
|
|
|
#include <Geode/cocos/platform/android/jni/JniHelper.h>
|
2023-06-05 20:42:22 -04:00
|
|
|
|
2024-01-14 06:23:34 -05:00
|
|
|
using namespace geode::prelude;
|
2023-06-05 20:42:22 -04:00
|
|
|
|
2024-01-12 14:18:24 -05:00
|
|
|
std::string Loader::Impl::getGameVersion() {
|
|
|
|
if (m_gdVersion.empty()) {
|
2024-01-12 21:15:53 -05:00
|
|
|
/*
|
|
|
|
// 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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
2024-01-12 14:18:24 -05:00
|
|
|
}
|
|
|
|
return m_gdVersion;
|
|
|
|
}
|
|
|
|
|
2023-06-05 20:42:22 -04:00
|
|
|
bool Loader::Impl::userTriedToLoadDLLs() const {
|
|
|
|
return false;
|
|
|
|
}
|
2024-01-18 10:35:18 -05:00
|
|
|
|
|
|
|
void Loader::Impl::addNativeBinariesPath(ghc::filesystem::path const& path) {
|
|
|
|
log::warn("LoaderImpl::addNativeBinariesPath not implement on this platform, not adding path {}", path.string());
|
|
|
|
}
|
2024-01-24 14:04:00 -05:00
|
|
|
|
|
|
|
bool Loader::Impl::supportsLaunchArguments() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Loader::Impl::getLaunchCommand() const {
|
|
|
|
return std::string(); // Empty
|
|
|
|
}
|