5

I'm interested in whether there is a way to monitor HTTP(S) traffic on an Android phone? What I would like to do is to be able to retrieve all URLs that have been accessed on the phone's browser. I thought that there would be a browser intent for that, but have not seen anything - given I'm green, maybe I just did not know where to look?

I followed the question and answer here, but it works only for hyperlinks which were clicked by the user, however I need to catch all URLs - including the ones typed in by the user. Basically I need to know about every single URL that was opened in the web browser.

Can I register some kind of a handler with the browser?

Is something like that feasible at all?

Community
  • 1
  • 1
Pawel Krakowiak
  • 9,940
  • 3
  • 37
  • 55

2 Answers2

1

I'm not very sure how (or if) you can use this (never used it myself), but it might be worth a look: Browser.getAllVisitedUrls(ContentResolver cr)

Felix
  • 88,392
  • 43
  • 149
  • 167
  • I thought about it, but it's unreliable, I think - I would have to poll it constantly and the user may be able to clear the browser history/cache just in time before my service polls it for data. There should be a better way. – Pawel Krakowiak Oct 13 '09 at 17:43
  • 1
    No, there shouldn't be any way to spy on the user. – Felix Oct 13 '09 at 18:41
  • There should, with the user's knowledge and upon their request. I have a use for this, I'm just wondering about what's possible from the technical standpoint. – Pawel Krakowiak Oct 14 '09 at 08:48
  • If you're worried about the user clearing the history before your application accesses it, just tell him not to. – Felix Oct 18 '09 at 20:41
  • @Felix, do you see what Pawel was talking about: `from the technical standpoint`. Yes, and do you understand? –  Mar 06 '12 at 01:35
1

Maybe we could learn solutions from PC platform:

  • Application Level: set a global HTTP proxy
  • Linux Level: tcpdump or WireShark?
  • Modify Android Source: add your monitor module into browser or network protocol stack

Actually, I also want to solve this problem efficiently.

@Pawel Krakowiak, have u got a valid method now? Please communicate with me.

HackNone
  • 504
  • 6
  • 12