Commit 7c4316eb authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Small cleanup

parent b2a76ed4
......@@ -45,8 +45,4 @@ captures/
libs/
libs/**
.idea/markdown-navigator-enh.xml
.idea/markdown-navigator.xml
.idea/navEditor.xml
\ No newline at end of file
libs/**
\ No newline at end of file
......@@ -46,7 +46,7 @@ There are two options on how to use the DNS rules:<br>
You can either define your own rules - for example to block single hosts - or import *rule sources* which contain a list of rules.<br><br>
There are multiple lists maintained by independent people you can use in Nebulo.
They cover different topics, from blocking ads, tracking to blocking porn or social media.<br>
I recommend checking out [Energized](energized.pro).
I recommend checking out [Energized](https://energized.pro).
It has multiple types of lists, covering use cases mentioned above.
If you have the F-Droid version the Energized lists are already added as sources.
......
......@@ -62,6 +62,7 @@ import java.util.logging.Level
* You can contact the developer at daniel.wolf@frostnerd.com.
*/
@Suppress("DEPRECATION")
fun Context.canUseFingerprintAuthentication(): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return false
val mgr = getSystemService(Context.FINGERPRINT_SERVICE) as? FingerprintManager
......@@ -72,6 +73,7 @@ fun Context.canUseFingerprintAuthentication(): Boolean {
return true
}
@Suppress("unused")
fun Context.registerReceiver(intentFilter: IntentFilter, receiver: (intent: Intent?) -> Unit): BroadcastReceiver {
val actualReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
......@@ -157,6 +159,7 @@ fun AppCompatActivity.registerLocalReceiver(
mgr.registerReceiver(actualReceiver, filter)
if(unregisterOnDestroy) lifecycle.addObserver(object:LifecycleObserver {
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
@Suppress("unused")
fun onDestroy() {
mgr.unregisterReceiver(actualReceiver)
}
......@@ -398,7 +401,7 @@ private fun createHttpsUpstreamAddress(url: String): HttpsUpstreamAddress {
}
private fun createTlsUpstreamAddress(host: String): TLSUpstreamAddress {
var parsedHost = ""
val parsedHost:String
var port: Int? = null
if (host.contains(":")) {
parsedHost = host.split(":")[0]
......
......@@ -138,7 +138,7 @@ fun Context.closeLogger() {
fun Context.deleteAllLogs() {
if (Logger.isOpen())
Logger.getInstance(this).destroy()
Logger.getLogDir(this).listFiles().forEach {
Logger.getLogDir(this).listFiles()!!.forEach {
it.delete()
}
}
......@@ -360,7 +360,7 @@ fun Context.zipAllLogFiles(): File? {
if (zipFile.exists() && (!zipFile.canRead() || !zipFile.canWrite())) return null
if (zipFile.exists()) zipFile.delete()
var filesToBeZipped = dir.listFiles()
var filesToBeZipped = dir.listFiles()!!
val dest = FileOutputStream(zipFile)
val out = ZipOutputStream(BufferedOutputStream(dest))
val buffer = ByteArray(2048)
......
......@@ -65,15 +65,15 @@ class SmokeScreen : Application() {
else {
context.log("Using fallback server: $to")
val configs = to.serverConfigurations.values
AddressCreator.globalResolve = {
val responsesIpv4 = configs.random().query(Question(it, Record.TYPE.A))?.takeIf {
AddressCreator.globalResolve = { domain ->
val responsesIpv4 = configs.random().query(Question(domain, Record.TYPE.A))?.takeIf {
it.responseCode == DnsMessage.RESPONSE_CODE.NO_ERROR
}?.answerSection?.map {
it.payload as A
}?.map {
it.inetAddress
}
val responsesIpv6 = configs.random().query(Question(it, Record.TYPE.AAAA))?.takeIf {
val responsesIpv6 = configs.random().query(Question(domain, Record.TYPE.AAAA))?.takeIf {
it.responseCode == DnsMessage.RESPONSE_CODE.NO_ERROR
}?.answerSection?.map {
it.payload as AAAA
......@@ -139,7 +139,7 @@ class SmokeScreen : Application() {
log("Application created.")
handleFallbackDns()
loadKnownDNSServers()
AbstractQuicDnsHandle.installProvider(this, {})
AbstractQuicDnsHandle.installProvider(this) {}
}
private fun handleFallbackDns() {
......@@ -275,7 +275,7 @@ class SmokeScreen : Application() {
) {
log("Sentry DSN retrieval returned invalid DSN '$retrievedDSN'.")
} else {
if (true || retrievedDSN != primaryDSN) {
if (retrievedDSN != primaryDSN) {
log("Sentry DSN successfuly resolved to '$retrievedDSN'")
then(retrievedDSN)
} else log("Retrieved Sentry DSN is the same as configured DSN, not re-configuring")
......
......@@ -10,6 +10,7 @@ import android.os.Bundle
import android.os.PowerManager
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import com.frostnerd.general.service.isServiceRunning
import com.frostnerd.lifecyclemanagement.launchWithLifecycle
import com.frostnerd.navigationdraweractivity.NavigationDrawerActivity
......@@ -94,7 +95,7 @@ class MainActivity : NavigationDrawerActivity() {
setTheme(getPreferences().theme.layoutStyle)
super.onCreate(savedInstanceState)
Notifications.createAllChannels(this)
setCardView { viewParent, suggestedHeight ->
setCardView { viewParent, _ ->
val view = layoutInflater.inflate(R.layout.menu_cardview, viewParent, false)
val update = {
launchWithLifecycle {
......@@ -283,11 +284,11 @@ class MainActivity : NavigationDrawerActivity() {
override fun createDrawerItems(): MutableList<DrawerItem> {
return createMenu {
fragmentItem(getString(R.string.menu_main),
iconLeft = getDrawable(R.drawable.ic_menu_dnsoverhttps),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_menu_dnsoverhttps),
fragmentCreator = singleInstanceFragment { MainFragment() }
)
fragmentItem(getString(R.string.menu_settings),
iconLeft = getDrawable(R.drawable.ic_menu_settings),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_menu_settings),
fragmentCreator = singleInstanceFragment { args ->
SettingsOverviewFragment().also {
it.arguments = args
......@@ -296,7 +297,7 @@ class MainActivity : NavigationDrawerActivity() {
if (getPreferences().queryLoggingEnabled) {
divider()
fragmentItem(getString(R.string.menu_querylogging),
iconLeft = getDrawable(R.drawable.ic_eye),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_eye),
fragmentCreator = {
QueryLogFragment()
})
......@@ -304,7 +305,7 @@ class MainActivity : NavigationDrawerActivity() {
}
divider()
clickableItem(getString(R.string.menu_create_shortcut),
iconLeft = getDrawable(R.drawable.ic_external_link),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_external_link),
onLongClick = null,
onSimpleClick = { _, _, _ ->
ServerChoosalDialog(this@MainActivity, onEntrySelected = {
......@@ -313,14 +314,14 @@ class MainActivity : NavigationDrawerActivity() {
false
})
fragmentItem(getString(R.string.button_main_dnsrules),
iconLeft = getDrawable(R.drawable.ic_view_list),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_view_list),
fragmentCreator = {
DnsRuleFragment()
})
divider()
if (isPackageInstalled(this@MainActivity, "com.android.vending")) {
clickableItem(getString(R.string.menu_rate),
iconLeft = getDrawable(R.drawable.ic_star),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_star),
onLongClick = null,
onSimpleClick = { _, _, _ ->
AlertDialog.Builder(this@MainActivity, getPreferences().theme.dialogStyle)
......@@ -337,7 +338,7 @@ class MainActivity : NavigationDrawerActivity() {
}
if (isPackageInstalled(this@MainActivity, "org.fdroid.fdroid")) {
clickableItem(getString(R.string.menu_show_on_fdroid),
iconLeft = getDrawable(R.drawable.ic_adb),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_adb),
onLongClick = null,
onSimpleClick = { _, _, _ ->
startActivity(
......@@ -351,7 +352,7 @@ class MainActivity : NavigationDrawerActivity() {
)
}
fragmentItem(getString(R.string.menu_about),
iconLeft = getDrawable(R.drawable.ic_info),
iconLeft = ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_info),
fragmentCreator = singleInstanceFragment { AboutFragment() })
}
}
......
......@@ -54,6 +54,7 @@ import java.security.NoSuchAlgorithmException
class PinActivity: BaseActivity() {
companion object {
@Suppress("MemberVisibilityCanBePrivate")
const val PIN_TIMEOUTMS = 2*60*1000
fun shouldValidatePin(context: Context, intent: Intent?): Boolean {
......@@ -133,7 +134,7 @@ class PinActivity: BaseActivity() {
setTheme(getPreferences().theme.dialogStyle)
super.onCreate(savedInstanceState)
if(!getPreferences().enablePin) {
onPinPassed(false)
onPinPassed()
} else {
val view = layoutInflater.inflate(R.layout.dialog_pin, null, false)
val handler = Handler()
......@@ -201,7 +202,7 @@ class PinActivity: BaseActivity() {
return intent?.getSerializableExtra("pin_type") as? PinType ?: PinType.APP
}
private fun onPinPassed(pinEnabled:Boolean = true) {
private fun onPinPassed() {
when(getPinType()) {
PinType.APP -> if(getPreferences().shouldShowAppIntro()) {
val startIntent = Intent(this, NebuloAppIntro::class.java)
......
package com.frostnerd.smokescreen.activity
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.ProgressBar
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.frostnerd.cacheadapter.AdapterBuilder
......@@ -47,6 +51,7 @@ import kotlinx.coroutines.Job
* You can contact the developer at daniel.wolf@frostnerd.com.
*/
@SuppressLint("SetTextI18n")
class SpeedTestActivity : BaseActivity() {
private var testRunning = false
private var wasStartedBefore = false
......@@ -98,13 +103,13 @@ class SpeedTestActivity : BaseActivity() {
val dohReachable = testResults!!.count {it.server.type == ServerType.DOH && it.latency != null}
val dohNotReachable = dohCount - dohReachable
val doqCount = testResults!!.count { it.server.type == ServerType.DOQ }
/*val doqCount = testResults!!.count { it.server.type == ServerType.DOQ }
val doqReachable = testResults!!.count {it.server.type == ServerType.DOQ && it.latency != null}
val doqNotReachable = dohCount - dohReachable
val doqNotReachable = dohCount - dohReachable */
val avgLatency = testResults!!.sumBy { it.latency ?: 0 }/testResults!!.size
val fastestServer = testResults!!.minBy { it.latency ?: Integer.MAX_VALUE}
val slowestServer = testResults!!.maxBy { it.latency ?: 0}
val fastestServer = testResults!!.minByOrNull { it.latency ?: Integer.MAX_VALUE }
val slowestServer = testResults!!.maxByOrNull { it.latency ?: 0 }
showInfoTextDialog(this,
getString(R.string.dialog_speedresult_title),
......@@ -238,12 +243,12 @@ class SpeedTestActivity : BaseActivity() {
}
private inner class SpeedViewHolder(view: View, private val showUseServerDialog:(SpeedTest) -> Any) : BaseViewHolder(view) {
val name = view.name
val servers = view.servers
val progress = view.progress
val latency = view.latency
val serverType = view.serverType
val nameWrap = view.nameWrap
val name: TextView = view.name
val servers: TextView = view.servers
val progress: ProgressBar = view.progress
val latency: TextView = view.latency
val serverType: TextView = view.serverType
val nameWrap: LinearLayout = view.nameWrap
private var defaultTextColor = latency.currentTextColor
fun display(speedTest: SpeedTest) {
......
......@@ -154,6 +154,7 @@ private fun migration(
}
}
@Suppress("unused")
private fun emptyMigration(from: Int, to: Int = AppDatabase.currentVersion): Migration {
return migration(from, to) { }
}
......
......@@ -38,15 +38,15 @@ import java.io.FileWriter
class DnsQueryRepository(private val dnsQueryDao: DnsQueryDao) {
fun getAllWithFilterLive(filterConfig: QueryLogFilterDialog.FilterConfig): LiveData<List<DnsQuery>> {
return dnsQueryDao.getAllWithFilterLive(filterConfig.showForwarded, filterConfig.showCache, filterConfig.showDnsrules, filterConfig.showBlockedByDns).let {
filterDnsQuery(filterConfig, it)
}
return filterDnsQuery(filterConfig,
dnsQueryDao.getAllWithFilterLive(filterConfig.showForwarded, filterConfig.showCache, filterConfig.showDnsrules, filterConfig.showBlockedByDns)
)
}
fun getAllWithHostAndFilterLive(hostPart:String, filterConfig: QueryLogFilterDialog.FilterConfig): LiveData<List<DnsQuery>> {
return dnsQueryDao.getAllWithHostAndFilterLive(hostPart, filterConfig.showForwarded, filterConfig.showCache, filterConfig.showDnsrules, filterConfig.showBlockedByDns).let {
filterDnsQuery(filterConfig, it)
}
return filterDnsQuery(filterConfig,
dnsQueryDao.getAllWithHostAndFilterLive(hostPart, filterConfig.showForwarded, filterConfig.showCache, filterConfig.showDnsrules, filterConfig.showBlockedByDns)
)
}
private fun filterDnsQuery(filterConfig: QueryLogFilterDialog.FilterConfig, liveData: LiveData<List<DnsQuery>>):LiveData<List<DnsQuery>> {
......
......@@ -96,21 +96,21 @@ class DnsRuleDialog(context: Context, dnsRule: DnsRule? = null, onRuleCreated: (
!view.ipv4Address.text.isNullOrBlank() -> Record.TYPE.A
else -> Record.TYPE.AAAA
}
val primaryTarget = if (isWhitelist) {
""
} else if(isBlockHost) {
"0.0.0.0"
} else when (type) {
Record.TYPE.A, Record.TYPE.ANY -> view.ipv4Address.text.toString()
else -> view.ipv6Address.text.toString()
val primaryTarget = when {
isWhitelist -> ""
isBlockHost -> "0.0.0.0"
else -> when (type) {
Record.TYPE.A, Record.TYPE.ANY -> view.ipv4Address.text.toString()
else -> view.ipv6Address.text.toString()
}
}
val secondaryTarget = if (isWhitelist) {
null
} else if(isBlockHost){
"::"
}else when (type) {
Record.TYPE.AAAA, Record.TYPE.ANY -> view.ipv6Address.text.toString()
else -> null
val secondaryTarget = when {
isWhitelist -> null
isBlockHost -> "::"
else -> when (type) {
Record.TYPE.AAAA, Record.TYPE.ANY -> view.ipv6Address.text.toString()
else -> null
}
}
var isWildcard = false
val host = view.host.text.toString().let {
......
......@@ -36,7 +36,7 @@ import kotlin.coroutines.CoroutineContext
class DnsRuleSearchDialog(
context: Context
):AlertDialog(context, context.getPreferences().theme.dialogStyle), CoroutineScope {
val supervisor = SupervisorJob()
private val supervisor = SupervisorJob()
override val coroutineContext: CoroutineContext = supervisor + Dispatchers.IO
var currentSearchJob:Job? = null
......
......@@ -62,7 +62,12 @@ class QueryLogFilterDialog (
val showAll = showForwarded && showCache && showDnsrules && showBlockedByDns
companion object {
val showAllConfig = FilterConfig(true, true, true, true)
val showAllConfig = FilterConfig(
showForwarded = true,
showCache = true,
showDnsrules = true,
showBlockedByDns = true
)
}
}
}
\ No newline at end of file
......@@ -136,26 +136,30 @@ class ServerChoosalDialog(
}
private fun loadServerData(type:ServerType) {
if (type == ServerType.DOT) {
val hiddenServers = context.getPreferences().removedDefaultDoTServers
defaultConfig = AbstractTLSDnsHandle.waitUntilKnownServersArePopulated { servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
when (type) {
ServerType.DOT -> {
val hiddenServers = context.getPreferences().removedDefaultDoTServers
defaultConfig = AbstractTLSDnsHandle.waitUntilKnownServersArePopulated { servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
}
}
} else if(type == ServerType.DOH){
val hiddenServers = context.getPreferences().removedDefaultDoHServers
defaultConfig = AbstractHttpsDNSHandle.waitUntilKnownServersArePopulated {servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
ServerType.DOH -> {
val hiddenServers = context.getPreferences().removedDefaultDoHServers
defaultConfig = AbstractHttpsDNSHandle.waitUntilKnownServersArePopulated {servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
}
}
} else if(type == ServerType.DOQ) {
val hiddenServers = context.getPreferences().removedDefaultDoQServers
defaultConfig = AbstractQuicDnsHandle.waitUntilKnownServersArePopulated { servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
ServerType.DOQ -> {
val hiddenServers = context.getPreferences().removedDefaultDoQServers
defaultConfig = AbstractQuicDnsHandle.waitUntilKnownServersArePopulated { servers ->
servers.filter {
it.key !in hiddenServers
}.values.toList()
}
}
}
userConfig = context.getPreferences().userServers.filter {
......@@ -349,9 +353,9 @@ class ServerChoosalDialog(
if (button.isChecked) {
currentSelectedServer = when(userConfiguration.type) {
ServerType.DOT ->AbstractTLSDnsHandle.KNOWN_DNS_SERVERS.minBy { it.key }!!.value
ServerType.DOH -> AbstractHttpsDNSHandle.KNOWN_DNS_SERVERS.minBy { it.key }!!.value
ServerType.DOQ -> AbstractQuicDnsHandle.KNOWN_DNS_SERVERS.minBy { it.key }!!.value
ServerType.DOT -> AbstractTLSDnsHandle.KNOWN_DNS_SERVERS.minByOrNull { it.key }!!.value
ServerType.DOH -> AbstractHttpsDNSHandle.KNOWN_DNS_SERVERS.minByOrNull { it.key }!!.value
ServerType.DOQ -> AbstractQuicDnsHandle.KNOWN_DNS_SERVERS.minByOrNull { it.key }!!.value
}
markCurrentSelectedServer()
context.getPreferences().dnsServerConfig = currentSelectedServer!!
......
......@@ -7,7 +7,7 @@ import android.content.IntentFilter
import android.net.Uri
import android.os.Bundle
import android.view.*
import android.widget.Switch
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.localbroadcastmanager.content.LocalBroadcastManager
......@@ -563,13 +563,13 @@ class DnsRuleFragment : Fragment() {
editSource: (HostSource) -> Unit,
refreshSource:(HostSource) -> Unit
) : BaseViewHolder(view) {
val text = view.text
val subText = view.subText
val enabled = view.enable
val delete = view.delete
val ruleCount = view.ruleCount
val refresh = view.refresh
val whitelistIndicator = view.sourceWhitelistIndicator
val text: TextView = view.text
val subText: TextView = view.subText
val enabled: Switch = view.enable
val delete: ImageButton = view.delete
val ruleCount: TextView = view.ruleCount
val refresh: ImageButton = view.refresh
val whitelistIndicator: ImageView = view.sourceWhitelistIndicator
private var source: HostSource? = null
init {
......@@ -608,10 +608,10 @@ class DnsRuleFragment : Fragment() {
changeRuleVisibility:(showRules:Boolean) -> Unit,
createRule:() -> Unit) :
BaseViewHolder(view) {
val clear = view.clear
val enabled = view.enable
val openList = view.openList
val add = view.add
val clear: ImageButton = view.clear
val enabled: Switch = view.enable
val openList: ImageButton = view.openList
val add: ImageButton = view.add
var elementsShown = false
init {
......@@ -648,10 +648,10 @@ class DnsRuleFragment : Fragment() {
private class CustomRuleHostViewHolder(view:View,
deleteRule:(DnsRule) -> Unit,
editRule:(DnsRule) -> Unit):BaseViewHolder(view) {
val text = view.text
val delete = view.delete
val cardContent = view.cardContent
val whitelistIndicator = view.whitelistIndicator
val text: TextView = view.text
val delete: ImageButton = view.delete
val cardContent: RelativeLayout = view.cardContent
val whitelistIndicator: ImageView = view.whitelistIndicator
lateinit var dnsRule:DnsRule
init {
......@@ -688,15 +688,11 @@ class DnsRuleFragment : Fragment() {
HostSource("PiHoleBlocklist Android tracking", "https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt"),
HostSource("Quidsup NoTrack Tracker Blocklist", "https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt"),
HostSource("someonewhocares.org", "https://someonewhocares.org/hosts/zero/hosts")
).apply {
forEach { it.enabled = false }
})
).onEach { it.enabled = false })
put(2, mutableListOf(
HostSource("Energized unblock", "https://raw.githubusercontent.com/EnergizedProtection/unblock/master/basic/formats/domains.txt", true),
HostSource("hblock", "https://hblock.molinero.dev/hosts")
).apply {
forEach { it.enabled = false }
})
).onEach { it.enabled = false })
put(4, mutableListOf(
HostSource("Energized Unified", "https://block.energized.pro/unified/formats/domains.txt", false).apply {
enabled = false
......
......@@ -43,7 +43,6 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.io.File
import kotlin.math.exp
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
......@@ -310,9 +309,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
}
var installedThirdPartyApps = 0
if(isPackageInstalled(requireContext(), "eu.faircode.netguard")) {
installedThirdPartyApps++
helpNetguard.setOnPreferenceClickListener {
AlertDialog.Builder(requireContext(), getPreferences().theme.dialogStyle)
.setTitle("NetGuard")
......@@ -355,7 +352,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
val startOnBoot = findPreference("start_on_boot") as CheckBoxPreference
val language = findPreference("language")
val fallbackDns = findPreference("fallback_dns")
startOnBoot.setOnPreferenceChangeListener { preference, newValue ->
startOnBoot.setOnPreferenceChangeListener { _, newValue ->
if (newValue == false) true
else {
if (requireContext().isAppBatteryOptimized()) {
......@@ -416,9 +413,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
private fun exportSettings() {
val hostSources = "Name;-;enabled;-;source;-;isWhitelist\n" + getDatabase().hostSourceDao().getAll().filterNot { it.isFileSource }.map {
it.name + ";-;" + it.enabled + ";-;" + it.source + ";-;" + it.whitelistSource
}.joinToString(separator="\n")
val hostSources = "Name;-;enabled;-;source;-;isWhitelist\n" + getDatabase().hostSourceDao()
.getAll().filterNot { it.isFileSource }.joinToString(separator = "\n") {
it.name + ";-;" + it.enabled + ";-;" + it.source + ";-;" + it.whitelistSource
}
val exportedKeys = setOf("has_rated_app", "asked_rate_app", "show_changelog", "sentry_consent", "sentry_consent_asked",
"asked_group_join", "language", "theme", "start_on_boot", "start_after_update", "user_bypass_packages", "user_bypass_blacklist",
"fallback_dns_server", "show_notification_on_lockscreen", "simple_notification", "hide_notification_icon", "notification_allow_pause",
......@@ -438,7 +436,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
file.writeBytes((hostSources + "\n" + json).toByteArray())
val fileUri = FileProvider.getUriForFile(requireContext(), "com.frostnerd.smokescreen.LogZipProvider", file)
val exportIntent = Intent(Intent.ACTION_SEND);
val exportIntent = Intent(Intent.ACTION_SEND)
exportIntent.putExtra(Intent.EXTRA_TEXT, "")
exportIntent.type = "text/plain"
exportIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name) + " -- settings")
......@@ -585,7 +583,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
dialog.dismiss()
},
neutralButton = null,