diff --git a/appdata/il2cpp-types.h b/appdata/il2cpp-types.h index 372b7ecc..0c592781 100644 --- a/appdata/il2cpp-types.h +++ b/appdata/il2cpp-types.h @@ -4428,63 +4428,11 @@ namespace app #pragma endregion #pragma region EOSManager - struct DestroyableSingleton_1_EOSManager___Fields - { - struct MonoBehaviour__Fields _; - bool DontDestroy; - }; - - struct EOSManager__Fields { - struct DestroyableSingleton_1_EOSManager___Fields _; - struct String* loginCredentialId; - struct String* productName; - struct String* productVersion; - struct String* productId; - struct String* sandboxId; - struct String* deploymentId; - struct String* clientId; - struct String* clientSecret; - struct String* friendCode; - bool hasRunLoginFlow; - float platformTickTimer; - bool platformInitialized; - bool loginFlowFinished; - bool stopTimeOutCheck; - struct GameObject* TimeOutPopup; - float TimeOutTime; - bool FinishedAssets; - void* platformInterface; - void* userId; - void* deviceIDuserID; - bool announcementsVisible; - bool attemptAuthAgain; - uint32_t numLinkedAccounts; - void* linkedExternalAccounts; - void* editAccountUsername; - void* askToMergeAccount; - struct String* freeChatKey; - struct String* customNameKey; - struct String* friendsListKey; - struct String* accountLinkKey; - void* logger; - int32_t ageOfConsent; - struct String* kwsUserId; - bool isKWSMinor; - void* continuanceToken; - struct String* exchangeToken; - struct String* platformAuthToken; - bool authExpiredCallbackTriggered; - bool silentLoginFailed; - void* validateOldDLC; - bool isRedeemingDLC; - void* s_eosPlatformInterface; - }; - struct EOSManager { struct EOSManager__Class* klass; void* monitor; - struct EOSManager__Fields fields; + //struct EOSManager__Fields fields; }; struct EOSManager__VTable diff --git a/hooks/EOSManager.cpp b/hooks/EOSManager.cpp index 649cb30b..3823ce95 100644 --- a/hooks/EOSManager.cpp +++ b/hooks/EOSManager.cpp @@ -2,11 +2,11 @@ #include "_hooks.h" #include "logger.h" -void fakeSuccessfulLogin(EOSManager* eosManager) +/*void fakeSuccessfulLogin(EOSManager* eosManager) { eosManager->fields.loginFlowFinished = true; EOSManager_HasFinishedLoginFlow(eosManager, NULL); -} +}*/ void dEOSManager_LoginFromAccountTab(EOSManager* __this, MethodInfo* method) { @@ -31,6 +31,13 @@ bool dEOSManager_IsFreechatAllowed(EOSManager* __this, MethodInfo* method) } void dEOSManager_UpdatePermissionKeys(EOSManager* __this, void* callback, MethodInfo* method) { - __this->fields.isKWSMinor = false; + // Compatible with Steam and Epic + Il2CppClass* klass = get_class("Assembly-CSharp, EOSManager"); + LOG_ASSERT(klass); + FieldInfo* field = il2cpp_class_get_field_from_name(klass, "isKWSMinor"); + LOG_ASSERT(field); + bool value = false; + il2cpp_field_set_value((Il2CppObject*)__this, field, &value); + app::EOSManager_UpdatePermissionKeys(__this, callback, method); } \ No newline at end of file diff --git a/used_types.txt b/used_types.txt index b3f18f19..5e11969d 100644 --- a/used_types.txt +++ b/used_types.txt @@ -54,7 +54,6 @@ TMP_Text TextMeshPro PlayerOutfitType__Enum AccountTab -DestroyableSingleton_1_EOSManager___Fields EOSManager FullAccount SpawnFlags__Enum @@ -221,5 +220,4 @@ EOSManager_AccountLoginStatus__Enum DestroyableSingleton_1_PlayerStorageManager___Fields PlayerStorageManager_CloudPlayerPrefs PlayerStorageManager__Fields -UpdateState__Enum -EOSManager__Fields \ No newline at end of file +UpdateState__Enum \ No newline at end of file diff --git a/user/logger.h b/user/logger.h index e988e421..8f794508 100644 --- a/user/logger.h +++ b/user/logger.h @@ -39,4 +39,10 @@ class AUMLogger { LOG_ERROR(ss.str()); \ } while (0) +#define LOG_ASSERT(EXPR) \ + if (!(EXPR)) { \ + STREAM_ERROR("(" << #EXPR << ") Assert failed."); \ + exit(1); \ + } + extern AUMLogger Log; \ No newline at end of file