//
// RewardUnlockLayer::init from 0x61968c to 0x619f5e (2258 bytes)
//
// 1 xrefs:
// > RewardUnlockLayer::create @ 0x619ffa
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:58 +0000
//
GameManager *__fastcall RewardUnlockLayer::init(cocos2d::CCArray **this, GJChestSprite *a2, RewardsPage *a3)
{
GameManager *v5; // r0
cocos2d::CCObject *v6; // r0
cocos2d::CCDirector *v7; // r0
const char *v8; // r1
char v9; // r3
float v10; // r8
char *v11; // r7
cocos2d::CCNode *v12; // r5
void (__fastcall *v13)(cocos2d::CCNode *, _DWORD *); // r10
void (__fastcall *v14)(cocos2d::CCNode *, _DWORD *); // r10
float v15; // r1
cocos2d::CCAction *v16; // r0
unsigned __int8 v17; // r2
cocos2d::CCAction *v18; // r0
int i; // r9
void (__fastcall *v20)(cocos2d::CCNode *, _DWORD *); // r10
void (__fastcall *v21)(cocos2d::CCNode *, _DWORD *); // r9
float v22; // r1
cocos2d::CCAction *v23; // r0
size_t v24; // r0
int v25; // r3
float v26; // s15
float v27; // s14
void (__fastcall *v28)(cocos2d::CCNode *, _DWORD *); // r10
float v29; // r1
cocos2d::CCAction *v30; // r0
int v31; // r1
size_t v32; // r0
void (__fastcall *v33)(cocos2d::CCNode *, unsigned int); // r7
int v34; // r0
void (__fastcall *v35)(cocos2d::CCNode *, unsigned int); // r7
int v36; // r0
void (__fastcall *v37)(cocos2d::CCNode *, unsigned int); // r7
int v38; // r0
void (__fastcall *v39)(cocos2d::CCNode *, unsigned int); // r7
int v40; // r0
cocos2d::CCSprite *v41; // r0
int v42; // r9
float v43; // s16
void (__fastcall *v44)(int, _DWORD *); // r10
int v45; // r0
const cocos2d::CCPoint *v46; // r2
cocos2d::CCEaseBounceOut *v47; // r0
cocos2d::CCActionInterval *v48; // r1
cocos2d::CCAction *v49; // r0
float v50; // r1
cocos2d::CCSequence *v51; // r9
cocos2d::CCFiniteTimeAction *v52; // r0
cocos2d::CCAction *v53; // r0
const char *v54; // r1
cocos2d::CCNode *v55; // r0
float v56; // s16
bool v57; // zf
cocos2d::CCNode *v58; // r9
void (__fastcall *v59)(cocos2d::CCNode *, _DWORD *); // r6
unsigned __int8 v60; // r2
cocos2d::CCAction *v61; // r0
float v62; // r2
cocos2d::CCEaseBounceOut *v63; // r0
cocos2d::CCActionInterval *v64; // r1
cocos2d::CCAction *v65; // r0
float v66; // r1
cocos2d::CCSequence *v67; // r7
const cocos2d::CCPoint *v68; // r2
cocos2d::CCFiniteTimeAction *v69; // r6
const cocos2d::CCPoint *v70; // r2
int v71; // r9
const cocos2d::CCPoint *v72; // r2
int v73; // r8
const cocos2d::CCPoint *v74; // r2
const cocos2d::CCPoint *v75; // r2
int v76; // r10
const cocos2d::CCPoint *v77; // r2
float v78; // r1
int v79; // r0
cocos2d::CCAction *v80; // r0
const char *v81; // r1
int v82; // r0
int v83; // r0
const char *v84; // r1
int v85; // r0
int v86; // r0
cocos2d::CCArray *v87; // r0
int v88; // r7
const cocos2d::CCPoint *v89; // r9
void (__fastcall *v90)(int, _DWORD *); // r8
int v91; // r7
const cocos2d::CCPoint *v92; // r9
void (__fastcall *v93)(int, _DWORD *); // r8
const char *v94; // r2
cocos2d::CCArray *v95; // r0
int v96; // r6
void (__fastcall *v97)(int, _DWORD *); // r7
float v98; // r1
cocos2d::CCSequence *v99; // r6
cocos2d::CCFiniteTimeAction *v100; // r0
cocos2d::CCAction *v101; // r0
int v103; // [sp+1Ch] [bp-98h]
cocos2d::CCObject *v105; // [sp+20h] [bp-94h]
GameManager *v106; // [sp+24h] [bp-90h]
int v107; // [sp+28h] [bp-8Ch]
_WORD v108[2]; // [sp+30h] [bp-84h] BYREF
float v109; // [sp+34h] [bp-80h] BYREF
float v110; // [sp+38h] [bp-7Ch]
_BYTE v111[8]; // [sp+3Ch] [bp-78h] BYREF
_BYTE v112[8]; // [sp+44h] [bp-70h] BYREF
int (__fastcall *v113)(RewardUnlockLayer *, int, int, int); // [sp+4Ch] [bp-68h]
int v114; // [sp+50h] [bp-64h]
int (__fastcall *v115)(RewardUnlockLayer *); // [sp+54h] [bp-60h]
int v116; // [sp+58h] [bp-5Ch]
int (__fastcall *v117)(RewardUnlockLayer *, cocos2d::CCObject *); // [sp+5Ch] [bp-58h]
int v118; // [sp+60h] [bp-54h]
_DWORD v119[2]; // [sp+64h] [bp-50h] BYREF
int v120[2]; // [sp+6Ch] [bp-48h] BYREF
char *v121; // [sp+74h] [bp-40h]
int v122[2]; // [sp+78h] [bp-3Ch] BYREF
char *v123; // [sp+80h] [bp-34h]
int v124[3]; // [sp+84h] [bp-30h] BYREF
int v125[3]; // [sp+90h] [bp-24h] BYREF
_DWORD v126[4]; // [sp+9Ch] [bp-18h] BYREF
v5 = FLAlertLayer::init((FLAlertLayer *)this, 0);
v106 = v5;
if ( !v5 )
return v106;
v6 = (cocos2d::CCObject *)cocos2d::CCArray::create(v5);
*(this + 131) = v6;
v7 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(v6);
cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v109);
if ( (int)a2 > 5 )
v8 = "GJ_square06.png";
else
v8 = "GJ_square02.png";
v120[0] = 0;
v120[1] = 0;
v121 = nullptr;
std::string::__init(v120, v8, 0xFu);
v122[0] = 0;
v122[1] = 0;
v123 = nullptr;
std::string::__init(v122, "rewardCorner_001.png", 0x14u);
v108[0] = -1;
LOBYTE(v108[1]) = -1;
if ( a2 == (GJChestSprite *)&byte_6 )
{
v108[0] = 17421;
v9 = 104;
goto LABEL_13;
}
if ( a2 == (GJChestSprite *)&byte_7 )
{
v10 = -50.0;
qmemcpy(v108, "3eJ", 3);
}
else
{
if ( a2 != (GJChestSprite *)byte_8 )
{
if ( a2 != (GJChestSprite *)byte_9 )
{
LABEL_14:
v10 = 0.0;
goto LABEL_15;
}
v108[0] = 9522;
v9 = 56;
LABEL_13:
LOBYTE(v108[1]) = v9;
goto LABEL_14;
}
v10 = 80.0;
qmemcpy(v108, "I\"^", 3);
}
LABEL_15:
if ( (v120[0] & 1) != 0 )
v11 = v121;
else
v11 = (char *)v120 + 1;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v126, 0.0, 0.0, 80.0, 80.0);
v12 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(v11, v126);
(*(void (__fastcall **)(cocos2d::CCNode *, _DWORD))(*(_DWORD *)v12 + 456))(v12, 0);
v13 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v12 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v126, 340.0, 220.0);
v13(v12, v126);
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v12, -1);
v14 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v12 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, v109 * 0.5, v110 * 0.5);
v14(v12, v126);
v16 = (cocos2d::CCAction *)cocos2d::CCFadeIn::create((cocos2d::CCFadeIn *)0x3E4CCCCD, v15);
cocos2d::CCNode::runAction(v12, v16);
(*(void (__fastcall **)(cocos2d::CCNode *, _WORD *))(*(_DWORD *)v12 + 480))(v12, v108);
cocos2d::CCArray::addObject(*(this + 131), v12);
if ( (int)a2 > 5 )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v126, 0.0, 0.0, 80.0, 80.0);
v12 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create("GJ_square07.png", v126);
(*(void (__fastcall **)(cocos2d::CCNode *, _DWORD))(*(_DWORD *)v12 + 456))(v12, 0);
v20 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v12 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v126, 340.0, 220.0);
v20(v12, v126);
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v12, -2);
v21 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v12 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, v109 * 0.5, v110 * 0.5);
v21(v12, v126);
v23 = (cocos2d::CCAction *)cocos2d::CCFadeIn::create((cocos2d::CCFadeIn *)0x3E4CCCCD, v22);
cocos2d::CCNode::runAction(v12, v23);
cocos2d::CCArray::addObject(*(this + 131), v12);
}
v18 = (cocos2d::CCAction *)cocos2d::CCFadeTo::create((cocos2d::CCFadeTo *)0x3E4CCCCD, COERCE_FLOAT(150), v17);
cocos2d::CCNode::runAction((cocos2d::CCNode *)this, v18);
for ( i = 0; i != 4; ++i )
{
if ( a2 == (GJChestSprite *)byte_9 )
{
if ( (v122[0] & 1) == 0 )
v12 = (cocos2d::CCNode *)((char *)v122 + 1);
v124[0] = 0;
if ( (v122[0] & 1) != 0 )
v12 = (cocos2d::CCNode *)v123;
v124[1] = 0;
v124[2] = 0;
v24 = strlen((const char *)v12);
std::string::__init(v124, v12, v24);
v12 = CCSpriteGrayscale::createWithSpriteFrameName((char *)v124);
std::string::~string((int)v124);
}
else
{
if ( (v122[0] & 1) == 0 )
v12 = (cocos2d::CCNode *)((char *)v122 + 1);
v125[0] = 0;
if ( (v122[0] & 1) != 0 )
v12 = (cocos2d::CCNode *)v123;
v125[1] = 0;
v125[2] = 0;
v32 = strlen((const char *)v12);
std::string::__init(v125, v12, v32);
v12 = CCSpriteWithHue::createWithSpriteFrameName((char *)v125);
std::string::~string((int)v125);
if ( (int)a2 > 5 )
CCSpriteWithHue::setHueDegrees(v12, v10);
}
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v12, 8);
cocos2d::CCArray::addObject(*(this + 131), v12);
v25 = *(_DWORD *)v12;
switch ( i )
{
case 2:
v35 = *(void (__fastcall **)(cocos2d::CCNode *, unsigned int))(v25 + 64);
v36 = (*(int (__fastcall **)(cocos2d::CCNode *))(v25 + 68))(v12);
v35(v12, v36 ^ 0x80000000);
v37 = *(void (__fastcall **)(cocos2d::CCNode *, unsigned int))(*(_DWORD *)v12 + 72);
v38 = (*(int (__fastcall **)(cocos2d::CCNode *))(*(_DWORD *)v12 + 76))(v12);
v37(v12, v38 ^ 0x80000000);
v26 = 85.0;
LABEL_42:
v27 = 145.0;
goto LABEL_31;
case 3:
v39 = *(void (__fastcall **)(cocos2d::CCNode *, unsigned int))(v25 + 64);
v40 = (*(int (__fastcall **)(cocos2d::CCNode *))(v25 + 68))(v12);
v39(v12, v40 ^ 0x80000000);
v26 = -85.0;
goto LABEL_42;
case 1:
v33 = *(void (__fastcall **)(cocos2d::CCNode *, unsigned int))(v25 + 72);
v34 = (*(int (__fastcall **)(cocos2d::CCNode *))(v25 + 76))(v12);
v33(v12, v34 ^ 0x80000000);
v26 = 85.0;
break;
default:
v26 = -85.0;
break;
}
v27 = -145.0;
LABEL_31:
v28 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v12 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, v27 + (float)(v109 * 0.5), v26 + (float)(v110 * 0.5));
v28(v12, v126);
v30 = (cocos2d::CCAction *)cocos2d::CCFadeIn::create((cocos2d::CCFadeIn *)0x3E4CCCCD, v29);
cocos2d::CCNode::runAction(v12, v30);
}
*(this + 132) = a3;
if ( a3 )
cocos2d::CCObject::retain(a3);
*(this + 134) = a2;
v41 = GJChestSprite::create(a2, v31);
*(this + 133) = v41;
(*(void (__fastcall **)(_DWORD, cocos2d::CCSprite *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v41, 2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v111, v109 * 0.5, (float)(v110 * 0.5) - 20.0);
v42 = (int)*(this + 133);
v43 = v110;
v44 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v42 + 92);
v45 = (*(int (__fastcall **)(int))(*(_DWORD *)v42 + 164))(v42);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v119, 0.0, v43 + *(float *)(v45 + 4));
cocos2d::CCPoint::operator+(v126, v111, v119);
v44(v42, v126);
v47 = (cocos2d::CCEaseBounceOut *)cocos2d::CCMoveTo::create((cocos2d::CCMoveTo *)0x3F800000, COERCE_FLOAT(v111), v46);
v49 = (cocos2d::CCAction *)cocos2d::CCEaseBounceOut::create(v47, v48);
cocos2d::CCNode::runAction(*(this + 133), v49);
v51 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3EB851EC, v50);
v113 = RewardUnlockLayer::playDropSound;
v114 = 0;
v52 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, RewardUnlockLayer::playDropSound, 0);
v53 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v51, v52, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)this, v53);
v55 = (cocos2d::CCNode *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"chest_shadow_001.png",
v54);
v56 = 1.0;
v57 = a2 == (GJChestSprite *)((char *)&dword_0 + 1);
v58 = v55;
v59 = *(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_DWORD *)v55 + 92);
if ( v57 )
v56 = 0.8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v119, 0.0, v56 * -48.0);
cocos2d::CCPoint::operator+(v126, v111, v119);
v59(v58, v126);
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v58, 1);
(*(void (__fastcall **)(cocos2d::CCNode *, _DWORD))(*(_DWORD *)v58 + 456))(v58, 0);
(*(void (__fastcall **)(cocos2d::CCNode *, int))(*(_DWORD *)v58 + 80))(v58, 0x40000000);
v61 = (cocos2d::CCAction *)cocos2d::CCFadeTo::create((cocos2d::CCFadeTo *)0x3ECCCCCD, COERCE_FLOAT(90), v60);
cocos2d::CCNode::runAction(v58, v61);
v63 = (cocos2d::CCEaseBounceOut *)cocos2d::CCScaleTo::create((cocos2d::CCScaleTo *)0x3F800000, v56 * 0.95, v62);
v65 = (cocos2d::CCAction *)cocos2d::CCEaseBounceOut::create(v63, v64);
cocos2d::CCNode::runAction(v58, v65);
v67 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3F99999A, v66);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, -4.0, 0.0);
v69 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCMoveBy::create(
(cocos2d::CCMoveBy *)0x3D4CCCCD,
COERCE_FLOAT(v126),
v68);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, 4.0, 0.0);
v71 = cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x3D4CCCCD, COERCE_FLOAT(v126), v70);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, -4.0, 0.0);
v73 = cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x3D4CCCCD, COERCE_FLOAT(v126), v72);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, 4.0, 0.0);
v103 = cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x3D4CCCCD, COERCE_FLOAT(v126), v74);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, -4.0, 0.0);
v76 = cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x3D4CCCCD, COERCE_FLOAT(v126), v75);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, 4.0, 0.0);
v105 = (cocos2d::CCObject *)cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)0x3D4CCCCD, COERCE_FLOAT(v126), v77);
v107 = cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x3E4CCCCD, v78);
v115 = RewardUnlockLayer::step2;
v116 = 0;
v79 = cocos2d::CCCallFunc::create(this, RewardUnlockLayer::step2, 0);
v80 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v67, v69, v71, v73, v103, v76, v105, v107, v79, 0);
cocos2d::CCNode::runAction(*(this + 133), v80);
v82 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_deleteBtn_001.png", v81);
v118 = 0;
v117 = RewardUnlockLayer::onClose;
v83 = CCMenuItemSpriteExtra::create(v82, 0, (int)this, (int)RewardUnlockLayer::onClose, 0);
*(this + 138) = (cocos2d::CCArray *)v83;
CCMenuItemSpriteExtra::setSizeMult(v83, 1.6);
v85 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_rewardBtn_001.png", v84);
v119[0] = RewardUnlockLayer::onClose;
v119[1] = 0;
v86 = CCMenuItemSpriteExtra::create(v85, 0, (int)this, (int)RewardUnlockLayer::onClose, 0);
*(this + 139) = (cocos2d::CCArray *)v86;
CCMenuItemSpriteExtra::setSizeMult(v86, 1.6);
v87 = (cocos2d::CCArray *)cocos2d::CCMenu::create(*(this + 138), *(this + 139), 0);
*(this + 111) = v87;
(*(void (__fastcall **)(_DWORD, cocos2d::CCArray *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v87, 10);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 138) + 528))(*(this + 138), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 138) + 172))(*(this + 138), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 139) + 528))(*(this + 139), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 139) + 172))(*(this + 139), 0);
v88 = (int)*(this + 138);
v89 = *(this + 111);
v90 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v88 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v112,
(float)((float)(v109 * 0.5) - 170.0) + 10.0,
(float)((float)(v110 * 0.5) + 110.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v126, v89);
v90(v88, v126);
v91 = (int)*(this + 139);
v92 = *(this + 111);
v93 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v91 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v112, v109 * 0.5, (float)((float)(v110 * 0.5) - 110.0) + 0.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v126, v92);
v93(v91, v126);
v95 = (cocos2d::CCArray *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)"Something went wrong...",
"goldFont.fnt",
v94);
*(this + 137) = v95;
(*(void (__fastcall **)(_DWORD, cocos2d::CCArray *))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), v95);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 137) + 80))(*(this + 137), 1058642330);
v96 = (int)*(this + 137);
v97 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v96 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v126, v109 * 0.5, (float)(v110 * 0.5) - 90.0);
v97(v96, v126);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 137) + 172))(*(this + 137), 0);
v99 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)0x41200000, v98);
v126[0] = RewardUnlockLayer::connectionTimeout;
v126[1] = 0;
v100 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, RewardUnlockLayer::connectionTimeout, 0);
v101 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v99, v100, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)this, v101);
std::string::~string((int)v122);
std::string::~string((int)v120);
return v106;
}