diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/AngConfigManager.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/AngConfigManager.kt index 404e1285..d03686b4 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/AngConfigManager.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/AngConfigManager.kt @@ -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())) } diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt index d117ef2c..464f3e9a 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/SettingsViewModel.kt @@ -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())) }