Skip to content

Instantly share code, notes, and snippets.

@plorechax
Created November 4, 2016 13:52
Show Gist options
  • Save plorechax/fcc601ea7ba84095645028d2be8fea99 to your computer and use it in GitHub Desktop.
Save plorechax/fcc601ea7ba84095645028d2be8fea99 to your computer and use it in GitHub Desktop.
Shazam Lite app patch

Shazam Lite app patch

This is a patch for Shazam Lite app.

Features

  • Disables region restriction.
    The app sends "in" (India) country code to the Shazam servers. The code for this feature was taken from a modification by blunden. All credits should go to him.
  • Disables beacon requests.
    By default the app tries to send a lot of requests to https://beacon.shazam.com with some client info.
    These requests were logged and easy to find, but there might be other tracking.
  • Allows to move the app to SD card.

The patch was tested on this APK.

How to use

  • Unpack the original APK (with apktool).
  • Apply patch:
    patch -d path/to/unpacked/files/ < /path/to/patch.patch
  • Build a new APK (with apktool again).
    You might also need to align and sign the APK.

The patch

diff -ur orig/AndroidManifest.xml patched/AndroidManifest.xml
--- orig/AndroidManifest.xml
+++ patched/AndroidManifest.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="no"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.shazam.android.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2704002">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.shazam.android.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2704002" android:installLocation="auto">
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
     <uses-permission android:name="android.permission.VIBRATE"/>
diff -ur orig/smali/com/shazam/android/b/a.smali patched/smali/com/shazam/android/b/a.smali
--- orig/smali/com/shazam/android/b/a.smali
+++ patched/smali/com/shazam/android/b/a.smali
@@ -116,19 +116,10 @@
 .end method
 
 .method a(Lcom/shazam/android/b/e/a;)V
-    .locals 2
+    .locals 0
 
     .prologue
-    .line 76
-    iget-object v0, p0, Lcom/shazam/android/b/a;->a:Ljava/util/concurrent/Executor;
 
-    new-instance v1, Lcom/shazam/android/b/b;
-
-    invoke-direct {v1, p0, p1}, Lcom/shazam/android/b/b;-><init>(Lcom/shazam/android/b/a;Lcom/shazam/android/b/e/a;)V
-
-    invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
-
-    .line 90
     return-void
 .end method
 
diff -ur orig/smali/com/shazam/android/lite/b/e.smali patched/smali/com/shazam/android/lite/b/e.smali
--- orig/smali/com/shazam/android/lite/b/e.smali
+++ patched/smali/com/shazam/android/lite/b/e.smali
@@ -142,11 +142,7 @@
     .line 26
     const-string v1, "country"
 
-    iget-object v2, p0, Lcom/shazam/android/lite/b/e;->a:Lcom/shazam/android/lite/e/a/p;
-
-    invoke-interface {v2}, Lcom/shazam/android/lite/e/a/p;->b()Ljava/lang/String;
-
-    move-result-object v2
+    const-string v2, "in"
 
     invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
 
@@ -244,22 +240,14 @@
     .line 40
     const-string v1, "mobileCountryCode"
 
-    iget-object v3, p0, Lcom/shazam/android/lite/b/e;->a:Lcom/shazam/android/lite/e/a/p;
-
-    invoke-interface {v3}, Lcom/shazam/android/lite/e/a/p;->h()Ljava/lang/String;
-
-    move-result-object v3
+    const-string v3, "404"
 
     invoke-virtual {v2, v1, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
 
     .line 41
     const-string v1, "mobileNetworkCode"
 
-    iget-object v3, p0, Lcom/shazam/android/lite/b/e;->a:Lcom/shazam/android/lite/e/a/p;
-
-    invoke-interface {v3}, Lcom/shazam/android/lite/e/a/p;->i()Ljava/lang/String;
-
-    move-result-object v3
+    const-string v3, "01"
 
     invoke-virtual {v2, v1, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment