Skip to content Skip to sidebar Skip to footer

Android Get Browser's Address

Is there a way to get address from the browser that user is trying to open using some listener or something, and if the address is in the database and the address is banned, stop l

Solution 1:

Android is a flavour of the Linux operating system and what you want to do is essentially create a firewall. To allow the creation of a firewall in Linux, Netfilter is provided:

Netfilter is a set of hooks inside the Linux kernel that allows kernel modules to register callback functions with the network stack

However to provide a simpler interface to create a firewall Linux flavours typically implement iptables (essentially another layer on top of Netfilter).

iptables are the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.

In linux you essentially create iptable chains to allow the access to websites as well as block incoming connections.

BUT

I am not aware that iptables is implemented in Android. You would have to go digging into the source code for the Android kernel. Secondly you need to have root access to the phone.

Personally if iptables/netfilter is not implemented in the Android kernel I would look at doing so. Yes it's a lot of work but why re-invent the wheel?

Solution 2:

If you build a browser like application, then you have control over it. You can either block, or report that the page is opened, etc. Else, its not possible!

Post a Comment for "Android Get Browser's Address"