Archive | December 2013

Backup Shazam Tags from Android without Root

Image

1. Connect your phone via USB and backup Shazam data files. The adb command is part of the Android SDK. You will need to change the package name “com.shazam.encore.android” to “com.shazam.android” if you have the free version.

adb backup -f com.shazam.encore.android.ab com.shazam.encore.android

2. Convert the backup file to a tar file.

dd if=com.shazam.encore.android.ab bs=1 skip=24 | openssl zlib -d > com.shazam.encore.android.tar

3. Extract the tar file.

tar -xvf com.shazam.encore.android.tar

4. Export the data from the database using sqlite.

$ sqlite3 ./apps/com.shazam.encore.android/db/library.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .output tags.sql
sqlite> .dump
sqlite> .exit

5. Or export csv data with this sql from spectas

$ sqlite3 ./apps/com.shazam.encore.android/db/library.db
sqlite> .mode csv
sqlite> .output tags.csv
sqlite> SELECT a.name , t.title, t.subtitle, t.album, t.subgenre_name, tg.short_datetime, tg.location_name, tg.lat, tg.lon 
FROM artist a, artist_track at, track t, tag tg
WHERE a.id = at.artist_id AND at.track_id = t._id AND tg.track_id = t._id ORDER BY tg.timestamp;
sqlite> .exit