Skip to content

Commit

Permalink
Compatible with Steam and Epic (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
cddjr committed Oct 21, 2022
1 parent 6ad29bb commit eceb352
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 59 deletions.
54 changes: 1 addition & 53 deletions appdata/il2cpp-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions hooks/EOSManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
4 changes: 1 addition & 3 deletions used_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ TMP_Text
TextMeshPro
PlayerOutfitType__Enum
AccountTab
DestroyableSingleton_1_EOSManager___Fields
EOSManager
FullAccount
SpawnFlags__Enum
Expand Down Expand Up @@ -221,5 +220,4 @@ EOSManager_AccountLoginStatus__Enum
DestroyableSingleton_1_PlayerStorageManager___Fields
PlayerStorageManager_CloudPlayerPrefs
PlayerStorageManager__Fields
UpdateState__Enum
EOSManager__Fields
UpdateState__Enum
6 changes: 6 additions & 0 deletions user/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit eceb352

Please sign in to comment.