mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-25 07:32:46 +00:00
The application access log supports UDP and TCP only for now
This commit is contained in:
parent
b6718e4db3
commit
03140b5a1a
1 changed files with 6 additions and 3 deletions
|
@ -680,7 +680,8 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
dh.insertLog(packet, dname, (last_connected ? last_metered ? 2 : 1 : 0), last_interactive);
|
||||
|
||||
// Application log
|
||||
if (log_app && packet.uid >= 0) {
|
||||
if (log_app && packet.uid >= 0 &&
|
||||
(packet.protocol == 17 /* UDP */ || packet.protocol == 6 /* TCP */)) {
|
||||
if (dh.updateAccess(packet, dname, -1))
|
||||
if (notify && prefs.getBoolean("notify_" + packet.uid, true) &&
|
||||
(system || !Util.isSystem(packet.uid, SinkholeService.this)))
|
||||
|
@ -1091,8 +1092,10 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
return true;
|
||||
|
||||
packet.allowed = false;
|
||||
if (packet.protocol == 6 /* TCP */ || packet.protocol == 17 /* UDP */
|
||||
|| packet.protocol == 1 /* ICMPv4 */ || packet.protocol == 58 /* ICMPv6 */) {
|
||||
if (packet.protocol == 1 /* ICMPv4 */ || packet.protocol == 58 /* ICMPv6 */)
|
||||
packet.allowed = true;
|
||||
|
||||
else if (packet.protocol == 17 /* UDP */ || packet.protocol == 6 /* TCP */) {
|
||||
if (prefs.getBoolean("filter", false)) {
|
||||
if (packet.uid < 0) // unknown
|
||||
packet.allowed = true;
|
||||
|
|
Loading…
Reference in a new issue