Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,018 Members 45,483 Now Online
XDA Developers Android and Mobile Development Forum

[Q] hacking my way into sniffing intents between apps

Tip us?
 
ztrange
Old
(Last edited by ztrange; 28th January 2014 at 03:35 AM.)
#1  
Junior Member - OP
Thanks Meter 2
Posts: 17
Join Date: Jan 2011
Default [Q] hacking my way into sniffing intents between apps

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.
 
ztrange
Old
#2  
Junior Member - OP
Thanks Meter 2
Posts: 17
Join Date: Jan 2011
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: [ Click to Expand ]
 
gloscherrybomb
Old
#3  
Senior Member
Thanks Meter 159
Posts: 253
Join Date: Nov 2010
Quote:
Originally Posted by ztrange View Post
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?
 
E:V:A
Old
#4  
E:V:A's Avatar
Recognized Developer
Thanks Meter 1,787
Posts: 1,341
Join Date: Dec 2011
Location: -∇ϕ
Nice work, but it would have been great with some more details...
MSM8960 Info, Architecture and Bootloader(s)
El Grande Partition Table Reference
How to talk to the Modem with AT commands

[REF][ServiceMode] How to make your Samsung perform dog tricks
[REF|R&D|RF] RF/Radio properties of Samsung ServiceMode

Want to know when your phone is getting tracked or tapped?

Help us develop the IMSI Catcher / Spy Detector!
(To be part of the EFF & The Guardian Project toolsets.)
_______________________________
If you like what I do, just click THANKS!
Everything I do is free, altruism is the way!
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
I do not answer support related PM's.

 
ammar786
Old
#5  
ammar786's Avatar
Recognized Themer
Thanks Meter 1,135
Posts: 1,035
Join Date: Dec 2011
Location: Mumbai

 
DONATE TO ME
Hi, please we need a follow up.
Nexus 5 | Mahdi ROM and Android L

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes