com.pax.dal
Interface INetwork
-
public interface INetwork
网络控制模块。Network control module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interfaceINetwork.ISSLCallbackSSL回调。SSL Callback.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddAppNetworkFilter(AppNetworkFilter filter)添加应用网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Add application network access filtering rules.voidaddSysNetworkBlacklist(java.lang.String address)添加系统禁止访问的网络地址黑名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Add the blacklist of network addresses that are forbidden by the system.voidaddSysNetworkWhitelist(java.util.List<NetItem> netItems)在白名单模式下,添加指定的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, add the specified network rule.voidaddSysNetworkWhitelist(java.lang.String address)在白名单模式下,添加一个系统允许访问的网络地址白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In whitelist mode, add a white list of network addresses that the system allows to access.javax.net.ssl.HttpsURLConnectioncreateHttpsURLConnection(java.net.URL url, int type, java.util.LinkedHashMap<java.lang.String,java.security.cert.Certificate> caCertMap, java.security.cert.Certificate clientCert, INetwork.ISSLCallback callback)创建HttpsURLConnection。Create an HttpsURLConnection.java.net.SocketcreateSocket(java.lang.String ip, int port, int timeout)创建Socket。Create an Socket.java.net.SocketcreateSocket(java.lang.String ip, int port, int timeout, int type, java.util.LinkedHashMap<java.lang.String,java.security.cert.Certificate> caCertMap, java.security.cert.Certificate clientCert, INetwork.ISSLCallback callback)创建Socket。Create an Socket.voiddeleteAllFilter()删除所有网络访问过滤规则。包括关闭白名单模式,清除所有的黑白名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules.voiddeleteAllSysNetworkWhitelist()在白名单模式下,删除所有的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, delete all network rules.voiddeleteAppNetworkFilter(AppNetworkFilter filter)删除应用某个网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete a network access filter rule of the application.voiddeleteAppNetworkFilter(java.lang.String packageName)删除指定包名的应用的所有网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules for the application with the specified package name.voiddeleteAppNetworkFilter(java.lang.String packageName, long uid)删除指定包名和用户ID的应用的所有网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules for the application with the specified package name and user ID.voiddeleteSysNetworkBlacklist(java.lang.String address)删除系统禁止访问的网络地址黑名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete the blacklist of network addresses that are forbidden by the system.voiddeleteSysNetworkWhitelist(java.util.List<NetItem> netItems)在白名单模式下,删除指定的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, Delete the specified network rule.voiddeleteSysNetworkWhitelist(java.lang.String address)在白名单模式下,删除一个网络地址白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In whitelist mode, delete a network address whitelist.voiddisableIpv6(int networkType, boolean isDisableIpv6)屏蔽IPV6功能disable IPv6voidenableSysNetworkWhitelist(boolean enable)启用或禁止网络过滤功能 该功能开启后,仅有添加到白名单中的网络规则生效。 未添加到规则中的域名或IP无法访问。 调用后将清除addSysNetworkWhitelist(String)和addSysNetworkBlacklist(String)添加过的黑白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"Enable or disable web filtering After this function is enabled, only the network rules added to the whitelist take effect.java.util.List<NetItem>getAllSysNetworkWhitelist()在白名单模式下,获取当前的网络过滤规则设置。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In the white list mode, Get the current web filtering rule settings
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"java.util.List<VisitItem>getAllVisitItems(java.lang.String startDate, java.lang.String endDate, int maxItems)列举出从startDate到endDate的所有访问记录。List all access records from startDate to endDate.java.util.List<AppNetworkFilter>getAppNetworkFilter(java.lang.String packageName)获取应用网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Get the application network access filtering rules.java.util.List<java.lang.String>getSysNetworkBlacklist()获取系统禁止访问的网络地址黑名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Get the blacklist list of network addresses that are forbidden by the system.java.util.List<java.lang.String>getSysNetworkWhitelist()在白名单模式下,获取系统网络地址白名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In the white list mode, get the system network address white list list.java.util.List<VisitItem>getVisitItems(java.lang.String pkgName, java.lang.String startDate, java.lang.String endDate, int maxItems)列举出指定的应用从startDate到endDate的所有访问记录。List all access records of the specified application from startDate to endDate.booleanisIcmpEchoIgnore()终端是否可被pingCheck if the terminal is allowed to be pingedvoidsetIcmpEchoIgnore(boolean enable)禁止终端被pingDisallow ping to the terminal
-
-
-
Method Detail
-
addAppNetworkFilter
void addAppNetworkFilter(AppNetworkFilter filter) throws NetworkException
添加应用网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Add application network access filtering rules.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
filter-AppNetworkFilter- Throws:
NetworkException- Since:
- V3.20.00
-
deleteAppNetworkFilter
void deleteAppNetworkFilter(AppNetworkFilter filter) throws NetworkException
删除应用某个网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete a network access filter rule of the application.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
filter-AppNetworkFilter- Throws:
NetworkException- Since:
- V3.20.00
-
deleteAppNetworkFilter
void deleteAppNetworkFilter(java.lang.String packageName) throws NetworkException
删除指定包名的应用的所有网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules for the application with the specified package name.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
packageName-应用的包名。The package name of the application.- Throws:
NetworkException- Since:
- V3.20.00
-
deleteAppNetworkFilter
void deleteAppNetworkFilter(java.lang.String packageName, long uid) throws NetworkException
删除指定包名和用户ID的应用的所有网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules for the application with the specified package name and user ID.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
packageName-应用的包名。The package name of the application.uid-应用的用户ID。The user ID of the application.- Throws:
NetworkException- Since:
- V3.20.00
-
getAppNetworkFilter
java.util.List<AppNetworkFilter> getAppNetworkFilter(java.lang.String packageName) throws NetworkException
获取应用网络访问过滤规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Get the application network access filtering rules.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
packageName-应用包名。如果为NULL, 获取所有的应用网络访问过滤规则。Application package name. If it is null, all application network access filtering rules are obtained.- Returns:
- 应用网络访问过滤规则集合。Application network access filter rule set.
- Throws:
NetworkException- Since:
- V3.20.00
-
addSysNetworkWhitelist
void addSysNetworkWhitelist(java.lang.String address) throws NetworkException
在白名单模式下,添加一个系统允许访问的网络地址白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In whitelist mode, add a white list of network addresses that the system allows to access.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
address-IP地址。IP address.- Throws:
NetworkException- Since:
- V3.20.00
-
deleteSysNetworkWhitelist
void deleteSysNetworkWhitelist(java.lang.String address) throws NetworkException
在白名单模式下,删除一个网络地址白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In whitelist mode, delete a network address whitelist.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
address-IP地址。IP address.- Throws:
NetworkException- Since:
- V3.20.00
-
getSysNetworkWhitelist
java.util.List<java.lang.String> getSysNetworkWhitelist() throws NetworkException
在白名单模式下,获取系统网络地址白名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"In the white list mode, get the system network address white list list.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Returns:
- 系统网络地址白名单列表。IP地址。The system network address white list list. IP address.
- Throws:
NetworkException- Since:
- V3.20.00
-
addSysNetworkBlacklist
void addSysNetworkBlacklist(java.lang.String address) throws NetworkException
添加系统禁止访问的网络地址黑名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Add the blacklist of network addresses that are forbidden by the system.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
address-IP地址。如果address是"*"并且是首次调用,则开启白名单模式,禁止访问所有的IP地址。IP address. If the address is "*" and it is the first call, the whitelist mode will be enabled and access to all IP addresses will be prohibited.- Throws:
NetworkException- Since:
- V3.20.00
-
deleteSysNetworkBlacklist
void deleteSysNetworkBlacklist(java.lang.String address) throws NetworkException
删除系统禁止访问的网络地址黑名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete the blacklist of network addresses that are forbidden by the system.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Parameters:
address-系统网络地址白名单列表。IP地址。不支持"*"。*The system network address white list list. IP address. "*" is not supported.- Throws:
NetworkException- Since:
- V3.20.00
-
getSysNetworkBlacklist
java.util.List<java.lang.String> getSysNetworkBlacklist() throws NetworkException
获取系统禁止访问的网络地址黑名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Get the blacklist list of network addresses that are forbidden by the system.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Returns:
- 系统网络地址黑名单列表。IP地址。System network address blacklist list. IP address.
- Throws:
NetworkException- Since:
- V3.20.00
-
deleteAllFilter
void deleteAllFilter() throws NetworkException
删除所有网络访问过滤规则。包括关闭白名单模式,清除所有的黑白名单列表。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL"Delete all network access filtering rules. This includes turning off white list mode and clearing all black and white lists.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL"- Throws:
NetworkException- Since:
- V3.20.00
-
getVisitItems
java.util.List<VisitItem> getVisitItems(java.lang.String pkgName, java.lang.String startDate, java.lang.String endDate, int maxItems) throws NetworkException
列举出指定的应用从startDate到endDate的所有访问记录。List all access records of the specified application from startDate to endDate.- Parameters:
pkgName-应用包名Application package namestartDate-起始日期, 格式:YYYY-MM-DDStart date, format: YYYY-MM-DDendDate-结束日期, 格式:YYYY-MM-DDEnd date, format: YYYY-MM-DDmaxItems-输出记录的最大值Maximum output record- Returns:
- 访问记录Access records
- Throws:
NetworkException- Since:
- V3.27.00
-
getAllVisitItems
java.util.List<VisitItem> getAllVisitItems(java.lang.String startDate, java.lang.String endDate, int maxItems) throws NetworkException
列举出从startDate到endDate的所有访问记录。List all access records from startDate to endDate.- Parameters:
startDate-起始日期, 格式:YYYY-MM-DDStart date, format: YYYY-MM-DDendDate-结束日期, 格式:YYYY-MM-DDEnd date, format: YYYY-MM-DDmaxItems-输出记录的最大值Maximum output record- Returns:
- 访问记录Access records
- Throws:
NetworkException- Since:
- V3.27.00
-
addSysNetworkWhitelist
void addSysNetworkWhitelist(java.util.List<NetItem> netItems) throws NetworkException
在白名单模式下,添加指定的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, add the specified network rule.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"- Parameters:
netItems-NetItem- Throws:
NetworkException- Since:
- V3.29.00
-
deleteAllSysNetworkWhitelist
void deleteAllSysNetworkWhitelist() throws NetworkException
在白名单模式下,删除所有的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, delete all network rules.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"- Throws:
NetworkException- Since:
- V3.29.00
-
deleteSysNetworkWhitelist
void deleteSysNetworkWhitelist(java.util.List<NetItem> netItems) throws NetworkException
在白名单模式下,删除指定的网络规则。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In whitelist mode, Delete the specified network rule.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"- Parameters:
netItems-NetItem- Throws:
NetworkException- Since:
- V3.29.00
-
getAllSysNetworkWhitelist
java.util.List<NetItem> getAllSysNetworkWhitelist() throws NetworkException
在白名单模式下,获取当前的网络过滤规则设置。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"In the white list mode, Get the current web filtering rule settings
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"- Returns:
NetItem- Throws:
NetworkException- Since:
- V3.29.00
-
enableSysNetworkWhitelist
void enableSysNetworkWhitelist(boolean enable) throws NetworkException
启用或禁止网络过滤功能 该功能开启后,仅有添加到白名单中的网络规则生效。 未添加到规则中的域名或IP无法访问。 调用后将清除addSysNetworkWhitelist(String)和addSysNetworkBlacklist(String)添加过的黑白名单。
注:使用该方法时,需在AndroidManifest下添加权限: "com.pax.permission.NETWORK_CONTROL_ADVANCE"Enable or disable web filtering After this function is enabled, only the network rules added to the whitelist take effect. Domain names or IPs not added to the rules cannot be accessed. After calling, the black and white list added byaddSysNetworkWhitelist(String)andaddSysNetworkBlacklist(String)will be cleared.
Note: When using this method, you need to add permissions under AndroidManifest: "com.pax.permission.NETWORK_CONTROL_ADVANCE"- Throws:
NetworkException- Since:
- V3.29.00
-
createHttpsURLConnection
javax.net.ssl.HttpsURLConnection createHttpsURLConnection(java.net.URL url, int type, java.util.LinkedHashMap<java.lang.String,java.security.cert.Certificate> caCertMap, java.security.cert.Certificate clientCert, INetwork.ISSLCallback callback) throws NetworkException
创建HttpsURLConnection。Create an HttpsURLConnection.- Parameters:
URL-URL信息URL informationtype-0:RSA 1:ECC0:RSA 1:ECCcaCertMap-根证书链CA certificate chainclientCert-客户端证书Client certificatecallback-INetwork.ISSLCallback- Throws:
NetworkException- Since:
- V4.11.00
-
createSocket
java.net.Socket createSocket(java.lang.String ip, int port, int timeout) throws NetworkException
创建Socket。Create an Socket.- Parameters:
ip-IP地址IP addressport-端口porttimeout-超时时间Timeout- Throws:
NetworkException- Since:
- V4.11.00
-
createSocket
java.net.Socket createSocket(java.lang.String ip, int port, int timeout, int type, java.util.LinkedHashMap<java.lang.String,java.security.cert.Certificate> caCertMap, java.security.cert.Certificate clientCert, INetwork.ISSLCallback callback) throws NetworkException
创建Socket。Create an Socket.- Parameters:
ip-IP地址IP addressport-端口porttimeout-超时时间Timeouttype-0:RSA 1:ECC0:RSA 1:ECCcaCertMap-根证书链CA certificate chainclientCert-客户端证书Client certificatecallback-INetwork.ISSLCallback- Throws:
NetworkException- Since:
- V4.11.00
-
isIcmpEchoIgnore
boolean isIcmpEchoIgnore() throws NetworkException
终端是否可被pingCheck if the terminal is allowed to be pinged- Returns:
- true:禁止被PING; false:允许被PING。True: Disallow ping; False: Allow ping.
- Throws:
NetworkException- Since:
- V4.11.00
-
setIcmpEchoIgnore
void setIcmpEchoIgnore(boolean enable) throws NetworkException
禁止终端被pingDisallow ping to the terminal- Parameters:
enable-true:禁止被PING; false:允许被PING。True: Disallow ping; False: Allow ping.- Throws:
NetworkException- Since:
- V4.11.00
-
disableIpv6
void disableIpv6(int networkType, boolean isDisableIpv6) throws NetworkException
屏蔽IPV6功能disable IPv6- Parameters:
networkType-网络类型。必须为{1:TYPE Wi-Fi}、{2:TYPE以太网}或{4:TYPE移动}。这些类型可以通过OR操作组合。例如,如果要设置类型为Wi-Fi和以太网,则networkType可以为(1 | 2)= 3Type of network. Must be {1:TYPE Wi-Fi}, {2:TYPE ethernet}, or {4:TYPE mobile}.These types can be combined through OR operations. For example, if type Wi-Fi and ethernet are going to be set, the networkType can be (1 | 2) = 3isDisableIpv6-true-屏蔽;false-不屏蔽true-disable;false-enable- Throws:
NetworkException- networkException
-
-