//
// sub_B0F8FC from 0xb0f8fc to 0xb0fa00 (260 bytes)
//
// 6 xrefs:
// > cocos2d::JniHelper::getClassID @ 0xb0faa8
// > cocos2d::JniHelper::getStaticMethodInfo @ 0xb0fb28
// > cocos2d::JniHelper::getStaticMethodInfo @ 0xb0fbc8
// > cocos2d::JniHelper::getMethodInfo @ 0xb0fc6c
// > cocos2d::JniHelper::getMethodInfo @ 0xb0fd0c
// > cocos2d::JniHelper::jstring2string @ 0xb0fda4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_B0F8FC(cocos2d::JniHelper *a1)
{
__int64 JavaVM; // x0
int v3; // w0
unsigned int v4; // w20
cocos2d::JniHelper *v6; // x0
__int64 v7; // x0
JavaVM = cocos2d::JniHelper::getJavaVM(a1);
v3 = (*(__int64 (__fastcall **)(__int64, cocos2d::JniHelper *, __int64))(*(_QWORD *)JavaVM + 48LL))(JavaVM, a1, 65540);
if ( v3 == -2 )
{
v6 = (cocos2d::JniHelper *)pthread_key_create((pthread_key_t *)&dword_1245978, (void (*)(void *))sub_B0FA00);
v7 = cocos2d::JniHelper::getJavaVM(v6);
if ( ((*(__int64 (__fastcall **)(__int64, cocos2d::JniHelper *, _QWORD))(*(_QWORD *)v7 + 32LL))(v7, a1, 0)
& 0x80000000) != 0 )
{
v4 = 0;
__android_log_print(3, "JniHelper", "%s", "Failed to get the environment using AttachCurrentThread()");
}
else
{
v4 = 1;
if ( !pthread_getspecific(dword_1245978) )
pthread_setspecific(dword_1245978, a1);
}
return v4;
}
v4 = 1;
if ( !v3 )
return v4;
__android_log_print(3, "JniHelper", "%s", "Failed to get the environment using GetEnv()");
return 0;
}