• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

In-app URL redirection

Hello,
I want to create an android application that redirect a URL to an other (for example, if I go to google.com, the application redirect to yahoo.fr).
It must works with default android browser or Chrome, firefox or event the in-app browser of facebook.
I don't really know how it works and I don't have a lot of references in this particular domain of android programming.
Another constraint is that it could work without rooting the phone. Is this possible ? If yes, do you have some hints or references to give me ?
(I've already search a bit on Proxy server or VPN but noting concret yet).
Thanks.
 
You should have your own proxy that captures all request from the device to network.
Like Charles https://stackoverflow.com/questions...-http-requests-with-non-rooted-android-device
I think it's not a trivial task.

In the case of Chrome or Facebook https://security.stackexchange.com/...u-capture-all-the-traffic-from-an-android-app
You should have certificates for HTTPS that you don't have. Without certificates you will get encoded HTTPS requests, where the site name is visible only. All other information looks like garbage.
If you can capture and read SSL traffic from any application, like Facebook, without certificates, you have access to all Play Store application's secret keys and unlimited access to any private site or store.
So you are going to compromise all the Internet security. Good luck :)
 
Last edited:
Thanks for your answer !
About Charles, this applicaiton seems to do what I want to do but I don't want to capture on a PC, but in the application that I am currently working on...
 
If you are the author of application and want to capture URL that was entered inside the app, yes you can do it easily.
If you are working with Web View, the URL is under your control and again you can do it easily.
if you call Chrome from your application with the entered URL, yes, you can replace URL with new one and call Chrome with modified URL.
But when Chrome is started and you enter URL in Chrome address tab, it's impossible to capture that request, Chrome is independent application, no matter how you have launched it.
I'm not sure for last sentence, but I think yes it's impossible with simple tools.
May be the way is to replace something on system level of Android. So you are going to hack Android :)
 
Ok so I think that this is not possible...
I want to recover Url that I enter (in the navigation browser default app of my phone) in my app (the one i'm working on) so it's totally independent as you said...
 
You can probably do this by making a browser extension/add on that just injects javascript to the page that does the redirection. Or use something like tapermonkey which injects javascript. An app would not be the right approach in my opinion.
 
Back
Top Bottom