mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-25 07:32:46 +00:00
Fixed allowing numeric addresses
This commit is contained in:
parent
9b224314eb
commit
2ba3f8e0d8
2 changed files with 6 additions and 2 deletions
|
@ -612,7 +612,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
|
||||
String query = "SELECT a.uid, a.version, a.protocol, a.daddr, d.resource, a.dport, a.block";
|
||||
query += " FROM access AS a";
|
||||
query += " JOIN dns AS d";
|
||||
query += " LEFT JOIN dns AS d";
|
||||
query += " ON d.qname = a.daddr";
|
||||
query += " WHERE a.block >= 0";
|
||||
|
||||
|
|
|
@ -1013,8 +1013,12 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
map.put(key, new HashMap());
|
||||
|
||||
try {
|
||||
map.get(key).put(InetAddress.getByName(dresource), block);
|
||||
Log.i(TAG, "Set filter uid=" + uid + " " + daddr + " " + dresource + "/" + dport + "=" + block);
|
||||
if (dresource == null) {
|
||||
if (Util.isNumericAddress(daddr))
|
||||
map.get(key).put(InetAddress.getByName(daddr), block);
|
||||
} else
|
||||
map.get(key).put(InetAddress.getByName(dresource), block);
|
||||
} catch (UnknownHostException ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue