X-OpenWrt/CustomFiles/Patches/revert_remove-alterId-confi...

50 lines
2.6 KiB
Diff
Executable File

--- a/package/other/helloworld/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
+++ b/package/other/helloworld/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
@@ -302,6 +302,13 @@ o:depends("type", "ssr")
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
o:depends("type", "ssr")
+-- AlterId
+o = s:option(Value, "alter_id", translate("AlterId"))
+o.datatype = "port"
+o.default = 16
+o.rmempty = true
+o:depends({type = "v2ray", v2ray_protocol = "vmess"})
+
-- VmessId
o = s:option(Value, "vmess_id", translate("Vmess/VLESS ID (UUID)"))
o.rmempty = true
--- a/package/other/helloworld/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
+++ b/package/other/helloworld/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
@@ -242,6 +242,7 @@ function import_ssr_url(btn, urlname, si
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = ssm.ps;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = ssm.add;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm.port;
+ document.getElementsByName('cbid.shadowsocksr.' + sid + '.alter_id')[0].value = ssm.aid;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = ssm.id;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = ssm.net;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event);
--- a/package/other/helloworld/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
+++ b/package/other/helloworld/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
@@ -15,6 +15,7 @@ function vmess_vless()
users = {
{
id = server.vmess_id,
+ alterId = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and tonumber(server.alter_id) or nil,
security = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and server.security or nil,
encryption = (server.v2ray_protocol == "vless") and server.vless_encryption or nil,
flow = (server.xtls == '1') and (server.vless_flow and server.vless_flow or "xtls-rprx-splice") or nil
--- a/package/other/helloworld/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua
+++ b/package/other/helloworld/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua
@@ -163,6 +163,7 @@ local function processData(szType, conte
result.server = info.add
result.server_port = info.port
result.transport = info.net
+ result.alter_id = info.aid
result.vmess_id = info.id
result.alias = info.ps
-- result.mux = 1