int
__fastcall android_main(
int
a1)
{
int
v1;
void
*v2;
Bytef *v3;
signed
int
v4;
signed
int
v5;
time_t
v6;
int
v7;
int
v8;
int
v9;
int
v10;
float
v11;
int
v12;
int
v13;
int
v14;
int
v15;
void
*v16;
int
v17;
int
v18;
Bytef *v19;
time_t
v20;
int
v21;
Bytef *dest;
void
*outData;
int
outEvents;
int
v26;
ASensorManager *manager;
const
ASensor *v28;
ASensorEventQueue *queue;
int
v30;
float
v31;
int
v32;
int
v33;
uLongf destLen;
char
v35;
int
v36;
float
v37;
int
name;
int
v39;
int
v40;
int
v41;
int
v42;
int
v43;
int
v44;
int
v45;
int
v46;
int
v47;
int
v48;
__int16
v49;
char
v50;
int
filename;
int
v52;
int
v53;
int
v54;
int
v55;
int
v56;
int
v57;
int
v58;
int
v59;
int
v60;
int
v61;
int
v62;
int
v63;
char
v64;
int
v65;
v1 = a1;
destLen = 0x100000;
dest = (Bytef *)
malloc
(0x100000u);
v2 = off_43A18;
v3 = (Bytef *)
malloc
((
size_t
)off_43A18);
_aeabi_memcpy(v3, &unk_7004, v2);
filename = -1651995194;
v52 = -2003974520;
v53 = -1966700387;
v54 = -2000190330;
v55 = -2071422265;
v56 = -947092071;
v57 = -1920499569;
v58 = -1936879484;
v59 = -2138061167;
v60 = -962950011;
v61 = -1702328950;
v62 = -946172774;
v63 = -376337267;
v64 = 0;
name = -1651995194;
v39 = -2003974520;
v40 = -1966700387;
v41 = -2000190330;
v42 = -2071422265;
v43 = -947092071;
v44 = -1920499569;
v45 = -1936879484;
v46 = -2138061167;
v47 = -962950011;
v48 = -1853059706;
v50 = 0;
v4 = 1;
v49 = -5690;
LOBYTE(filename) = 47;
do
*((_BYTE *)&filename + v4++) ^= 0xE9u;
while
( v4 != 53 );
v5 = 1;
LOBYTE(name) = 47;
do
*((_BYTE *)&name + v5++) ^= 0xE9u;
while
( v5 != 47 );
j_app_dummy();
_aeabi_memclr8(&v26, 52);
*(_DWORD *)v1 = &v26;
*(_DWORD *)(v1 + 4) = sub_29B8;
*(_DWORD *)(v1 + 8) = &sub_2B90;
v26 = v1;
manager = ASensorManager_getInstance();
v28 = ASensorManager_getDefaultSensor(manager, 1);
v6 = 0;
queue = ASensorManager_createEventQueue(manager, *(ALooper **)(v1 + 28), 3, 0, 0);
v7 = *(_DWORD *)(v1 + 20);
if
( v7 )
{
v8 = *(_DWORD *)(v7 + 4);
v9 = *(_DWORD *)(v7 + 8);
v31 = *(
float
*)v7;
v32 = v8;
v33 = v9;
}
_android_log_print(4,
"FindMyDex"
,
"Can you shake your phone 100 times in 10 seconds?"
);
v10 = 0;
do
{
while
( 1 )
{
v12 = 0;
if
( !v30 )
v12 = -1;
v13 = ALooper_pollAll(v12, 0, &outEvents, &outData);
if
( v13 >= 0 )
break
;
if
( v30 )
{
v11 = v31 + 0.01;
if
( (
float
)(v31 + 0.01) > 1.0 )
v11 = 0.0;
v31 = v11;
sub_2C14(&v26);
}
}
if
( outData )
(*((
void
(__fastcall **)(
int
))outData + 2))(v1);
if
( v13 == 3 && v28 )
{
while
( 1 )
{
do
{
if
( ASensorEventQueue_getEvents(queue, (ASensorEvent *)&v35, 1u) < 1 )
goto
LABEL_51;
}
while
( v36 != 1 );
if
( v10 & 1 )
{
if
( v37 >= -15.0 )
{
LABEL_30:
v14 = v10;
goto
LABEL_31;
}
if
( v10 == 1 )
v6 =
time
(0);
v14 = v10 + 1;
}
else
{
if
( v37 <= 15.0 )
goto
LABEL_30;
v14 = v10 + 1;
if
( v10 >= 0 )
_android_log_print(4,
"FindMyDex"
,
"Oh yeah~ You Got it~ %d times to go~"
, 99 - v10);
}
LABEL_31:
v10 = v14;
if
( (unsigned
int
)(v14 - 1) <= 88 )
{
v10 = v14;
v15 = v14 / 10;
if
( v14 % 10 == 9 )
{
v16 = off_43A18;
v17 = (
signed
int
)off_43A18 / 10;
v18 = (v15 + 1) * ((
signed
int
)off_43A18 / 10);
if
( (
signed
int
)off_43A18 / 10 * v15 < v18 )
{
v19 = &v3[v17 * v15];
do
{
--v17;
*v19++ ^= v14;
}
while
( v17 );
}
if
( v14 == 89 )
{
while
( v18 < (
signed
int
)v16 )
v3[v18++] ^= 0x59u;
}
v10 = v14 + 1;
}
}
if
( v14 == 100 )
{
if
(
time
(0) - v6 > 9 )
{
_android_log_print(4,
"FindMyDex"
,
"OH~ You are too slow. Please try again"
);
_aeabi_memcpy(v3, &unk_7004, off_43A18);
v10 = 0;
}
else
{
v20 = v6;
if
( uncompress(dest, &destLen, v3, (uLong)off_43A18) )
_android_log_print(5,
"FindMyDex"
,
"Dangerous operation detected."
);
v21 = open((
const
char
*)&filename, 577, 511);
if
( !v21 )
_android_log_print(5,
"FindMyDex"
,
"Something wrong with the permission."
);
write(v21, dest, destLen);
close(v21);
free
(dest);
free
(v3);
if
( access((
const
char
*)&name, 0) && mkdir((
const
char
*)&name, 0x1FFu) )
_android_log_print(5,
"FindMyDex"
,
"Something wrong with the permission.."
);
sub_2368(v1);
remove
((
const
char
*)&filename);
_android_log_print(4,
"FindMyDex"
,
"Congratulations!! You made it!"
);
sub_2250(v1);
v10 = 2147483648;
v6 = v20;
}
}
}
}
LABEL_51:
;
}
while
( !*(_DWORD *)(v1 + 60) );
sub_2BDA(&v26);
return
_stack_chk_guard - v65;
}