Android 12.0 system Internet access restriction series iptables uses IOemNetd to implement the function of prohibiting the app from accessing the Internet for a certain period of time

1 Introduction

In the customized development of the 12.0 system rom, in the development of requirements for the system to restrict the use of the network, in the product requirements of the netd network in the system, it will be required to set the function of the app to prohibit the Internet for a certain period of time, in
liunx The iptables command is also very important. Next, let’s implement the related function of prohibiting an app from accessing the Internet during a certain period of time in IOemNetd. That is, the system can only
allow an app to disable the Internet for a certain period of time, that is, during other time periods. This app can access the Internet, and finally implements interface calls in the framework custom service

2. System Internet Restriction Series: iptables uses IOemNetd to implement the core class of the app’s function of prohibiting Internet access for a certain period of time.

        system\netd\server\binder\com\android\internal\net\IOemNetd.aidl
        system\netd\server\OemNetdListener.cpp
        system\netd\server\OemNetdListener.h

3. Analysis and implementation of the core functions of iptables in the system restriction series of Internet access, which uses IOemNetd to implement the function of prohibiting Internet access for a certain period of time in the app.

System Restriction Internet Access Series: iptables uses IOemNetd to implement the function of prohibiting the app from accessing the Internet for a certain period of time.
In the native Android system, iptables is very important in the network filtering packet module. Iptabels is a packet filtering firewall system integrated with the Linux kernel. Both linux and android will include the functionality of Iptables.
Iptables facilitates better control over IP packet filtering and firewall configuration on Linux systems if they are connected to the Internet or LAN, a server, or a proxy server connecting a LAN and the Internet.
Another important advantage of netfilter/iptables is that it gives the user complete control over firewall configuration and packet filtering. You can customize your own rules to meet your specific needs

<

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/133280536