Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Imre Kristoffer Eilertsen
Nebulo
Commits
531ab0ee
Commit
531ab0ee
authored
Aug 18, 2019
by
Daniel Wolf
Browse files
Use the current response as target for the rule
parent
b7b1f1b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/fragment/querylogfragment/QueryLogDetailFragment.kt
View file @
531ab0ee
...
...
@@ -89,7 +89,10 @@ class QueryLogDetailFragment : Fragment() {
createDnsRule
.
setOnClickListener
{
val
query
=
currentQuery
if
(
query
!=
null
)
{
DnsRuleDialog
(
context
!!
,
DnsRule
(
query
.
type
,
query
.
name
,
if
(
query
.
type
==
Record
.
TYPE
.
A
)
"0.0.0.0"
else
"::1"
),
onRuleCreated
=
{
newRule
->
val
answerIP
=
query
.
getParsedResponses
().
firstOrNull
{
it
.
type
==
query
.
type
}
?.
payload
?.
toString
()
?:
if
(
query
.
type
==
Record
.
TYPE
.
A
)
"0.0.0.0"
else
"::1"
DnsRuleDialog
(
context
!!
,
DnsRule
(
query
.
type
,
query
.
name
,
target
=
answerIP
),
onRuleCreated
=
{
newRule
->
val
id
=
if
(
newRule
.
isWhitelistRule
())
{
getDatabase
().
dnsRuleDao
().
insertWhitelist
(
newRule
)
}
else
getDatabase
().
dnsRuleDao
().
insertIgnore
(
newRule
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment