Search Whitehat Blog

Tuesday, 1 April 2014

Reverse Engineering Apk Using APKTOOL

Reverse Engineering Android Apps

This tutorial is for Windows by the way!

Step 1:

 Download apktool and apktool-install-windows from here and unpack both packages into a directory called “apktool” You should have 3 files.

https://code.google.com/p/android-apktool/downloads/list

Step 2:

Copy your APK file into this new directory

Step 3:

To extract the APK open a new command prompt in apktool directory (Shift+RightClick and “Open command windows here”)
Then type: apktool d file.apk
For example: apktool d MinecraftPocketEdition0.9.2.apk
Now open up the new folder!
Make any changes you want.
For example I edited /res/values/strings.xml and changed some things.

Step 4: 
How to re-build extracted files:

apktool b yourfile
For example: apktool b MinecraftPocketEdition0.9.2
Now navigate to the “dist” folder in the yourfile directory and copy the apk file to your desktop

Step 5: 
Now you need to sign your APK file.

When publishing an application you need to sign the .apk file with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign it with jarsigner but because most of us don’t have a keystore we can use a alternative called SignAPK
First download the SignAPK tool from
 http://www.mediafire.com/?rw57ftajd6nm81s

Extract it to your desktop

Then type: java -jar signapk.jar certificate.pem key.pk8 your-app.apk readytoinstall.apk
For example: java -jar signapk.jar certificate.pem key.pk8 MinecraftPocketEdition0.9.2.apk MinecraftSigned.apk

No comments:

Post a Comment