Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
PublicAndroidApps
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
Pipeline
#5114
passed with stages
in 1 minute and 7 seconds
Changes
1
Pipelines
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
.
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