0% found this document useful (0 votes)
26 views4 pages

How to Crack an Android App

This guide provides a step-by-step process for reverse engineering Android applications (APKs) to modify their functionality, particularly for cheating in games. It outlines the necessary tools, such as xdaAutoTool and Android SDK, and details the steps for decompiling the APK, editing Smali code, recompiling the APK, and testing the modifications. The document emphasizes caution in making changes and suggests testing after each modification to facilitate troubleshooting.

Uploaded by

jamesbond007.cbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

How to Crack an Android App

This guide provides a step-by-step process for reverse engineering Android applications (APKs) to modify their functionality, particularly for cheating in games. It outlines the necessary tools, such as xdaAutoTool and Android SDK, and details the steps for decompiling the APK, editing Smali code, recompiling the APK, and testing the modifications. The document emphasizes caution in making changes and suggests testing after each modification to facilitate troubleshooting.

Uploaded by

jamesbond007.cbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

How to Crack an Android App (APK File)

← Home

hotsjf
18 Jan 2014

OK, the purpose of this guide is to show you how to reverse engineer Android applications such as games. I’m
not going to go into much detail on anything else, as I want to keep this guide simple. But this method can be
used to alter just about anything you like in an APK application.
If you, like me, have ever played those annoying, addictive Android games that never end, and may even
require you to pay money to advance, this is a work around — especially if you like to cheat.

Tools Needed
Please download and install the following programs if you don’t already have them. Your success will depend
on this.
xdaAutoTool
Android SDK
The Android SDK also contains an emulator. This is useful if you would like to test your work on the emulator
before installing the APK on your Android device.

Let’s Begin
OK, you have the SDK installed, and have downloaded xdaAutoTool. You now need a copy of the APK file you
would like to modify. I’m going to assume that you can locate the APK file. If you have difficulty, Google is
your friend.

Step One – Decompiling The APK File


Open the xdaAutoTool folder and run the program. It will prompt you to install a file called “framework-
res.apk.” Ignore this. Close the program.
In the xdaAutoTool folder you we see a bunch of folders appear after the program ran. Look for one called
“_INPUT_APK.” Put your APK file in the folder and run the program again. Press “Decompile All” located on
the left side of the program window.
xdaAutoTool will decompile the APK file and create a new directory in the _INPUT_APK folder.

Step Two – Finding Your Target


Are you ready to be introduced to Smali code? Don’t worry! It isn’t too difficult once you realize what’s going
on in the code. Java can’t be decompiled back into the original source code, it can, however, be decompiled
into something called Smali code.
Navigate back to the _INPUT_APK directory and open the new folder (it will have the same name as the APK
file). Once there, you will see a directory named “smali.” This is your target. Depending on your intentions,
you will need to sift through the various files and folders in the smali directory until you locate the code you
would like to modify.
For example, if you are trying to increase the firepower of a turret in an Android game, you will need to find
the file for that turret. These directories are structured. You will probably see quite a few directories
containing files used for advertisements, etc. One you discover the actual game directory, everything you
need to alter will be in there.
Step Three – Making Your Changes
Once you think you have nailed down the smali file you need to edit, you need to determine how to edit it.
This is the tricky part. In part 1 of this guide, I mentioned altering the firepower of a turret in an Android
game. I’m going to stick with that example.
To figure out where to make your small firepower change, you need to look for keywords in the smali file.
Here is an example in a file called turret.smali:

.line 26
sget v2, LCB/somegame/Defense;->POWER_TURRET:I
aget v0, v1, v2
.line 27
.local v0, level:I
if-lez v0, :cond_0
.line 28
sget-object v1, LCB/somegame/Defense;->shopItemData:[[I
sget v2, LCB/somegame/Defense;->POWER_TURRET:I
aget-object v1, v1, v2
add-int/lit8 v2, v0, -0x1
aget v1, v1, v2
iput v1, p0, LCB/somegame/Defense/tower/Turret;->powerAdd:I
.line 30
:cond_0
sget-object v1, LCB/somegame/Defense;->instance:LCB/somegame/Defense;
iget-object v1, v1, LCB/somegame/Defense;->shopItemsLevel:[I

All the references to POWER_TURRET are a dead giveaway that you are in the right place to make your tweak.
NOTE: Please visit this site for an explanation of smali code.
Just by reading the code, you can see that this script is determining what the firepower will be for the turret.
It is using sget to pull information that will determine the firepower.
The iput call is the key here. That is where the script sets the firepower level. We want to give it a little boost.

add-int/lit8 v2, v0, -0x1


aget v1, v1, v2
iput v1, p0, LCB/somegame/Defense/tower/Turret;->powerAdd:I

The aget call grabs an integer array element and stores it in v1.
v1 is our target.
Let’s add the following between the aget and the iput calls.:

add-int/lit8 v2, v0, -0x1


aget v1, v1, v2
mul-int v1, v1, v1
iput v1, p0, LCB/somegame/Defense/tower/Turret;->powerAdd:I

mul-int v1, v1, v1 tells the program to multiply the integer in v1 by itself and put the result in v1.
Save the file. Congratulations. You have just made your first tweak. Do not get too carried away with making
changes. I would recommend only making one or two at a time before testing the program. This will make
troubleshooting much easier.

Step Four – Compiling


Not that you have made your tweak, it is time to test it out. Open xdaAutoTool back up and click on Recompile-
Build All.
If you did everything right, the APK should recompile without any errors. If you get errors, reassess your
changes.
Navigate to the xdaAutoTool directory and look for a folder named _OUTPUT_APK_DIST_ZIPALIGN. This
folder will contain your modified APK.
Now there are two ways to test your cracked APK. You can use the Android Virtual Device, or you can just use
your Android device.
If you decide to use the AVD, navigate to your Android SDK directory and start up the AVD Manager. This will
allow you to create a virtual device and fire it up.
If you are not using the AVD, connect your device to your computer with the USB plug. If the application you
just modified is already installed on your device, you will need to uninstall it before proceeding.
At this point you should either have your Android plugged in to your PC or the AVD running.

Step Five – Installing Your Cracked App


Open a cmd window and navigate to the directory containing your modified APK. Type “adb install
nameofapk.apk”
This will install the Android application on your device.

Step Six – Test It Out


Test out your edits. Enjoy!

via: neatphp

downvote
05 Mar 2015

Is there an updated/easier way to do this?

That neatphp website doesn't exist any more..

hotsjf
06 Mar 2015

downvote, on 05 Mar 2015 - 6:26 PM, said:

Is there an updated/easier way to do this?

That neatphp website doesn't exist any more..

haven't looked at the tool for long time.

anyone else has any new tutorials to share?

Ak0-Sardashti
28 Sep 2015

please update ...

the topice

Share Share
Full Version

You might also like