From e3f9831a68a5e0fcbc57bbf76ae7d17c1606216f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 13 Mar 2022 14:08:45 +0800 Subject: [PATCH] v2rayA: backport upstream fixes Signed-off-by: Tianling Shen --- ...led-to-clean-iptables-rules-in-some-cases.patch | 45 ++++++++++++++++++++++ ...ng-subscription-for-line-breaked-base64-s.patch | 31 +++++++++++++++ ...de-routingA-to-fix-the-quote-and-colon-co.patch | 41 ++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 v2raya/patches/001-fix-failed-to-clean-iptables-rules-in-some-cases.patch create mode 100644 v2raya/patches/002-fix-resolving-subscription-for-line-breaked-base64-s.patch create mode 100644 v2raya/patches/003-chore-upgrade-routingA-to-fix-the-quote-and-colon-co.patch diff --git a/v2raya/patches/001-fix-failed-to-clean-iptables-rules-in-some-cases.patch b/v2raya/patches/001-fix-failed-to-clean-iptables-rules-in-some-cases.patch new file mode 100644 index 0000000..82d10cd --- /dev/null +++ b/v2raya/patches/001-fix-failed-to-clean-iptables-rules-in-some-cases.patch @@ -0,0 +1,45 @@ +From e7839b5e9de01f8dca66449eb2e720963a56f403 Mon Sep 17 00:00:00 2001 +From: mzz2017 +Date: Sat, 5 Feb 2022 20:23:32 +0800 +Subject: [PATCH] fix: failed to clean iptables rules in some cases + +--- + service/core/v2ray/transparent.go | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/service/core/v2ray/transparent.go b/service/core/v2ray/transparent.go +index 5480660..07b01a0 100644 +--- a/service/core/v2ray/transparent.go ++++ b/service/core/v2ray/transparent.go +@@ -12,12 +12,14 @@ import ( + ) + + func DeleteTransparentProxyRules() { +- removeResolvHijacker() + iptables.CloseWatcher() +- iptables.Tproxy.GetCleanCommands().Run(false) +- iptables.Redirect.GetCleanCommands().Run(false) ++ if !conf.GetEnvironmentConfig().Lite { ++ removeResolvHijacker() ++ iptables.Tproxy.GetCleanCommands().Run(false) ++ iptables.Redirect.GetCleanCommands().Run(false) ++ iptables.DropSpoofing.GetCleanCommands().Run(false) ++ } + iptables.SystemProxy.GetCleanCommands().Run(false) +- iptables.DropSpoofing.GetCleanCommands().Run(false) + time.Sleep(100 * time.Millisecond) + } + +@@ -89,9 +91,6 @@ func CheckAndSetupTransparentProxy(checkRunning bool, setting *configure.Setting + } + + func CheckAndStopTransparentProxy() { +- if !IsTransparentOn() { +- return +- } + DeleteTransparentProxyRules() + } + +-- +2.20.1 + diff --git a/v2raya/patches/002-fix-resolving-subscription-for-line-breaked-base64-s.patch b/v2raya/patches/002-fix-resolving-subscription-for-line-breaked-base64-s.patch new file mode 100644 index 0000000..1fb9a4d --- /dev/null +++ b/v2raya/patches/002-fix-resolving-subscription-for-line-breaked-base64-s.patch @@ -0,0 +1,31 @@ +From 4a9347e0cc5effe67399931c804bcef1114d535f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E9=AB=98=E6=B8=90=E7=A6=BB?= + +Date: Tue, 8 Feb 2022 17:52:56 +0800 +Subject: [PATCH] fix: resolving subscription for line-breaked base64 string + (#406) + +--- + service/common/crypto.go | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/service/common/crypto.go b/service/common/crypto.go +index b9e5173..4a067e8 100644 +--- a/service/common/crypto.go ++++ b/service/common/crypto.go +@@ -44,10 +44,11 @@ func Base64StdDecode(s string) (string, error) { + return string(raw), err + } + +-// 封装base64.URLEncoding进行解码,加入了长度补全。当error时,返回输入和err ++// 封装base64.URLEncoding进行解码,加入了长度补全,换行删除。当error时,返回输入和err + func Base64URLDecode(s string) (string, error) { + s = strings.TrimSpace(s) + saver := s ++ s = strings.ReplaceAll(strings.ReplaceAll(s, "\n", ""), "\r", "") + if len(s)%4 > 0 { + s += strings.Repeat("=", 4-len(s)%4) + } +-- +2.20.1 + diff --git a/v2raya/patches/003-chore-upgrade-routingA-to-fix-the-quote-and-colon-co.patch b/v2raya/patches/003-chore-upgrade-routingA-to-fix-the-quote-and-colon-co.patch new file mode 100644 index 0000000..f12b2af --- /dev/null +++ b/v2raya/patches/003-chore-upgrade-routingA-to-fix-the-quote-and-colon-co.patch @@ -0,0 +1,41 @@ +From f0e76da0ad8efcfcafe600817635824ae0bc6220 Mon Sep 17 00:00:00 2001 +From: mzz2017 +Date: Sat, 19 Feb 2022 18:43:13 +0800 +Subject: [PATCH] chore: upgrade routingA to fix the quote and colon conflict + +--- + service/go.mod | 2 +- + service/go.sum | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/service/go.mod b/service/go.mod +index 128845c..8627a09 100644 +--- a/service/go.mod ++++ b/service/go.mod +@@ -25,7 +25,7 @@ require ( + github.com/tidwall/gjson v1.10.2 + github.com/tidwall/sjson v1.2.3 + github.com/v2fly/v2ray-core/v4 v4.42.2-0.20210928173456-a9979057dcaa +- github.com/v2rayA/RoutingA v1.0.1 ++ github.com/v2rayA/RoutingA v1.0.2 + github.com/v2rayA/beego/v2 v2.0.4 + github.com/v2rayA/shadowsocksR v1.0.4 + github.com/v2rayA/v2ray-lib v0.0.0-20211227083129-d4f59fbf62b8 +diff --git a/service/go.sum b/service/go.sum +index e6088a2..8aa379d 100644 +--- a/service/go.sum ++++ b/service/go.sum +@@ -213,8 +213,8 @@ github.com/v2fly/VSign v0.0.0-20201108000810-e2adc24bf848 h1:p1UzXK6VAutXFFQMnre + github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI= + github.com/v2fly/v2ray-core/v4 v4.42.2-0.20210928173456-a9979057dcaa h1:MyrHPDN4JhKoOvBOK8UUVoXd4Pd9AoIfbLClTPEbKt4= + github.com/v2fly/v2ray-core/v4 v4.42.2-0.20210928173456-a9979057dcaa/go.mod h1:6wk/2dqqbvcRFSLcSRR5GNfjMrcJcephXmA1HjZs0Pg= +-github.com/v2rayA/RoutingA v1.0.1 h1:vAU6Xz3aK8R2NvpKxnD/c54UouLlpGxMDhriCh6hBGU= +-github.com/v2rayA/RoutingA v1.0.1/go.mod h1:f5pkOS7f5YsjdSNWLTOTzv0/DaldMP0OeVY8Fi/G12g= ++github.com/v2rayA/RoutingA v1.0.2 h1:UHBIdrflQ0zj+PXnEDLj9D2aTk2gYreIsvtfPKNdpu4= ++github.com/v2rayA/RoutingA v1.0.2/go.mod h1:M9kQE+WtKChg48TABm9jdVBPjvm1bNDjm1zFPNfyU/c= + github.com/v2rayA/beego/v2 v2.0.4 h1:rnlnGhip6akWhl7gUw0lYiW0x+9Q9q4eba+bBQgSCnY= + github.com/v2rayA/beego/v2 v2.0.4/go.mod h1:PlQvo/G/eyvrJ1OaZ8rdgp/m0kh9CPIV3X1gSHS9UlE= + github.com/v2rayA/shadowsocksR v1.0.4 h1:65Ltdy+I/DnlkQTJj+R+X85zhZ63ORE1Roy+agAcF/s= +-- +2.20.1 + -- 2.11.0