Fix data migration sniff setting default to true

This commit is contained in:
yuhan6665
2021-04-16 20:33:59 -04:00
parent 8cdc7fb3c9
commit 90f2d33d97
2 changed files with 4 additions and 2 deletions

View File

@@ -69,7 +69,6 @@ object AngConfigManager {
settingsStorage?.encode(key, sharedPreferences.getString(key, null))
}
listOf(AppConfig.PREF_SPEED_ENABLED,
AppConfig.PREF_SNIFFING_ENABLED,
AppConfig.PREF_PROXY_SHARING,
AppConfig.PREF_LOCAL_DNS_ENABLED,
// AppConfig.PREF_ALLOW_INSECURE,
@@ -78,6 +77,7 @@ object AngConfigManager {
AppConfig.PREF_BYPASS_APPS,).forEach { key ->
settingsStorage?.encode(key, sharedPreferences.getBoolean(key, false))
}
settingsStorage?.encode(AppConfig.PREF_SNIFFING_ENABLED, sharedPreferences.getBoolean(AppConfig.PREF_SNIFFING_ENABLED, true))
settingsStorage?.encode(AppConfig.PREF_PER_APP_PROXY_SET, sharedPreferences.getStringSet(AppConfig.PREF_PER_APP_PROXY_SET, setOf()))
}

View File

@@ -37,7 +37,6 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application
settingsStorage?.encode(key, sharedPreferences.getString(key, ""))
}
AppConfig.PREF_SPEED_ENABLED,
AppConfig.PREF_SNIFFING_ENABLED,
AppConfig.PREF_PROXY_SHARING,
AppConfig.PREF_LOCAL_DNS_ENABLED,
AppConfig.PREF_FORWARD_IPV6,
@@ -45,6 +44,9 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application
AppConfig.PREF_BYPASS_APPS, -> {
settingsStorage?.encode(key, sharedPreferences.getBoolean(key, false))
}
AppConfig.PREF_SNIFFING_ENABLED, -> {
settingsStorage?.encode(key, sharedPreferences.getBoolean(key, true))
}
AppConfig.PREF_PER_APP_PROXY_SET -> {
settingsStorage?.encode(key, sharedPreferences.getStringSet(key, setOf()))
}