mirror of https://github.com/M66B/NetGuard.git
Simplify access notification
This commit is contained in:
parent
fd50fc3cd8
commit
d0c0caf69f
|
@ -1636,26 +1636,16 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
||||||
|
|
||||||
DatabaseHelper dh = new DatabaseHelper(SinkholeService.this);
|
DatabaseHelper dh = new DatabaseHelper(SinkholeService.this);
|
||||||
Cursor cursor = dh.getAccessUnset(uid);
|
Cursor cursor = dh.getAccessUnset(uid);
|
||||||
int colVersion = cursor.getColumnIndex("version");
|
|
||||||
int colProtocol = cursor.getColumnIndex("protocol");
|
|
||||||
int colDAddr = cursor.getColumnIndex("daddr");
|
int colDAddr = cursor.getColumnIndex("daddr");
|
||||||
int colDPort = cursor.getColumnIndex("dport");
|
|
||||||
int colTime = cursor.getColumnIndex("time");
|
int colTime = cursor.getColumnIndex("time");
|
||||||
int colAllowed = cursor.getColumnIndex("allowed");
|
int colAllowed = cursor.getColumnIndex("allowed");
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(df.format(cursor.getLong(colTime))).append(' ');
|
sb.append(df.format(cursor.getLong(colTime))).append(' ');
|
||||||
|
|
||||||
sb.append(Util.getProtocolName(cursor.getInt(colProtocol), cursor.getInt(colVersion), true));
|
|
||||||
sb.append(' ');
|
|
||||||
|
|
||||||
String daddr = cursor.getString(colDAddr);
|
String daddr = cursor.getString(colDAddr);
|
||||||
sb.append(daddr);
|
sb.append(daddr);
|
||||||
|
|
||||||
int dport = cursor.getInt(colDPort);
|
|
||||||
if (dport > 0)
|
|
||||||
sb.append(':').append(dport);
|
|
||||||
|
|
||||||
int allowed = cursor.getInt(colAllowed);
|
int allowed = cursor.getInt(colAllowed);
|
||||||
if (allowed >= 0) {
|
if (allowed >= 0) {
|
||||||
pos = sb.indexOf(daddr);
|
pos = sb.indexOf(daddr);
|
||||||
|
|
Loading…
Reference in New Issue