Sunday, August 8, 2010

Shazam Ad Removal - Android App Cracking Tutorial #3

Shazam Ad Removal

apktool - contains baksmali/smali, generally awesome. (
Android SDK installed. (
ADB Access.
An Android Device

Shazam allows you to identify songs based on input from your phone's microphone. It probably does
other bullshit but not only is it a free "trial", it also has google ads.

Protection Used: Feature limited free version
Ads Used: google ads

I downloaded the apk from my phone after getting it from the market.
    ben@ben-laptop:~$ adb shell ls /data/app/ |grep shazam
    ben@ben-laptop:~$ adb pull /data/app/
    1556 KB/s (706767 bytes in 0.443s)

Then I use apktool to decompress and disassemble the package:
  apktool d shazam_reversing

Then I go into the newly created directory:
  cd shazam_reversing

To remove the ads, I go to res/layout, in there, there's a file called view_advert.xml, rather clever of them to hide it there

I see their file defines a LinearLayout, this is likely expanded on inside the program itself, but let's just make everything
0px instead, shall we?
  <?xml version="1.0" encoding="UTF-8"?>
  <LinearLayout android:gravity="center_horizontal" android:background="@color/transparent" android:layout_width="0px" android:layout_height="0px" android:layout_alignParentBottom="true"
    xmlns:android="" />>

OK I think I'm done, let's package everything back up, I go to the directory I originally ran apktool in, and do the following:
  apktool b shazam_reversing newshazam.apk

we need to sign this to put on most android devices, if you have the SDK installed, you should have a debug key
  jarsigner -keystore ~/.android/debug.keystore newshazam.apk androiddebugkey

and enter "android" as the password.

NOTE: You won't be able to "upgrade" the app on the device, you MUST uninstall it either on the device, or by typing the following:
  adb uninstall

You now have an installable cracked apk, which you can install by typing:
  adb install newshazam.apk


  1. Keep moving forward... Don't stop!

  2. Small remark here : you need to uninstall the shazam application on the device before reinstalling:

    [user@localhost]$ adb install newshazam.apk
    pkg: /data/local/tmp/newshazam.apk
    234 KB/s (0 bytes in 599747.002s)