mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
Update preset
This commit is contained in:
parent
c9ef22fe34
commit
d3674028cc
@ -96,7 +96,7 @@ object DataStore : OnPreferenceDataStoreChangeListener {
|
||||
var showGroupInNotification by configurationStore.boolean("showGroupInNotification")
|
||||
|
||||
var remoteDns by configurationStore.string(Key.REMOTE_DNS) { "https://8.8.8.8/dns-query" }
|
||||
var directDns by configurationStore.string(Key.DIRECT_DNS) { "https://223.5.5.5/dns-query" }
|
||||
var directDns by configurationStore.string(Key.DIRECT_DNS) { "local" }
|
||||
var enableDnsRouting by configurationStore.boolean(Key.ENABLE_DNS_ROUTING) { true }
|
||||
var enableFakeDns by configurationStore.boolean(Key.ENABLE_FAKEDNS)
|
||||
|
||||
|
||||
@ -212,23 +212,16 @@ object ProfileManager {
|
||||
outbound = -2,
|
||||
)
|
||||
)
|
||||
var country = Locale.getDefault().country.lowercase()
|
||||
var displayCountry = Locale.getDefault().displayCountry
|
||||
if (country in arrayOf(
|
||||
"ir"
|
||||
)
|
||||
) {
|
||||
createRule(
|
||||
RuleEntity(
|
||||
name = app.getString(R.string.route_bypass_domain, displayCountry),
|
||||
domains = "domain:$country",
|
||||
outbound = -1
|
||||
), false
|
||||
)
|
||||
} else {
|
||||
country = Locale.CHINA.country.lowercase()
|
||||
displayCountry = Locale.CHINA.displayCountry
|
||||
createRule(
|
||||
val fuckedCountry = mutableListOf("cn:中国")
|
||||
if (Locale.getDefault().country != Locale.CHINA.country) {
|
||||
// 非中文用户
|
||||
fuckedCountry += "ir:Iran"
|
||||
}
|
||||
for (c in fuckedCountry) {
|
||||
val country = c.substringBefore(":")
|
||||
val displayCountry = c.substringAfter(":")
|
||||
//
|
||||
if (country == "cn") createRule(
|
||||
RuleEntity(
|
||||
name = app.getString(R.string.route_play_store, displayCountry),
|
||||
domains = "domain:googleapis.cn",
|
||||
@ -241,14 +234,14 @@ object ProfileManager {
|
||||
outbound = -1
|
||||
), false
|
||||
)
|
||||
createRule(
|
||||
RuleEntity(
|
||||
name = app.getString(R.string.route_bypass_ip, displayCountry),
|
||||
ip = "geoip:$country",
|
||||
outbound = -1
|
||||
), false
|
||||
)
|
||||
}
|
||||
createRule(
|
||||
RuleEntity(
|
||||
name = app.getString(R.string.route_bypass_ip, displayCountry),
|
||||
ip = "geoip:$country",
|
||||
outbound = -1
|
||||
), false
|
||||
)
|
||||
rules = SagerDatabase.rulesDao.allRules()
|
||||
}
|
||||
return rules
|
||||
|
||||
@ -421,9 +421,10 @@ class GroupFragment : ToolbarFragment(R.layout.layout_group),
|
||||
subscriptionUpdateProgress.isIndeterminate = true
|
||||
} else {
|
||||
subscriptionUpdateProgress.isIndeterminate = false
|
||||
val progress = GroupUpdater.progress[proxyGroup.id]!!
|
||||
subscriptionUpdateProgress.max = progress.max
|
||||
subscriptionUpdateProgress.progress = progress.progress
|
||||
GroupUpdater.progress[proxyGroup.id]?.let {
|
||||
subscriptionUpdateProgress.max = it.max
|
||||
subscriptionUpdateProgress.progress = it.progress
|
||||
}
|
||||
}
|
||||
|
||||
updateButton.isInvisible = true
|
||||
|
||||
@ -173,7 +173,7 @@
|
||||
app:title="@string/domain_strategy_for_remote"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
<EditTextPreference
|
||||
app:defaultValue="https://223.5.5.5/dns-query"
|
||||
app:defaultValue="local"
|
||||
app:icon="@drawable/ic_action_dns"
|
||||
app:key="directDns"
|
||||
app:title="@string/direct_dns"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user