Android获取浏览器的地址 [英] Android get browser's address

查看:197
本文介绍了Android获取浏览器的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使用某些侦听器或其他方法从用户试图打开的浏览器中获取地址,并且如果该地址在数据库中并且该地址被禁止,则停止在用户的浏览器中加载该地址?


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 loading that address in the user's browser?

推荐答案

Android是Linux操作系统的一种,您要做的实际上是创建一个防火墙。为了允许在Linux中创建防火墙,提供了 Netfilter

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是Linux内核内部的一组钩子,允许内核模块向网络堆栈注册回调函数

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

但是提供一个更简单的界面来创建防火墙Linux风味通常实现 iptables (实际上是Netfilter上的另一层)。

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


iptables是Linux内核防火墙提供的表(实现为不同Netfilter模块)及其存储的链和规则。当前,不同的内核模块和程序用于不同的协议。 iptables适用于IPv4,ip6tables适用于IPv6,arptables适用于ARP,ebebs适用于以太网帧。

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.

在linux中,您基本上是创建iptable链来

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

BUT

我不知道iptables是在Android中实现。您将必须深入研究Android内核的源代码。其次,您需要对电话具有root访问权限。

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.

个人而言,如果未在Android内核中实现iptables / netfilter,我会考虑这样做。是的,这需要做很多工作,但是为什么要重新发明轮子呢?

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?

这篇关于Android获取浏览器的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆