mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-30 19:31:26 +00:00
Fixed blocking IP addresses without domain name
This commit is contained in:
parent
4d96ac8368
commit
c580c3843e
2 changed files with 4 additions and 4 deletions
|
@ -922,7 +922,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
query += " LEFT JOIN dns AS d";
|
||||
query += " ON d.qname = a.daddr";
|
||||
query += " WHERE a.block >= 0";
|
||||
query += " AND d.time + d.ttl >= " + now;
|
||||
query += " AND (d.time IS NULL OR d.time + d.ttl >= " + now + ")";
|
||||
if (dname != null)
|
||||
query += " AND a.daddr = ?";
|
||||
|
||||
|
|
|
@ -1577,11 +1577,11 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
int version = cursor.getInt(colVersion);
|
||||
int protocol = cursor.getInt(colProtocol);
|
||||
String daddr = cursor.getString(colDAddr);
|
||||
String dresource = cursor.getString(colResource);
|
||||
String dresource = (cursor.isNull(colResource) ? null : cursor.getString(colResource));
|
||||
int dport = cursor.getInt(colDPort);
|
||||
boolean block = (cursor.getInt(colBlock) > 0);
|
||||
long time = cursor.getLong(colTime);
|
||||
long ttl = cursor.getLong(colTTL);
|
||||
long time = (cursor.isNull(colTime) ? new Date().getTime() : cursor.getLong(colTime));
|
||||
long ttl = (cursor.isNull(colTTL) ? 7 * 24 * 3600 * 1000L : cursor.getLong(colTTL));
|
||||
|
||||
if (isLockedDown(last_metered)) {
|
||||
String[] pkg = getPackageManager().getPackagesForUid(uid);
|
||||
|
|
Loading…
Reference in a new issue