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{
|
var processors = []processor{
|
||||||
|
patchExternalController, // must before patchOverride, so we only apply ExternalController in Override settings
|
||||||
patchOverride,
|
patchOverride,
|
||||||
patchGeneral,
|
patchGeneral,
|
||||||
patchProfile,
|
patchProfile,
|
||||||
@ -39,9 +40,19 @@ func patchOverride(cfg *config.RawConfig, _ string) error {
|
|||||||
return nil
|
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.Interface = ""
|
||||||
cfg.ExternalUI = ""
|
cfg.RoutingMark = 0
|
||||||
|
if cfg.ExternalController != "" || cfg.ExternalControllerTLS != "" {
|
||||||
|
cfg.ExternalUI = profileDir + "/ui"
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,10 @@ data class ConfigurationOverride(
|
|||||||
var ipv6: Boolean? = null,
|
var ipv6: Boolean? = null,
|
||||||
|
|
||||||
@SerialName("external-controller")
|
@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")
|
@SerialName("secret")
|
||||||
var secret: String? = null,
|
var secret: String? = null,
|
||||||
|
@ -149,6 +149,14 @@ class OverrideSettingsDesign(
|
|||||||
empty = R.string.default_
|
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(
|
editableText(
|
||||||
value = configuration::secret,
|
value = configuration::secret,
|
||||||
adapter = NullableTextAdapter.String,
|
adapter = NullableTextAdapter.String,
|
||||||
|
@ -147,6 +147,7 @@
|
|||||||
<string name="log_level">Log Level</string>
|
<string name="log_level">Log Level</string>
|
||||||
<string name="ipv6">IPv6</string>
|
<string name="ipv6">IPv6</string>
|
||||||
<string name="external_controller">External Controller</string>
|
<string name="external_controller">External Controller</string>
|
||||||
|
<string name="external_controller_tls">External Controller TLS</string>
|
||||||
<string name="secret">Secret</string>
|
<string name="secret">Secret</string>
|
||||||
<string name="hosts">Hosts</string>
|
<string name="hosts">Hosts</string>
|
||||||
<string name="_new">New</string>
|
<string name="_new">New</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user