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
Charles
Nebulo
Commits
8dbbaccd
Commit
8dbbaccd
authored
Dec 06, 2019
by
Daniel Wolf
Browse files
Merge branch 'master' of
https://git.frostnerd.com/PublicAndroidApps/smokescreen
parents
014aa38a
4ce06ecb
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
8dbbaccd
...
...
@@ -144,7 +144,7 @@ dependencies {
implementation
'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
implementation
'com.squareup.leakcanary:leaksentry:2.0-alpha-3'
leakCanaryImplementation
'com.squareup.leakcanary:leakcanary-android:2.0
-beta-3
'
leakCanaryImplementation
'com.squareup.leakcanary:leakcanary-android:2.0'
testImplementation
'junit:junit:4.12'
testImplementation
"org.robolectric:robolectric:4.3.1"
...
...
app/src/main/java/com/frostnerd/smokescreen/database/repository/DnsQueryRepository.kt
View file @
8dbbaccd
...
...
@@ -86,7 +86,7 @@ class DnsQueryRepository(private val dnsQueryDao: DnsQueryDao) {
builder
.
append
(
query
.
type
.
name
).
append
(
","
)
builder
.
append
(
query
.
type
.
value
).
append
(
","
)
builder
.
append
(
query
.
askedServer
).
append
(
","
)
builder
.
append
(
query
.
responseSource
?
.
name
?:
""
).
append
(
","
)
builder
.
append
(
query
.
responseSource
.
name
).
append
(
","
)
builder
.
append
(
query
.
questionTime
).
append
(
","
)
builder
.
append
(
query
.
responseTime
).
append
(
","
)
builder
.
append
(
"\""
).
append
(
responseConverter
.
someObjectListToString
(
query
.
responses
).
replace
(
","
,
";"
).
replace
(
"\""
,
"'"
)).
append
(
"\""
)
...
...
app/src/main/java/com/frostnerd/smokescreen/fragment/SettingsFragment.kt
View file @
8dbbaccd
...
...
@@ -223,6 +223,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
dialog
.
setTitle
(
R
.
string
.
dialog_clearqueries_title
)
dialog
.
setPositiveButton
(
R
.
string
.
all_yes
)
{
d
,
_
->
requireContext
().
getDatabase
().
dnsQueryDao
().
deleteAll
()
getPreferences
().
exportedQueryCount
=
0
exportQueries
.
summary
=
getString
(
R
.
string
.
summary_export_queries
,
0
)
d
.
dismiss
()
...
...
app/src/main/java/com/frostnerd/smokescreen/service/DnsVpnService.kt
View file @
8dbbaccd
...
...
@@ -561,44 +561,50 @@ class DnsVpnService : VpnService(), Runnable {
}
private
fun
setNotificationText
()
{
val
primaryServer
:
String
val
secondaryServer
:
String
?
if
(
serverConfig
.
httpsConfiguration
!=
null
)
{
notificationBuilder
.
setContentTitle
(
getString
(
R
.
string
.
notification_main_title_https
))
primaryServer
=
serverConfig
.
httpsConfiguration
!!
[
0
].
urlCreator
.
address
.
getUrl
(
true
)
secondaryServer
=
serverConfig
.
httpsConfiguration
!!
.
getOrNull
(
1
)
?.
urlCreator
?.
address
?.
getUrl
(
true
)
}
else
{
notificationBuilder
.
setContentTitle
(
getString
(
R
.
string
.
notification_main_title_tls
))
primaryServer
=
serverConfig
.
tlsConfiguration
!!
[
0
].
formatToString
()
secondaryServer
=
serverConfig
.
tlsConfiguration
!!
.
getOrNull
(
1
)
?.
formatToString
()
}
val
text
=
when
{
getPreferences
().
simpleNotification
->
getString
(
R
.
string
.
notification_simple_text
,
serverConfig
.
name
)
secondaryServer
!=
null
->
getString
(
if
(
getPreferences
().
isBypassBlacklist
)
R
.
string
.
notification_main_text_with_secondary
else
R
.
string
.
notification_main_text_with_secondary_whitelist
,
primaryServer
,
secondaryServer
,
packageBypassAmount
,
dnsProxy
?.
cache
?.
livingCachedEntries
()
?:
0
)
else
->
getString
(
if
(
getPreferences
().
isBypassBlacklist
)
R
.
string
.
notification_main_text
else
R
.
string
.
notification_main_text_whitelist
,
primaryServer
,
packageBypassAmount
,
dnsProxy
?.
cache
?.
livingCachedEntries
()
?:
0
)
if
(
this
::
serverConfig
.
isInitialized
)
{
val
primaryServer
:
String
val
secondaryServer
:
String
?
if
(
serverConfig
.
httpsConfiguration
!=
null
)
{
notificationBuilder
.
setContentTitle
(
getString
(
R
.
string
.
notification_main_title_https
))
primaryServer
=
serverConfig
.
httpsConfiguration
!!
[
0
].
urlCreator
.
address
.
getUrl
(
true
)
secondaryServer
=
serverConfig
.
httpsConfiguration
!!
.
getOrNull
(
1
)
?.
urlCreator
?.
address
?.
getUrl
(
true
)
}
else
{
notificationBuilder
.
setContentTitle
(
getString
(
R
.
string
.
notification_main_title_tls
))
primaryServer
=
serverConfig
.
tlsConfiguration
!!
[
0
].
formatToString
()
secondaryServer
=
serverConfig
.
tlsConfiguration
!!
.
getOrNull
(
1
)
?.
formatToString
()
}
if
(
simpleNotification
)
{
notificationBuilder
.
setStyle
(
null
)
notificationBuilder
.
setContentText
(
text
)
}
else
{
notificationBuilder
.
setStyle
(
NotificationCompat
.
BigTextStyle
(
notificationBuilder
).
bigText
(
text
val
text
=
when
{
getPreferences
().
simpleNotification
->
getString
(
R
.
string
.
notification_simple_text
,
serverConfig
.
name
)
secondaryServer
!=
null
->
getString
(
if
(
getPreferences
().
isBypassBlacklist
)
R
.
string
.
notification_main_text_with_secondary
else
R
.
string
.
notification_main_text_with_secondary_whitelist
,
primaryServer
,
secondaryServer
,
packageBypassAmount
,
dnsProxy
?.
cache
?.
livingCachedEntries
()
?:
0
)
else
->
getString
(
if
(
getPreferences
().
isBypassBlacklist
)
R
.
string
.
notification_main_text
else
R
.
string
.
notification_main_text_whitelist
,
primaryServer
,
packageBypassAmount
,
dnsProxy
?.
cache
?.
livingCachedEntries
()
?:
0
)
}
if
(
simpleNotification
)
{
notificationBuilder
.
setStyle
(
null
)
notificationBuilder
.
setContentText
(
text
)
}
else
{
notificationBuilder
.
setStyle
(
NotificationCompat
.
BigTextStyle
(
notificationBuilder
).
bigText
(
text
)
)
)
}
}
}
...
...
app/src/main/java/com/frostnerd/smokescreen/util/proxy/QueryListener.kt
View file @
8dbbaccd
...
...
@@ -111,6 +111,7 @@ class QueryListener(private val context: Context) : QueryListener {
}
?:
return
val
wasInserted
=
queryLogState
.
remove
(
responseMessage
.
id
)
!!
!=
0
// Update if already inserted (0=insert)
query
.
responseTime
=
System
.
currentTimeMillis
()
query
.
responses
=
mutableListOf
()
for
(
answer
in
responseMessage
.
answerSection
)
{
query
.
addResponse
(
answer
)
}
...
...
app/src/main/resources/sentry.properties
View file @
8dbbaccd
anr.enable
=
tru
e
anr.enable
=
fals
e
uncaught.handler.enabled
=
false
\ No newline at end of file
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