int
__fastcall android_main(_DWORD *application)
{
application_1 = application;
destLen = 0x100000;
dest =
malloc
(0x100000u);
v2 = dword_43A18;
v3 =
malloc
(dword_43A18);
_aeabi_memcpy(v3, &loc_7004, v2);
filename = -1651995194;
LOBYTE(filename) = 47;
do
*(&filename + v4++) ^= 0xE9u;
while
( v4 != 53 );
v5 = 1;
LOBYTE(name) = 47;
do
*(&name + v5++) ^= 0xE9u;
while
( v5 != 47 );
j_app_dummy();
_aeabi_memclr8(&application_2, 52);
*application_1 = &application_2;
application_1[1] = sub_29B8;
application_1[2] = sub_2B90;
application_2 = application_1;
v27 = ASensorManager_getInstance();
v28 = ASensorManager_getDefaultSensor();
v6 = 0;
v29 = ASensorManager_createEventQueue(v27, application_1[7], 3, 0, 0);
v7 = application_1[5];
if
( v7 )
{
v8 = *(v7 + 4);
v9 = *(v7 + 8);
v31 = *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, &v25, &v24);
if
( v13 >= 0 )
break
;
if
( v30 )
{
v11 = v31 + 0.01;
if
( (v31 + 0.01) > 1.0 )
v11 = 0.0;
v31 = v11;
sub_2C14(&application_2);
}
}
if
( v24 )
(*(v24 + 8))(application_1);
if
( v13 == 3 && v28 )
{
while
( 1 )
{
do
{
if
( ASensorEventQueue_getEvents(v29, &v35, 1) < 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
( (v14 - 1) <= 0x58 )
{
v10 = v14;
v15 = v14 / 10;
if
( v14 % 10 == 9 )
{
v16 = dword_43A18;
v17 = dword_43A18 / 10;
v18 = (v15 + 1) * (dword_43A18 / 10);
if
( dword_43A18 / 10 * v15 < v18 )
{
v19 = &v3[v17 * v15];
do
{
--v17;
*v19++ ^= v14;
}
while
( v17 );
}
if
( v14 == 89 )
{
while
( v18 < 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, &loc_7004, dword_43A18);
v10 = 0;
}
else
{
v20 = v6;
if
( uncompress(dest, &destLen, v3, dword_43A18) )
_android_log_print(5,
"FindMyDex"
,
"Dangerous operation detected."
);
v21 = open(&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(&name, 0) && mkdir(&name, 0x1FFu) )
_android_log_print(5,
"FindMyDex"
,
"Something wrong with the permission.."
);
sub_2368(application_1);
remove
(&filename);
_android_log_print(4,
"FindMyDex"
,
"Congratulations!! You made it!"
);
sub_2250(application_1);
v10 = 2147483648;
v6 = v20;
}
}
}
}
LABEL_51:
;
}
while
( !application_1[15] );
sub_2BDA(&application_2);
return
_stack_chk_guard - v65;
}