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