mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-22 05:16:08 +03:00
only apply ExternalController in Override settings (#330)
This commit is contained in:
parent
a04c1883fa
commit
bb2c5283f8
@ -17,6 +17,7 @@ import (
|
||||
)
|
||||
|
||||
var processors = []processor{
|
||||
patchExternalController, // must before patchOverride, so we only apply ExternalController in Override settings
|
||||
patchOverride,
|
||||
patchGeneral,
|
||||
patchProfile,
|
||||
@ -39,9 +40,19 @@ func patchOverride(cfg *config.RawConfig, _ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func patchGeneral(cfg *config.RawConfig, _ string) error {
|
||||
func patchExternalController(cfg *config.RawConfig, _ string) error {
|
||||
cfg.ExternalController = ""
|
||||
cfg.ExternalControllerTLS = ""
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func patchGeneral(cfg *config.RawConfig, profileDir string) error {
|
||||
cfg.Interface = ""
|
||||
cfg.ExternalUI = ""
|
||||
cfg.RoutingMark = 0
|
||||
if cfg.ExternalController != "" || cfg.ExternalControllerTLS != "" {
|
||||
cfg.ExternalUI = profileDir + "/ui"
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -42,7 +42,10 @@ data class ConfigurationOverride(
|
||||
var ipv6: Boolean? = null,
|
||||
|
||||
@SerialName("external-controller")
|
||||
var externalController: String? = "127.0.0.1:0",
|
||||
var externalController: String? = null,
|
||||
|
||||
@SerialName("external-controller-tls")
|
||||
var externalControllerTLS: String? = null,
|
||||
|
||||
@SerialName("secret")
|
||||
var secret: String? = null,
|
||||
|
@ -149,6 +149,14 @@ class OverrideSettingsDesign(
|
||||
empty = R.string.default_
|
||||
)
|
||||
|
||||
editableText(
|
||||
value = configuration::externalControllerTLS,
|
||||
adapter = NullableTextAdapter.String,
|
||||
title = R.string.external_controller_tls,
|
||||
placeholder = R.string.dont_modify,
|
||||
empty = R.string.default_
|
||||
)
|
||||
|
||||
editableText(
|
||||
value = configuration::secret,
|
||||
adapter = NullableTextAdapter.String,
|
||||
|
@ -147,6 +147,7 @@
|
||||
<string name="log_level">Log Level</string>
|
||||
<string name="ipv6">IPv6</string>
|
||||
<string name="external_controller">External Controller</string>
|
||||
<string name="external_controller_tls">External Controller TLS</string>
|
||||
<string name="secret">Secret</string>
|
||||
<string name="hosts">Hosts</string>
|
||||
<string name="_new">New</string>
|
||||
|
Loading…
Reference in New Issue
Block a user