Commit 1cc81ffe authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Merge branch 'master' of...

Merge branch 'master' of https://git.frostnerd.com/PublicAndroidApps/smokescreen into 94-overhaul-the-query-log-view
parents 00d926fd cabf80ee
......@@ -106,12 +106,12 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0-M2'
implementation 'com.frostnerd.utilskt:preferences:1.5.14' // https://git.frostnerd.com/AndroidUtils/preferenceskt (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.3.19' // https://git.frostnerd.com/AndroidUtils/navigationdraweractivity (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.5.137' // https://git.frostnerd.com/AndroidUtils/encrypteddnstunnelproxy
implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.3.20' // https://git.frostnerd.com/AndroidUtils/navigationdraweractivity (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.5.138' // https://git.frostnerd.com/AndroidUtils/encrypteddnstunnelproxy
implementation 'com.frostnerd.utilskt:general:1.0.16' // https://git.frostnerd.com/AndroidUtils/generalkt (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:adapters:1.1.1' // https://git.frostnerd.com/AndroidUtils/Adapters (Accessible after logging in [free of charge])
implementation 'androidx.work:work-runtime:2.2.0-rc01'
implementation 'androidx.work:work-runtime:2.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation "androidx.preference:preference:1.1.0-rc01"
implementation "com.google.android.material:material:1.1.0-alpha09"
......@@ -122,7 +122,7 @@ dependencies {
implementation "androidx.room:room-coroutines:2.1.0-alpha04"
testImplementation "androidx.room:room-testing:$room_version"
implementation 'io.sentry:sentry-android:1.7.23'
implementation 'io.sentry:sentry-android:1.7.26'
implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'
implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Nebulo (FDroid)</string>
<string name="app_name">Nebulo (F-Droid)</string>
</resources>
\ No newline at end of file
......@@ -13,7 +13,11 @@ import android.net.NetworkCapabilities
import android.net.Uri
import android.os.Build
import android.os.PowerManager
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.frostnerd.dnstunnelproxy.Decision
import com.frostnerd.dnstunnelproxy.DnsServerConfiguration
......@@ -119,6 +123,32 @@ fun Context.registerLocalReceiver(
return actualReceiver
}
fun AppCompatActivity.registerLocalReceiver(
filteredActions: List<String>,
unregisterOnDestroy:Boolean,
receiver: (intent: Intent?) -> Unit
): BroadcastReceiver {
val filter = IntentFilter()
for (filteredAction in filteredActions) {
filter.addAction(filteredAction)
}
val actualReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
receiver(intent)
}
}
val mgr = LocalBroadcastManager.getInstance(this)
mgr.registerReceiver(actualReceiver, filter)
if(unregisterOnDestroy) lifecycle.addObserver(object:LifecycleObserver {
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
fun onDestroy() {
mgr.unregisterReceiver(actualReceiver)
}
})
return actualReceiver
}
fun Context.sendLocalBroadcast(intent: Intent) {
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
}
......
......@@ -15,6 +15,9 @@ import com.github.anrwatchdog.ANRWatchDog
import io.sentry.Sentry
import io.sentry.android.AndroidSentryClientFactory
import io.sentry.event.User
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import leakcanary.LeakSentry
import java.util.*
import kotlin.system.exitProcess
......@@ -99,22 +102,23 @@ class SmokeScreen : Application() {
fun initSentry(forceEnabled: Boolean = false) {
if (!BuildConfig.DEBUG && (forceEnabled || getPreferences().crashReportingEnabled)) {
Sentry.init(
"https://fadeddb58abf408db50809922bf064cc@sentry.frostnerd.com:443/2",
AndroidSentryClientFactory(this)
)
Sentry.getContext().user = User(getPreferences().crashReportingUUID, null, null, null)
Sentry.getStoredClient().apply {
addTag("user.language", Locale.getDefault().displayLanguage)
addTag("app.database_version", AppDatabase.currentVersion.toString())
addTag("app.dns_server_name", getPreferences().dnsServerConfig.name)
addTag("app.dns_server_primary", getPreferences().dnsServerConfig.servers[0].address.formatToString())
addTag(
"app.dns_server_secondary",
getPreferences().dnsServerConfig.servers.getOrNull(1)?.address?.formatToString()
GlobalScope.launch(Dispatchers.IO) {
Sentry.init(
"https://fadeddb58abf408db50809922bf064cc@sentry.frostnerd.com:443/2",
AndroidSentryClientFactory(this@SmokeScreen)
)
addTag("app.debug", BuildConfig.DEBUG.toString())
addTag("app.installer_package", packageManager.getInstallerPackageName(packageName))
Sentry.getContext().user = User(getPreferences().crashReportingUUID, null, null, null)
Sentry.getStoredClient().apply {
addTag("user.language", Locale.getDefault().displayLanguage)
addTag("app.database_version", AppDatabase.currentVersion.toString())
addTag("app.dns_server_name", getPreferences().dnsServerConfig.name)
addTag("app.dns_server_primary", getPreferences().dnsServerConfig.servers[0].address.formatToString())
addTag(
"app.dns_server_secondary",
getPreferences().dnsServerConfig.servers.getOrNull(1)?.address?.formatToString()
)
addTag("app.installer_package", packageManager.getInstallerPackageName(packageName))
}
}
} else {
Sentry.close()
......
......@@ -48,11 +48,13 @@ import kotlin.random.Random
* You can contact the developer at daniel.wolf@frostnerd.com.
*/
class MainActivity : NavigationDrawerActivity() {
companion object {
const val BROADCAST_RELOAD_MENU = "main.reloadMenu"
}
override val drawerOverActionBar: Boolean = true
private var textColor: Int = 0
private var backgroundColor: Int = 0
private var inputElementColor: Int = 0
private var startedActivity = false
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(getPreferences().theme.layoutStyle)
......@@ -140,6 +142,9 @@ class MainActivity : NavigationDrawerActivity() {
getPreferences().vpnServiceState = VpnServiceState.STOPPED
BatteryOptimizationInfoDialog(this).show()
}
registerLocalReceiver(listOf(BROADCAST_RELOAD_MENU), true) {
reloadMenuItems()
}
}
private fun handleDeepAction() {
......@@ -175,6 +180,7 @@ class MainActivity : NavigationDrawerActivity() {
fragmentCreator = {
QueryLogFragment()
})
}
divider()
clickableItem(getString(R.string.menu_create_shortcut),
......
......@@ -163,6 +163,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
queryLogging.setOnPreferenceChangeListener { _, newValue ->
requireContext().getPreferences().queryLoggingEnabled = newValue as Boolean
context?.sendLocalBroadcast(Intent(MainActivity.BROADCAST_RELOAD_MENU))
true
}
exportQueries.summary =
......
......@@ -12,7 +12,7 @@
\n
\n%2$d исключенных приложений
\n%3$d записей в кэше</string>
<string name="notification_main_text_with_secondary">Запросы идут к %1$s и %2$d
<string name="notification_main_text_with_secondary">Запросы идут к %1$s и %2$s
\n
\n%3$d исключенных приложений
\n%4$d записей в кэше</string>
......
......@@ -131,7 +131,7 @@
<string name="changelog_build_33_2">The notification shown when the app crashes when automatic crash reporting is disabled now has a button to send the log files</string>
<string name="changelog_build_33_3">Replaced some of the icons</string>
<string name="changelog_build_33_4">Fixed a few crashes</string>
<string name="changelog_build_33_5">Added a view to test dns server speeds</string>
<string name="changelog_build_33_5">Added a view to test DNS server speeds</string>
<string name="changelog_build_33_6">You can now specify custom IP addresses for hosts. Hosts can be imported from URLs and added by hand.</string>
<string name="changelog_build_33_7">A few design tweaks</string>
<string-array name="changelog_build_33">
......@@ -151,10 +151,10 @@
<item>@string/changelog_build_34_1</item>
</string-array>
<string name="changelog_build_35_1">Fixed some crashes related to the dns rule import</string>
<string name="changelog_build_35_2">Aborting the dns rule import now doesn\'t freeze the UI anymore</string>
<string name="changelog_build_35_1">Fixed some crashes related to the DNS rule import</string>
<string name="changelog_build_35_2">Aborting the DNS rule import now doesn\'t freeze the UI anymore</string>
<string name="changelog_build_35_3">Small performance improvement for dns-over-https</string>
<string name="changelog_build_35_4">The host sources for the dns rules now show how many rules were imported from them</string>
<string name="changelog_build_35_4">The host sources for the DNS rules now show how many rules were imported from them</string>
<string-array name="changelog_build_35">
<item>1.0 Beta (Build 35)</item>
<item>@string/changelog_build_35_1</item>
......@@ -163,11 +163,11 @@
<item>@string/changelog_build_35_4</item>
</string-array>
<string name="changelog_build_36_1">You can now export the dns rules</string>
<string name="changelog_build_36_1">You can now export the DNS rules</string>
<string name="changelog_build_36_2">Dns rules can now be imported from files</string>
<string name="changelog_build_36_3">Fixed dns rules not being imported from very small sources</string>
<string name="changelog_build_36_3">Fixed DNS rules not being imported from very small sources</string>
<string name="changelog_build_36_4">The rule import can now recognize non-default letters (such as umlauts)</string>
<string name="changelog_build_36_5">Moved the dns rules to the sidebar menu</string>
<string name="changelog_build_36_5">Moved the DNS rules to the sidebar menu</string>
<string name="changelog_build_36_6">Fixed a crash which occurred on some device</string>
<string-array name="changelog_build_36">
<item>1.0 Beta (Build 36)</item>
......@@ -181,8 +181,8 @@
<string name="changelog_build_37_1">Fixed some crashes</string>
<string name="changelog_build_37_2">A few design improvements</string>
<string name="changelog_build_37_3">The dns rule import is now a bit faster</string>
<string name="changelog_build_37_4">Imported dns rules now take less space on the device</string>
<string name="changelog_build_37_3">The DNS rule import is now a bit faster</string>
<string name="changelog_build_37_4">Imported DNS rules now take less space on the device</string>
<string-array name="changelog_build_37">
<item>1.0 Beta (Build 37)</item>
<item>@string/changelog_build_37_1</item>
......@@ -191,7 +191,7 @@
<item>@string/changelog_build_37_4</item>
</string-array>
<string name="changelog_build_38_1">This is a performance focused update which should make dns queries faster, use less memory and be less battery consuming.</string>
<string name="changelog_build_38_1">This is a performance focused update which should make DNS queries faster, use less memory and be less battery consuming.</string>
<string name="changelog_build_38_2">Fixed a crash on some devices regarding the internal database</string>
<string-array name="changelog_build_38">
<item>1.0 Beta (Build 38)</item>
......@@ -199,7 +199,7 @@
<item>@string/changelog_build_38_2</item>
</string-array>
<string name="changelog_build_39_1">Fixed a crash which affected most dns servers</string>
<string name="changelog_build_39_1">Fixed a crash which affected most DNS servers</string>
<string-array name="changelog_build_39">
<item>1.0 Beta (Build 39)</item>
<item>@string/changelog_build_39_1</item>
......@@ -227,7 +227,7 @@
<string name="changelog_build_41_4">User-defined servers can now be edited</string>
<string name="changelog_build_41_5">The server list now only shows server which support the current network (IPv4 or IPv6)</string>
<string name="changelog_build_41_6">Host sources can now be edited by clicking on them</string>
<string name="changelog_build_41_7">The dns rules now don\'t open a separate window anymore</string>
<string name="changelog_build_41_7">The DNS rules now don\'t open a separate window anymore</string>
<string name="changelog_build_41_8">Fixed a few crashes</string>
<string-array name="changelog_build_41">
<item>1.0 Beta (Build 41)</item>
......@@ -244,7 +244,7 @@
<string name="changelog_build_43_1">The server info in the side bar menu now shows the current latency</string>
<string name="changelog_build_43_2">The speed test now only shows servers which support the current network</string>
<string name="changelog_build_43_3">Fixed dnsmasq host sources not being imported</string>
<string name="changelog_build_43_4">The dns rules view now shows the total amount of rules</string>
<string name="changelog_build_43_4">The DNS rules view now shows the total amount of rules</string>
<string name="changelog_build_43_5">A dialog is now shown when the system kills the app, informing about possible solutions</string>
<string name="changelog_build_43_6">Fixed a few crashes</string>
<string-array name="changelog_build_43">
......@@ -260,7 +260,7 @@
<string name="changelog_build_44_1">The app should now be able to recover itself when the screen has been off for some time</string>
<string name="changelog_build_44_2">Dns rules can now be configured to updated periodically</string>
<string name="changelog_build_44_3">Host sources are now only downloaded/parsed when their content changed</string>
<string name="changelog_build_44_4">The dns rules now support wildcards</string>
<string name="changelog_build_44_4">The DNS rules now support wildcards</string>
<string-array name="changelog_build_44">
<item>1.0 Beta (Build 44)</item>
<item>@string/changelog_build_44_1</item>
......
......@@ -44,8 +44,8 @@
<string name="dialog_crashreportingusages_data_app_2">App version</string>
<string name="dialog_crashreportingusages_data_app_3">Database version</string>
<string name="dialog_crashreportingusages_data_app_4">Dns server name</string>
<string name="dialog_crashreportingusages_data_app_5">Primary dns server</string>
<string name="dialog_crashreportingusages_data_app_6">Secondary dns server</string>
<string name="dialog_crashreportingusages_data_app_5">Primary DNS server</string>
<string name="dialog_crashreportingusages_data_app_6">Secondary DNS server</string>
<string-array name="dialog_crashreportingusages_data_app">
<item>@string/dialog_crashreportingusages_data_app_1</item>
<item>@string/dialog_crashreportingusages_data_app_2</item>
......
......@@ -120,8 +120,8 @@
<string name="dialog_deletehostsource_title">Delete %1s?</string>
<string name="dialog_deletehostsource_message">Are you sure you want to delete the host source %1s? This cannot be undone, the hosts from this source will be removed.</string>
<string name="dialog_clearuserrules_title">Clear all dns rules?</string>
<string name="dialog_clearuserrules_message">Are you want to clear all dns rules? This cannot be undone.</string>
<string name="dialog_clearuserrules_title">Clear all DNS rules?</string>
<string name="dialog_clearuserrules_message">Are you want to clear all DNS rules? This cannot be undone.</string>
<string name="dialog_newhostsource_title">New rule source</string>
<string name="dialog_newhostsource_edit_title">New rule source</string>
......@@ -132,21 +132,21 @@
<string name="dialog_newhostsource_use_as_whitelist">Use as whitelist</string>
<string name="dialog_newhostsource_error_name_empty">Please provide a name.</string>
<string name="dialog_newdnsrule_title">New Dns rule</string>
<string name="dialog_newdnsrule_edit">Edit Dns rule</string>
<string name="dialog_newdnsrule_title">New DNS rule</string>
<string name="dialog_newdnsrule_edit">Edit DNS rule</string>
<string name="dialog_newdnsrule_whitelist">Whitelist</string>
<string name="dialog_newdnsrule_specify_address">Address</string>
<string name="dialog_newdnsrule_hint_host">Host</string>
<string name="dialog_newdnsrule_hint_ipv4address">IPv4 address</string>
<string name="dialog_newdnsrule_hint_ipv6address">Ipv6 address</string>
<string name="dialog_newdnsrule_hint_ipv6address">IPv6 address</string>
<string name="dialog_newdnsrule_host_invalid">Please provide a valid host</string>
<string name="dialog_newdnsrule_ipv4_invalid">Please provide a valid IPv4 address</string>
<string name="dialog_newdnsrule_ipv6_invalid">Please provide a valid IPv6 address</string>
<string name="dialog_newdnsrule_wildcard_info">The host supports wildcards. Use star (*) for any amount of characters, numbers and allowed special characters except period (.). Use two stars (**) to include the period (.).</string>
<string name="dialog_newdnsrule_wildcard_info">The host supports wildcards. Use an asterisk (*) for any amount of characters, numbers and allowed special characters except period (.). Use two asterisks (**) to include the period (.).</string>
<string name="dialog_exportdnsrules_title">Export dns rules</string>
<string name="dialog_exportdnsrules_export_user_rules">Export custom host dns rules</string>
<string name="dialog_exportdnsrules_export_sources">Export dns rules from enabled host sources</string>
<string name="dialog_exportdnsrules_title">Export DNS rules</string>
<string name="dialog_exportdnsrules_export_user_rules">Export custom host DNS rules</string>
<string name="dialog_exportdnsrules_export_sources">Export DNS rules from enabled host sources</string>
<string name="dialog_editdelete_title">What do you want to do?</string>
<string name="dialog_editdelete_edit">Edit</string>
......
......@@ -86,16 +86,16 @@
<string name="preference_category_ip">IP settings</string>
<string name="title_enable_ipv6">Enable Ipv6</string>
<string name="title_enable_ipv6">Enable IPv6</string>
<string name="summary_enable_ipv6">Use IPv6, if the device has an IPv6 address assigned</string>
<string name="title_enable_ipv4">Enable Ipv4</string>
<string name="title_enable_ipv4">Enable IPv4</string>
<string name="summary_enable_ipv4">Use IPv4, if the device has an IPv4 address assigned</string>
<string name="title_force_ipv6">Force Ipv6</string>
<string name="title_force_ipv6">Force IPv6</string>
<string name="summary_force_ipv6">Force the app to accept IPv6 requests, even when the device doesn\'t use IPv6.</string>
<string name="title_force_ipv4">Force Ipv4</string>
<string name="title_force_ipv4">Force IPv4</string>
<string name="summary_force_ipv4">Force the app to accept IPv4 requests, even when the device doesn\'t use IPv4.</string>
<string name="title_allow_ipv4_traffic">Allow IPv4 traffic</string>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment