diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index 787d64f3..238a3cc7 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1484,16 +1484,7 @@ public static class ConfigHandler if (profileItem is null) { profileItem = Hysteria2Fmt.ResolveFull2(strData, subRemarks); - } - if (profileItem is null) - { - profileItem = Hysteria2Fmt.ResolveFull(strData, subRemarks); - } - //Is naiveproxy configuration - if (profileItem is null) - { - profileItem = NaiveproxyFmt.ResolveFull(strData, subRemarks); - } + } if (profileItem is null || profileItem.Address.IsNullOrEmpty()) { return -1; diff --git a/v2rayN/ServiceLib/Handler/Fmt/ClashFmt.cs b/v2rayN/ServiceLib/Handler/Fmt/ClashFmt.cs index 6c6f2bbf..5925e0cb 100644 --- a/v2rayN/ServiceLib/Handler/Fmt/ClashFmt.cs +++ b/v2rayN/ServiceLib/Handler/Fmt/ClashFmt.cs @@ -4,7 +4,7 @@ public class ClashFmt : BaseFmt { public static ProfileItem? ResolveFull(string strData, string? subRemarks) { - if (Contains(strData, "external-controller", "-port", "proxies")) + if (Contains(strData, "rules", "-port", "proxies")) { var fileName = WriteAllText(strData, "yaml"); diff --git a/v2rayN/ServiceLib/Handler/Fmt/Hysteria2Fmt.cs b/v2rayN/ServiceLib/Handler/Fmt/Hysteria2Fmt.cs index 32fe81bb..32044e17 100644 --- a/v2rayN/ServiceLib/Handler/Fmt/Hysteria2Fmt.cs +++ b/v2rayN/ServiceLib/Handler/Fmt/Hysteria2Fmt.cs @@ -63,24 +63,6 @@ public class Hysteria2Fmt : BaseFmt return ToUri(EConfigType.Hysteria2, item.Address, item.Port, item.Id, dicQuery, remark); } - public static ProfileItem? ResolveFull(string strData, string? subRemarks) - { - if (Contains(strData, "server", "up", "down", "listen", "", "")) - { - var fileName = WriteAllText(strData); - - var profileItem = new ProfileItem - { - CoreType = ECoreType.hysteria, - Address = fileName, - Remarks = subRemarks ?? "hysteria_custom" - }; - return profileItem; - } - - return null; - } - public static ProfileItem? ResolveFull2(string strData, string? subRemarks) { if (Contains(strData, "server", "auth", "up", "down", "listen")) diff --git a/v2rayN/ServiceLib/Handler/Fmt/NaiveproxyFmt.cs b/v2rayN/ServiceLib/Handler/Fmt/NaiveproxyFmt.cs deleted file mode 100644 index 58f34d1f..00000000 --- a/v2rayN/ServiceLib/Handler/Fmt/NaiveproxyFmt.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace ServiceLib.Handler.Fmt; - -public class NaiveproxyFmt : BaseFmt -{ - public static ProfileItem? ResolveFull(string strData, string? subRemarks) - { - if (Contains(strData, "listen", "proxy", "", "")) - { - var fileName = WriteAllText(strData); - - var profileItem = new ProfileItem - { - CoreType = ECoreType.naiveproxy, - Address = fileName, - Remarks = subRemarks ?? "naiveproxy_custom" - }; - return profileItem; - } - - return null; - } -}