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
Wade
DnsChanger
Commits
06769f5c
Commit
06769f5c
authored
Apr 09, 2018
by
Daniel Wolf
Browse files
Added restrictions for dns2/dns2-v6
parent
8ab6d808
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/util/Preferences.java
View file @
06769f5c
...
...
@@ -38,6 +38,11 @@ public class Preferences extends com.frostnerd.utils.preferences.Preferences {
PreferencesRestrictionBuilder
builder
=
new
PreferencesRestrictionBuilder
();
builder
.
key
(
"dns1"
).
ofType
(
Type
.
STRING
).
shouldNotBe
(
null
).
always
().
shouldNotBe
(
""
).
always
().
shouldBeLike
(
Util
.
ipv4WithPort
).
always
().
doneWithKey
();
builder
.
key
(
"dns1-v6"
).
ofType
(
Type
.
STRING
).
shouldNotBe
(
null
).
always
().
shouldNotBe
(
""
).
always
().
shouldBeLike
(
Util
.
ipv6WithPort
).
always
().
doneWithKey
();
builder
.
key
(
"dns2"
).
ofType
(
Type
.
STRING
).
shouldNotBe
(
null
).
always
().
shouldBeLike
(
Util
.
ipv4WithPort
)
.
whenToStringIsNotEmpty
().
doneWithKey
();
builder
.
key
(
"dns2-v6"
).
ofType
(
Type
.
STRING
).
shouldNotBe
(
null
).
always
().
shouldBeLike
(
Util
.
ipv4WithPort
)
.
whenToStringIsNotEmpty
().
doneWithKey
();
builder
.
key
(
"setting_ipv6_enabled"
).
ofType
(
Type
.
BOOLEAN
).
shouldNotBe
(
false
).
when
(
new
PreferenceRestriction
.
Condition
()
{
@Override
public
boolean
isMet
(
@NonNull
com
.
frostnerd
.
utils
.
preferences
.
Preferences
preferences
,
@NonNull
String
key
,
@Nullable
Object
newValue
)
{
...
...
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