backHack

I started a little series of posts on hacking your apps.  I now have a little tool to help with Android analysis.  On my GitHub, I have backHack.  You can find it here:


As a general overview, this script will present you with a menu to select an app, back it up, extract it, repack it, and restore it.  As a little demo, this post will show the menus and how they work.

Currently, you must be using Cygwin for Windows, or Linux (Mobisec is an awesome distribution to use for mobile hacking/analysis)

For this post, I will be using Cygwin.  So go grab something to drink and lets get moving.

  1. Open Cygwin
    1. Navigate to where backHack has been cloned or downloaded to.  I have it at C:\backHack, so I will need to navigate to /cygdrive/c/backHack (Remember Linux/Cigwin is case sensitive.)
  2. Run backHack.py
    1. backHack is a python script.  Python is normally installed with Cygwin, but if it is not, you will need to install for this to work.  Mobisec has it pre-installed.
  3. Here you will be shown a small menu.  You must first select the App package you want to deal with.  For that, go to option 1.
  4. Make sure your phone/device is plugged in your computer and can be seen by adb.  To figure out how to do that, please see my earlier post Yes, hacking your app is THAT easy! - Part 1 (Android File System Analysis)
  5. Select option 1 to list the apps installed on your device.

  6. Select option 2 to type in the app name (If you use option 1, copy and paste the app name into option 2)
    1. I chose com.king.candycrushsaga (Candy Crush Saga)
  7. Now we backup our app by using option 2
    1. Notice that the chosen app name is listed at the top of the menu now

  8. Your phone will then prompt you to backup the app.  Press Backup Now to begin the backup.  Depending on the size of the app data, this is normally pretty quick, but may take time.
  9. Use option 3 to be able to view the file structure of the app
    1. the app file structure will be located under <backHack Dir>/apps/<app name>
    2. Modifying these files may give you extra lives or make the app work not as intended.  Use at your own risk!
  10. After you are done with your analysis, use option 4 to repack the app with your changes
  11. Then, all that is left to do is to restore your modified backup file by using option 5

  12. Just like the backup, you will be prompted on your device to restore the app
  13. Now the fun part.  Profit!
  14. The last option, 99, will exit the script and cleanup the files.  If you want to keep the files for analysis purposes, make a copy before exiting the script.

As stated in my Yes, hacking your apps is THAT easy! series, I will not show you what to change, rather I am just showing the tool I created to make the process easier.  Doing the analysis is up to you.

I hope you enjoy the tool.  Any comments on the tool, please let me know.  I am working on getting this working from a Windows Command Prompt and will update the page when that happens.

Popular Posts