Is there a way to emulate the behaviour of a hosts file on non-rooted Android?
I need to test a website on Android. I get to the website via IP address but it seems to redirect to a URL that is not available from the phone. So is there a way to emulate hosts file behaviour to map this URL to the correct IP address.
From search I have found that the real hosts file is editable with a rooted device but that isn't currently an option for me.
1) You can use desktop as a source or internet for your device. And here you can use dnsmasq with some next rules (for ex. https://askubuntu.com/questions/53523/how-to-redirect-a-url-to-a-custom-ip-address) you need only share internet to device via usb.
2) you can setup on your device as dnsserver ip of your computer in that network. then same actions with dnsmasq
You can specify HTTP proxy on device's WiFi preference. On that proxy, you can hack HTTP, say modifying HTTP redirection response to redirect to your customised HTTP server. http://wiki.squid-cache.org/SquidFaq/ContentAdaptation looks informative.
Or keep redirection response and redirect the specified URL to your customised server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With