//
// AccountLayer::onBackup from 0x98cd9c to 0x98cfbc (544 bytes)
//
// 3 xrefs:
// > ??> @ 0x56590
// > AccountLayer::customSetup @ 0x98de9c
// > ??> @ 0x1541f18
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:57:57 +0000
//
__int64 __fastcall AccountLayer::onBackup(AccountLayer *this, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x0
GameLevelManager *Stat; // x0
cocos2d::CCString *v5; // x0
const char *CString; // x0
size_t v7; // x0
__int64 v8; // x0
ButtonSprite **v9; // x20
GameLevelManager *v11; // x0
unsigned int TimeLeft; // w0
cocos2d::CCString *v13; // x0
const char *v14; // x0
size_t v15; // x0
char *v16; // [xsp+38h] [xbp+38h]
char *v17; // [xsp+38h] [xbp+38h]
__int64 v18; // [xsp+40h] [xbp+40h] BYREF
__int64 v19; // [xsp+48h] [xbp+48h]
void *v20; // [xsp+50h] [xbp+50h]
v3 = (GameStatsManager *)GameStatsManager::sharedState(_stack_chk_guard);
Stat = (GameLevelManager *)GameStatsManager::getStat(v3, "6");
if ( (int)Stat <= 9 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need to collect atleast %i stars to enable saving.",
&byte_9[1]);
CString = (const char *)cocos2d::CCString::getCString(v5);
v18 = 0;
v16 = (char *)CString;
v19 = 0;
v20 = nullptr;
v7 = strlen(CString);
std::string::__init(&v18, v16, v7);
v8 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Collect more",
(char *)&v18,
(ButtonSprite *)"OK",
nullptr,
300.0);
goto LABEL_3;
}
v11 = (GameLevelManager *)GameLevelManager::sharedState(Stat);
TimeLeft = GameLevelManager::getTimeLeft(v11, "bak_account", 30.0);
if ( TimeLeft - 1 <= 0x1D )
{
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Please wait %i seconds before attempting to back up your account again.",
(const char *)TimeLeft);
v14 = (const char *)cocos2d::CCString::getCString(v13);
v18 = 0;
v17 = (char *)v14;
v19 = 0;
v20 = nullptr;
v15 = strlen(v14);
std::string::__init(&v18, v17, v15);
v8 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Too Fast",
(char *)&v18,
(ButtonSprite *)"OK",
nullptr,
300.0);
LABEL_3:
v9 = (ButtonSprite **)v8;
if ( (v18 & 1) != 0 )
operator delete(v20);
goto LABEL_5;
}
v18 = 0;
v19 = 0;
v20 = nullptr;
std::string::__init(
&v18,
"Do you want to save your account data on the cloud?\n"
"This will overwrite previously saved data.",
0x76u);
v9 = (ButtonSprite **)FLAlertLayer::create(
(__int64)this + 632,
(cocos2d::CCLabelBMFont *)"Save Data",
(char *)&v18,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Save",
300.0);
if ( (v18 & 1) != 0 )
operator delete(v20);
ButtonSprite::updateBGImage(v9[76], "GJ_button_06.png");
(*((void (__fastcall **)(ButtonSprite **, __int64))*v9 + 9))(v9, 1);
LABEL_5:
(*((void (__fastcall **)(ButtonSprite **))*v9 + 164))(v9);
return _stack_chk_guard;
}