Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] hacking my way into sniffing intents between apps

OP ztrange

28th January 2014, 04:25 AM   |  #1  
OP Junior Member
Thanks Meter: 2
 
17 posts
Join Date:Joined: Jan 2011
More
Hi.

I'm experimenting to write a personal app to help me get to know more songs. I want to catch the spotify intent that indicates when the track changes and use the data on my app.

I have been investigating how to do it and tried multiple lines of code like this (iF.addAction("com.android.music.metachanged"); ), but no luck yet. Everybody (stackoverflow) says there is no way to get that info. But the fact is that there is one app that is able to catch that info: musiXmatch. It is able to detect when the track on the spotify free radio changes and deliver the corresponding lyric.

So, I tried decompiling both the musicXmatch and spotify apks using apktool but wasn't able to find the way the apps comunicate with one another. I have yet to get deeper on smali but by what I see this far, the answer isn't there.

So, the next thing I was thinking I'd try was to make an AOSP rom with some extra logging habilities so that i can listen to the communication between the apps (namely, the broadcastreceiver).

My question: żIs there such an aosp distro? One that has extra sniffing/logging capabilities. Also, Anyone has an extra idea on how to accomplish my goal, or maybe some reason for which it will be impossible for me to do it (like for example the intent from spotify being explicit).

Thank you very much in advance for your time.
Last edited by ztrange; 28th January 2014 at 04:35 AM.
29th January 2014, 11:33 PM   |  #2  
OP Junior Member
Thanks Meter: 2
 
17 posts
Join Date:Joined: Jan 2011
More
I solved it. I got the intent.

In case anyone wonders how I did it, here it is:
  • Rooted my phone (I have a Nexus 4 which lost root with one OTA update and never bothered to recover it)
  • Installed CydiaSubstrate. A wonderful piece of software by @saurik that allows you to literally modify any java or native C/C++ class during runtime seamlessly. It also does lots of other stuff I don't really understand.
  • Had to put SELinux to permissive on KitKat because it is on enforced by default since 4.3, in order for the Substrate to work
  • Got IntroSpy from git and wrote a Custom Hook for IntentReceiver startActivity() method
  • Enabled IntroSpy for musicXmatch app and it dumped all the app's intents to logcat
The Following 2 Users Say Thank You to ztrange For This Useful Post: [ View ]
1st April 2014, 10:40 AM   |  #3  
Senior Member
Thanks Meter: 159
 
253 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by ztrange

I solved it. I got the intent.

In case anyone wonders how I did it, here it is:

  • Rooted my phone (I have a Nexus 4 which lost root with one OTA update and never bothered to recover it)
  • Installed CydiaSubstrate. A wonderful piece of software by @saurik that allows you to literally modify any java or native C/C++ class during runtime seamlessly. It also does lots of other stuff I don't really understand.
  • Had to put SELinux to permissive on KitKat because it is on enforced by default since 4.3, in order for the Substrate to work
  • Got IntroSpy from git and wrote a Custom Hook for IntentReceiver startActivity() method
  • Enabled IntroSpy for musicXmatch app and it dumped all the app's intents to logcat

Thanks, are you going to share said intents?
13th May 2014, 08:11 PM   |  #4  
E:V:A's Avatar
Recognized Developer
Flag -∇ϕ
Thanks Meter: 1,899
 
1,380 posts
Join Date:Joined: Dec 2011
Nice work, but it would have been great with some more details...
4th August 2014, 10:11 AM   |  #5  
ammar786's Avatar
Recognized Themer
Flag Mumbai
Thanks Meter: 1,137
 
1,035 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Hi, please we need a follow up.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes