Merge Mainline
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
commit
5a16fd5948
@ -245,10 +245,6 @@ config KERNEL_KPROBES
|
||||
instrumentation and testing.
|
||||
If in doubt, say "N".
|
||||
|
||||
config KERNEL_KPROBE_EVENT
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_KPROBE_EVENTS
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2007-2016 OpenWrt.org
|
||||
# Copyright (C) 2007-2021 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
|
||||
@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bpytop
|
||||
PKG_VERSION:=1.0.54
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.60
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PYPI_NAME:=bpytop
|
||||
PKG_HASH:=a25665e71627a5ec918e6ecf4422bea1ba449069958f64c3879029cfb58a0ac1
|
||||
PKG_HASH:=48cf23725a873f77f562a89b18ac91dedfd39cf35586582a7668580da7b12826
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@ -35,11 +35,11 @@ define Package/bpytop/description
|
||||
endef
|
||||
|
||||
define Package/bpytop/install
|
||||
$(call Py3Package/$(1)/install,$(PKG_BUILD_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/* $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/share/bpytop
|
||||
$(CP) $(PKG_BUILD_DIR)/bpytop-themes/* $(1)/usr/share/bpytop/
|
||||
$(call Py3Package/$(1)/install,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/share
|
||||
$(CP) $(PKG_BUILD_DIR)/bpytop-themes $(1)/usr/share/bpytop
|
||||
endef
|
||||
|
||||
$(eval $(call Py3Package,bpytop))
|
||||
|
||||
43
package/ctcgfw/ipt2socks-alt/Makefile
Normal file
43
package/ctcgfw/ipt2socks-alt/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (C) 2021 CTCGFW Project-OpenWrt
|
||||
# <https://project-openwrt.eu.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipt2socks-alt
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/zfl9/ipt2socks/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=f247d72b61b1f40ce347904c43523bff257fc9f00ff269ecccf06f1d0f4b9d5e
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=AGPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ipt2socks-alt
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Utility for converting iptables (REDIRECT/TPROXY) to SOCKS5
|
||||
URL:=https://github.com/zfl9/ipt2socks
|
||||
DEPENDS:=+libpthread +libuv
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC) -flto
|
||||
TARGET_LDFLAGS += -flto
|
||||
|
||||
define Package/ipt2socks-alt/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/ipt2socks $(1)/usr/bin/ipt2socks-alt
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ipt2socks-alt))
|
||||
@ -4,12 +4,14 @@
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
LUCI_TITLE:=Open App Filter Module
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+kmod-oaf +appfilter
|
||||
LUCI_DEPENDS:=+appfilter
|
||||
|
||||
PKG_NAME:=luci-app-appfilter
|
||||
PKG_VERSION:=3.0
|
||||
PKG_RELEASE:=1
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
|
||||
local ds = require "luci.dispatcher"
|
||||
local utl = require "luci.util"
|
||||
|
||||
local m, s
|
||||
|
||||
@ -36,7 +37,7 @@ if class_fd then
|
||||
--apps.delimiter=";"
|
||||
-- select
|
||||
apps.widget="checkbox"
|
||||
apps.size=12
|
||||
apps.size=10
|
||||
|
||||
local fd = io.open(path)
|
||||
if fd then
|
||||
@ -94,23 +95,33 @@ function get_hostname_by_mac(dst_mac)
|
||||
fd:close()
|
||||
return nil
|
||||
end
|
||||
|
||||
function get_cmd_result(command)
|
||||
local fd
|
||||
local result
|
||||
fd = io.popen(command);
|
||||
if not fd then return "" end
|
||||
result = fd:read("*l");
|
||||
fd:close()
|
||||
return result
|
||||
end
|
||||
users.widget="checkbox"
|
||||
--users.widget="select"
|
||||
users.size=1
|
||||
|
||||
local fd = io.open("/proc/net/arp", "r")
|
||||
if not fd then return end
|
||||
if not fd then return m end
|
||||
while true do
|
||||
local line = fd:read("*l")
|
||||
if not line then
|
||||
break
|
||||
end
|
||||
if not line:match("Ip*") then
|
||||
local ip, hw_type, flags, mac, mask, device = line:match("(%S+) %s+ (%S+) %s+ (%S+) %s+ (%S+) %s+ (%S+) %s+ (%S+)")
|
||||
local ip=get_cmd_result(string.format("echo '%s' | awk '{print $1}'", line))
|
||||
local mac=get_cmd_result(string.format("echo '%s' | awk '{print $4}'", line))
|
||||
local device=get_cmd_result(string.format("echo '%s' | awk '{print $6}'", line))
|
||||
if device ~= nil and mac ~= nil and device:match("lan") then
|
||||
local hostname=get_hostname_by_mac(mac)
|
||||
if not hostname then
|
||||
if not hostname or hostname == "*" then
|
||||
users:value(mac, mac);
|
||||
else
|
||||
users:value(mac, hostname);
|
||||
@ -119,6 +130,14 @@ while true do
|
||||
end
|
||||
end
|
||||
|
||||
local config_users=m.uci:get_all("appfilter.user.users")
|
||||
if config_users~=nil then
|
||||
local r=utl.split(config_users, "%s+", nil, true)
|
||||
local max = table.getn(r)
|
||||
for i=1,max,1 do
|
||||
users:value(r[i], r[i]);
|
||||
end
|
||||
end
|
||||
m:section(SimpleSection).template = "admin_network/user_status"
|
||||
|
||||
|
||||
|
||||
@ -8,13 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Luci for JD dailybonus Script
|
||||
LUCI_DEPENDS:=+coreutils +coreutils-nohup +node +node-request \
|
||||
+lua +luasocket +lua-cjson +lua-md5 +luasec +wget-ssl
|
||||
LUCI_DEPENDS:=+lua +node +node-request +wget-ssl
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-jd-dailybonus
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=20210123
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_RELEASE:=20210125
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,7 +1,6 @@
|
||||
-- Copyright (C) 2020 jerrykuku <jerrykuku@gmail.com>
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
module('luci.controller.jd-dailybonus', package.seeall)
|
||||
package.path = package.path .. ';/usr/share/jd-dailybonus/?.lua'
|
||||
function index()
|
||||
if not nixio.fs.access('/etc/config/jd-dailybonus') then
|
||||
return
|
||||
@ -16,33 +15,17 @@ function index()
|
||||
entry({'admin', 'services', 'jd-dailybonus', 'check_update'}, call('check_update')) -- 检查更新
|
||||
entry({'admin', 'services', 'jd-dailybonus', 'qrcode'}, call('qrcode')) -- 获取二维码
|
||||
entry({'admin', 'services', 'jd-dailybonus', 'check_login'}, call('check_login')) -- 获取二维码
|
||||
entry({'admin', 'services', 'jd-dailybonus', 'realtime_log'}, call('get_log')) -- 获取实时日志
|
||||
end
|
||||
|
||||
-- 写入配置
|
||||
function write_json(file, content)
|
||||
local json = require 'luci.jsonc'
|
||||
local f = assert(io.open(file, 'w'))
|
||||
f:write(json.stringify(content, 1))
|
||||
f:close()
|
||||
end
|
||||
-- 执行程序
|
||||
function run()
|
||||
local e = {}
|
||||
local uci = luci.model.uci.cursor()
|
||||
local data = luci.http.formvalue()
|
||||
|
||||
data.auto_run = data.auto_run ~= nil and data.auto_run or 0
|
||||
data.auto_update = data.auto_update ~= nil and data.auto_update or 0
|
||||
uci:tset('jd-dailybonus', '@global[0]', data)
|
||||
uci:commit('jd-dailybonus')
|
||||
local json_data = {
|
||||
CookieJD = data.cookie,
|
||||
CookieJD2 = data.cookie2:len() == 0 and nil or data.cookie2,
|
||||
JD_DailyBonusDelay = data.stop,
|
||||
JD_DailyBonusTimeOut = data.out
|
||||
}
|
||||
write_json('/root/CookieSet.json', json_data)
|
||||
write_json('/www/CookieSet.json', json_data)
|
||||
luci.sys.call('lua /usr/share/jd-dailybonus/gen_cookieset.lua')
|
||||
luci.sys.call('/usr/share/jd-dailybonus/newapp.sh -r')
|
||||
luci.sys.call('/usr/share/jd-dailybonus/newapp.sh -a')
|
||||
e.error = 0
|
||||
@ -75,38 +58,75 @@ function update()
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
local User_Agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
|
||||
local Host='Host: plogin.m.jd.com'
|
||||
local Accept='Accept: application/json, text/plain, */*'
|
||||
local Accept_Language='Accept-Language: zh-cn'
|
||||
local cookie='/tmp/jd_cookie'
|
||||
|
||||
function get_timestamp()
|
||||
return os.time()*1000
|
||||
end
|
||||
|
||||
function get_s_token()
|
||||
luci.sys.exec('rm -f ' .. cookie)
|
||||
local timestamp = get_timestamp()
|
||||
local url =
|
||||
'https://plogin.m.jd.com/cgi-bin/mm/new_login_entrance?lang=chs&appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' ..
|
||||
timestamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport'
|
||||
local referer =
|
||||
'https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' ..
|
||||
timestamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport'
|
||||
local s_token = luci.sys.exec("echo -n $(wget-ssl --header='"..Accept.."' --header='"..Accept_Language.."' --header='"..Host.."' --referer='"..referer.."' --user-agent='"..User_Agent.."' --save-cookies="..cookie.." --keep-session-cookies -q -O - '"..url.."' | sed s/[[:space:]]//g | grep -oE '\"s_token\":\"(.+?)\"' | awk -F \\\" '{print $4}')")
|
||||
return s_token
|
||||
end
|
||||
|
||||
--获取二维码
|
||||
function qrcode()
|
||||
local jd_cookie = require 'jd_cookie'
|
||||
local e = {}
|
||||
e.error = 0
|
||||
e.data = jd_cookie.get_qrcode()
|
||||
local timestamp = get_timestamp()
|
||||
local s_token = get_s_token()
|
||||
local url = 'https://plogin.m.jd.com/cgi-bin/m/tmauthreflogurl?s_token='..s_token..'&v='..timestamp..'&remember=true'
|
||||
local referer = 'https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' .. timestamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport'
|
||||
local response = luci.sys.exec("echo -n $(wget-ssl --header='"..Accept.."' --header='"..Accept_Language.."' --header='"..Host.."' --referer='"..referer.."' --user-agent='"..User_Agent.."' --load-cookies="..cookie.." --save-cookies="..cookie.." --keep-session-cookies -q -O - '"..url.."')")
|
||||
local token = luci.sys.exec("echo -n $(echo \'"..response.."\' | grep -oE '\"token\":\"(.+?)\"' | awk -F \\\" '{print $4}')")
|
||||
local ou_state = luci.sys.exec("echo -n $(echo \'"..response.."\' | grep -oE '\"ou_state\":(\\d+)' | awk -F : '{print $2}')")
|
||||
local okl_token = luci.sys.exec("echo -n $(cat "..cookie.." | grep okl_token | awk '{print $7}')")
|
||||
local return_json = {
|
||||
qrcode_url = 'https://plogin.m.jd.com/cgi-bin/m/tmauth?appid=300&client_type=m&token=' .. token,
|
||||
check_url = 'https://plogin.m.jd.com/cgi-bin/m/tmauthchecktoken?&token=' .. token .. '&ou_state=' .. ou_state .. '&okl_token=' .. okl_token,
|
||||
}
|
||||
luci.http.prepare_content('application/json')
|
||||
luci.http.write_json(e)
|
||||
luci.http.write_json(return_json)
|
||||
end
|
||||
|
||||
--检测登录
|
||||
function check_login()
|
||||
local jd_cookie = require 'jd_cookie'
|
||||
local uci = luci.model.uci.cursor()
|
||||
local data = luci.http.formvalue()
|
||||
local id = data.id
|
||||
local e = jd_cookie.checkLogin(data.check_url, data.cookies)
|
||||
if e.error == 0 then
|
||||
local cookieStr = 'pt_key=' .. e.cookie.pt_key .. ';pt_pin=' .. e.cookie.pt_pin .. ';'
|
||||
local post_data = 'lang=chs&appid=300&source=wq_passport&returnurl=https://wqlogin2.jd.com/passport/LoginRedirect?state=1100399130787&returnurl=//home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action'
|
||||
local referer='https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wqlogin2.jd.com/passport/LoginRedirect?state='
|
||||
local response = luci.sys.exec("echo -n $(wget-ssl --post-data='"..post_data.."' --header='"..Accept.."' --header='"..Accept_Language.."' --header='"..Host.."' --referer='"..referer.."' --user-agent='"..User_Agent.."' --load-cookies="..cookie.." --save-cookies="..cookie.." --keep-session-cookies -q -O - '"..data.check_url.."')")
|
||||
local return_json = {
|
||||
error = tonumber(luci.sys.exec("echo -n $(echo \'"..response.."\' | grep -oE '\"errcode\":(\\d+)' | awk -F : '{print $2}')")),
|
||||
msg = luci.sys.exec("echo -n $(echo \'"..response.."\' | grep -oE '\"message\":\"(.+?)\"' | awk -F \\\" '{print $4}')"),
|
||||
}
|
||||
if return_json.error == 0 then
|
||||
local pt_key = luci.sys.exec("echo -n $(cat "..cookie.." | grep pt_key | awk '{print $7}')")
|
||||
local pt_pin = luci.sys.exec("echo -n $(cat "..cookie.." | grep pt_pin | awk '{print $7}')")
|
||||
local cookieStr = 'pt_key=' .. pt_key .. ';pt_pin=' .. pt_pin .. ';'
|
||||
uci:set('jd-dailybonus', '@global[0]', id, cookieStr)
|
||||
local json_data = {
|
||||
CookieJD = uci:get('jd-dailybonus', '@global[0]', 'cookie'),
|
||||
CookieJD2 = uci:get('jd-dailybonus', '@global[0]', 'cookie2'),
|
||||
JD_DailyBonusDelay = uci:get('jd-dailybonus', '@global[0]', 'stop'),
|
||||
JD_DailyBonusTimeOut = uci:get('jd-dailybonus', '@global[0]', 'out')
|
||||
}
|
||||
write_json('/root/CookieSet.json', json_data)
|
||||
write_json('/www/CookieSet.json', json_data)
|
||||
uci:commit('jd-dailybonus')
|
||||
e.cstr = cookieStr
|
||||
luci.sys.call('lua /usr/share/jd-dailybonus/gen_cookieset.lua')
|
||||
return_json.cookie = cookieStr
|
||||
end
|
||||
|
||||
luci.http.prepare_content('application/json')
|
||||
luci.http.write_json(e)
|
||||
luci.http.write_json(return_json)
|
||||
end
|
||||
|
||||
function get_log()
|
||||
local fs = require "nixio.fs"
|
||||
local log = fs.readfile("/var/log/jd_dailybonus.log") or ""
|
||||
luci.http.write(log)
|
||||
end
|
||||
@ -1,6 +1,4 @@
|
||||
local fs = require "nixio.fs"
|
||||
local jd = "jd-dailybonus"
|
||||
local conffile = "/www/JD_DailyBonus.htm"
|
||||
|
||||
log = SimpleForm("logview")
|
||||
log.submit = false
|
||||
@ -11,7 +9,7 @@ t = log:field(TextValue, "1", nil)
|
||||
t.rmempty = true
|
||||
t.rows = 30
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
return fs.readfile("/var/log/jd_dailybonus.log") or ""
|
||||
end
|
||||
t.readonly="readonly"
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
local fs = require "nixio.fs"
|
||||
local jd = "jd-dailybonus"
|
||||
|
||||
s = SimpleForm("scriptview")
|
||||
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
<label class="cbi-value-title"><%= translate("获取Cookie") %></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="button" data-rel="1" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第一Cookie') %>" />
|
||||
<input type="button" data-rel="2" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第二Cookie') %>" />
|
||||
<br>
|
||||
<div class="cbi-value-description">
|
||||
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="帮助"></span>
|
||||
<%= translate("点击上面按钮使用京东手机app扫码获取Cookie")%>
|
||||
</div>
|
||||
<input type="button" data-rel="1" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第一Cookie') %>" />
|
||||
<input type="button" data-rel="2" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第二Cookie') %>" />
|
||||
<br>
|
||||
<div class="cbi-value-description">
|
||||
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="帮助"></span>
|
||||
<%= translate("点击上面按钮使用京东手机app扫码获取Cookie")%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
@ -1,49 +1,43 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script src="/jd-dailybonus/jquery.min.js"></script>
|
||||
<script src="/jd-dailybonus/qrcode.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var jq=$.noConflict();
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/qrcode_js@1.0.0/qrcode.min.js"></script>
|
||||
<style>
|
||||
.modals-bg {
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
.modals-bg {
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
transition: all 0.3s ease-in-out;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 60%;
|
||||
height: 500px;
|
||||
background: #172b4d;
|
||||
left: 20%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 60%;
|
||||
height: 500px;
|
||||
background: #172b4d;
|
||||
left: 20%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
/* Firefox */
|
||||
-webkit-box-sizing: border-box;
|
||||
/* Safari */
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
/* Firefox */
|
||||
-webkit-box-sizing: border-box;
|
||||
/* Safari */
|
||||
transition: all 0.3s ease-in-out;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
.modals-bg.hide {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.modals.hide {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
@ -51,47 +45,48 @@ var jq=$.noConflict();
|
||||
}
|
||||
|
||||
|
||||
.modals h2 {
|
||||
color: #fff;
|
||||
background: transparent;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.modals h2 {
|
||||
color: #fff;
|
||||
background: transparent;
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modals h3 {
|
||||
font-size: 14px;
|
||||
color: #f5365c !important;
|
||||
background: transparent;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0 0 0.5em 0;
|
||||
}
|
||||
.modals h3 {
|
||||
font-size: 14px;
|
||||
color: #f5365c !important;
|
||||
background: transparent;
|
||||
padding: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
#log_content3 {
|
||||
border: 0;
|
||||
width: 99%;
|
||||
height: calc(100% - 4rem);
|
||||
font-family: 'Lucida Console';
|
||||
font-size: 11px;
|
||||
background: transparent;
|
||||
color: #FFFFFF;
|
||||
outline: none;
|
||||
padding-left: 3px;
|
||||
padding-right: 22px;
|
||||
overflow: hidden
|
||||
}
|
||||
#log_content3 {
|
||||
border: 0;
|
||||
width: 99%;
|
||||
height: calc(100% - 4rem);
|
||||
font-family: 'Lucida Console';
|
||||
font-size: 11px;
|
||||
background: transparent;
|
||||
color: #FFFFFF;
|
||||
outline: none;
|
||||
padding-left: 3px;
|
||||
padding-right: 22px;
|
||||
overflow: hidden;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.cbi-value-version {
|
||||
word-wrap: break-word;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.6;
|
||||
color: #5e72e4;
|
||||
font-weight: bold;
|
||||
padding: .7rem;
|
||||
padding-left: 0;
|
||||
width: 23rem;
|
||||
float: left;
|
||||
text-align: left;
|
||||
display: table-cell;
|
||||
}
|
||||
.cbi-value-version {
|
||||
word-wrap: break-word;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.6;
|
||||
color: #5e72e4;
|
||||
font-weight: bold;
|
||||
padding: .7rem;
|
||||
padding-left: 0;
|
||||
width: 23rem;
|
||||
float: left;
|
||||
text-align: left;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
#qrcontainer {
|
||||
position: fixed;
|
||||
@ -157,41 +152,41 @@ var jq=$.noConflict();
|
||||
padding: 1rem 0 0 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 80%;
|
||||
height: 500px;
|
||||
background: #172b4d;
|
||||
left: 10%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1024px) {
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 80%;
|
||||
height: 500px;
|
||||
background: #172b4d;
|
||||
left: 10%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.modals-bg {
|
||||
position: fixed;
|
||||
z-index: 100000;
|
||||
@media screen and (max-width: 700px) {
|
||||
.modals-bg {
|
||||
position: fixed;
|
||||
z-index: 100000;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.modals {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.modals {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<label class="cbi-value-title"><%= translate("执行") %></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-button cbi-button-reload" id="update_service" type="button" size="0"
|
||||
value="<%= translate("保存Cookie,并马上进行签到") %>">
|
||||
<input class="cbi-button cbi-button-reload" id="update_service" type="button" size="0"
|
||||
value="<%= translate("保存Cookie,并马上进行签到") %>">
|
||||
</div>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
@ -199,8 +194,8 @@ var jq=$.noConflict();
|
||||
<%+cbi/valueheader%>
|
||||
<label class="cbi-value-title"><%= translate("更新脚本") %></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-button cbi-button-reload" id="update_script" type="button" size="0"
|
||||
value="<%= translate("手动检查脚本更新,当前版本:v")..self.version %>">
|
||||
<input class="cbi-button cbi-button-reload" id="update_script" type="button" size="0" onclick="check_version()" data-version="<%= self.version %>"
|
||||
value="<%= translate("手动检查脚本更新,当前版本:v")..self.version %>">
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
@ -209,7 +204,7 @@ var jq=$.noConflict();
|
||||
<div id="refresh_qrcode" class="hidden">
|
||||
<div>
|
||||
<h3>二维码已失效</h3>
|
||||
<div class="refresh">刷新</div>
|
||||
<div class="refresh" onclick="get_code()">刷新</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="qrcode"></div>
|
||||
@ -219,233 +214,171 @@ var jq=$.noConflict();
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
const SAVE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","run")%>';
|
||||
const CHECK_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","check_update")%>';
|
||||
const QRCODE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","qrcode")%>';
|
||||
const CHECK_LOGIN_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","check_login")%>';
|
||||
const UPDATE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","update")%>';
|
||||
const CHECKING_TEXT = '<%= translate("正在检查是否存在新的版本 ...") %>';
|
||||
const UPDATING_TEXT = '<%= translate("正在更新脚本,请稍候 ...") %>';
|
||||
const NEW_VERSION = '<%= translate("当前已是最新版本。") %>';
|
||||
const UPDATE_TEXT = '<%= translate("有新的版本,请点击更新") %>';
|
||||
const SAVE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","run")%>';
|
||||
const CHECK_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","check_update")%>';
|
||||
const QRCODE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","qrcode")%>';
|
||||
const CHECK_LOGIN_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","check_login")%>';
|
||||
const UPDATE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","update")%>';
|
||||
const LOG_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","realtime_log")%>';
|
||||
const CHECKING_TEXT = '<%= translate("正在检查是否存在新的版本 ...") %>';
|
||||
const UPDATING_TEXT = '<%= translate("正在更新脚本,请稍候 ...") %>';
|
||||
const NEW_VERSION = '<%= translate("当前已是最新版本:") %>';
|
||||
|
||||
var needUpdate = false;
|
||||
var newVersion;
|
||||
var _responseLen;
|
||||
var noChange = 0;
|
||||
var noChange = 0;
|
||||
var ckid = 0;
|
||||
var modal = '<div class="modals-bg hide">' +
|
||||
'<div class="modals hide">' +
|
||||
'<h2><%:Sign in info%></h2>' +
|
||||
'<h3 style="margin-left:0;"><%:Service is running,Please do not refresh!%></h3>' +
|
||||
'<textarea cols="63" rows="28" wrap="on" readonly="readonly" id="log_content3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var modal = `<div class="modals-bg hide">
|
||||
<div class="modals hide">
|
||||
<h2>签到信息</h2>
|
||||
<h3 style="margin-left:0;">服务正在执行中,请勿刷新!</h3>
|
||||
<textarea cols="63" rows="28" wrap="on" readonly="readonly" id="log_content3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
//显示并开始刷新订阅
|
||||
function update_service() {
|
||||
jq("body").append(modal);
|
||||
jq(".modals-bg").removeClass("hide");
|
||||
setTimeout(function(){
|
||||
jq(".modals").removeClass("hide");
|
||||
//显示并开始刷新订阅
|
||||
function update_service() {
|
||||
document.body.insertAdjacentHTML('beforeend', modal);
|
||||
document.getElementsByClassName("modals-bg")[0].classList.remove("hide");
|
||||
setTimeout(() => {
|
||||
document.getElementsByClassName("modals")[0].classList.remove("hide");
|
||||
}, 100);
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
//保存订阅按钮
|
||||
jq("#update_service").click(function () {
|
||||
let prefix_array = jq(".cbi-input-text").eq(0).attr("id").split(".");
|
||||
prefix_array.pop()
|
||||
var prefix = prefix_array.join(".")+".";
|
||||
let array = jq("form[name*='cbi'").serializeArray()
|
||||
var json = {};
|
||||
jq.each(array, function () {
|
||||
if(this.name.indexOf(prefix) != -1){
|
||||
let aname = this.name.replace(prefix, "");
|
||||
if (json[aname]) {
|
||||
if (!json[aname].push) {
|
||||
json[aname] = [json[aname]];
|
||||
}
|
||||
json[aname].push(this.value || '');
|
||||
} else {
|
||||
json[aname] = this.value || '';
|
||||
}
|
||||
setTimeout(get_realtime_log, 500);
|
||||
}
|
||||
|
||||
function el(dom_el){
|
||||
let prefix = document.getElementById("cbi-jd-dailybonus-global").getElementsByClassName("cbi-section-node")[0].id.split("-").pop();
|
||||
return document.querySelector(`[name='cbid.jd-dailybonus.${prefix}.${dom_el}']`);
|
||||
}
|
||||
//保存订阅按钮
|
||||
document.getElementById("update_service").onclick = () => {
|
||||
if(el("cookie").value == ""){
|
||||
alert("请至少填写cookie1");
|
||||
return false;
|
||||
}
|
||||
let json = {
|
||||
auto_update: el("auto_update").checked?"1":"0",
|
||||
auto_update_time: el("auto_update").checked?el("auto_update_time").value:"0",
|
||||
auto_run: el("auto_run").checked?"1":"0",
|
||||
auto_run_time_h: el("auto_run").checked?el("auto_run_time_h").value:"0",
|
||||
auto_run_time_m: el("auto_run").checked?el("auto_run_time_m").value:"0",
|
||||
cookie: el("cookie").value,
|
||||
cookie2: el("cookie2").value,
|
||||
stop: el("stop").value,
|
||||
out: el("out").value,
|
||||
serverchan: el("serverchan").value,
|
||||
tg_token: el("tg_token").value,
|
||||
tg_userid: el("tg_userid").value,
|
||||
serverurl: el("serverurl").value,
|
||||
remote_url: el("remote_url").value
|
||||
}
|
||||
XHR.get(SAVE_URL, json, (x, d) => {
|
||||
if (d.error == 0) {
|
||||
update_service();
|
||||
} else {
|
||||
alert("请填写cookies");
|
||||
}
|
||||
});
|
||||
jq.ajax({
|
||||
type: "post",
|
||||
url: SAVE_URL,
|
||||
dataType: "json",
|
||||
data: json,
|
||||
success: function (d) {
|
||||
if (d.error == 0) {
|
||||
update_service();
|
||||
} else {
|
||||
alert("请填写cookies");
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
//更新脚本
|
||||
jq("#update_script").click(function () {
|
||||
check_version()
|
||||
return false;
|
||||
});
|
||||
|
||||
function updateS(){
|
||||
jq("#update_script").attr("disabled", true);
|
||||
jq("#update_script").val(UPDATING_TEXT);
|
||||
//console.log(data);
|
||||
var data = {
|
||||
version: jq("#update_script").attr("data-version")
|
||||
}
|
||||
jq.ajax({
|
||||
type: "post",
|
||||
url: UPDATE_URL,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.error == 0) {
|
||||
jq("#update_script").val(NEW_VERSION);
|
||||
jq(".cbi-value-version").text("v" + newVersion);
|
||||
} else {
|
||||
jq("#update_script").attr("disabled", false);
|
||||
alert("更新错误请重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function get_realtime_log() {
|
||||
jq.ajax({
|
||||
url: '/JD_DailyBonus.htm?v=' + parseInt(Math.random() * 100000000),
|
||||
dataType: 'html',
|
||||
error: function (xhr) {
|
||||
setTimeout("get_realtime_log();", 1000);
|
||||
},
|
||||
success: function (response) {
|
||||
var retArea = document.getElementById("log_content3");
|
||||
if (response.search(" 秒") != -1) {
|
||||
noChange++;
|
||||
}
|
||||
console.log(noChange);
|
||||
if (noChange > 10) {
|
||||
window.location.href = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus")%>';
|
||||
return false;
|
||||
} else {
|
||||
setTimeout("get_realtime_log();", 250);
|
||||
}
|
||||
retArea.value = response;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
_responseLen = response.length;
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function check_version() {
|
||||
jq("#update_script").attr("disabled", true);
|
||||
jq("#update_script").val(CHECKING_TEXT);
|
||||
jq.ajax({
|
||||
url: CHECK_URL,
|
||||
dataType: 'json',
|
||||
error: function (xhr) {
|
||||
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.new_version == 501){
|
||||
jq("#update_script").attr("disabled", false);
|
||||
jq("#update_script").val("无法获取新版本,请重试!");
|
||||
}else if (data.new_version > <%= self.version %>) {
|
||||
jq("#update_script").attr("disabled", false);
|
||||
jq("#update_script").val(UPDATE_TEXT + " v" + data.new_version);
|
||||
jq("#update_script").attr("data-version", data.new_version);
|
||||
newVersion = data.new_version;
|
||||
updateS();
|
||||
} else {
|
||||
updateS();
|
||||
jq("#update_script").val(NEW_VERSION + " v" + data.new_version);
|
||||
}
|
||||
//获取实时日志
|
||||
function get_realtime_log() {
|
||||
XHR.poll(1, LOG_URL, null, x => {
|
||||
let retArea = document.getElementById("log_content3");
|
||||
if (x.response.search(" 秒") != -1) {
|
||||
noChange++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
qrcode = new QRCode(document.getElementById("qrcode"),
|
||||
{
|
||||
text: "sample",
|
||||
correctLevel: QRCode.CorrectLevel.L
|
||||
if (noChange > 5) {
|
||||
location.reload();
|
||||
}
|
||||
retArea.value = x.response;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
});
|
||||
}
|
||||
|
||||
//更新脚本
|
||||
function check_version() {
|
||||
let btn = document.getElementById("update_script");
|
||||
let version = btn.getAttribute("data-version");
|
||||
btn.disabled = true;
|
||||
btn.value = CHECKING_TEXT;
|
||||
XHR.get(CHECK_URL, null, (x,d) => {
|
||||
if (d.new_version == 501){
|
||||
btn.disabled = false;
|
||||
btn.value = "无法获取新版本,请重试!";
|
||||
}else if (d.new_version > version) {
|
||||
btn.disabled = true;
|
||||
btn.value = `${UPDATING_TEXT} v${d.new_version}`;
|
||||
|
||||
XHR.get(UPDATE_URL, {version: version}, (x, r) => {
|
||||
if (r.error == 0) {
|
||||
btn.value = `${NEW_VERSION} v${d.new_version}`;
|
||||
btn.setAttribute("data-version", d.new_version);
|
||||
} else {
|
||||
btn.disabled = false;
|
||||
alert("更新错误请重试");
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
btn.value = `${NEW_VERSION} v${d.new_version}`;
|
||||
}
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
//初始化二维码
|
||||
(function(){
|
||||
let cookieBtn = Array.prototype.slice.call(document.getElementsByClassName("cookie-button"));
|
||||
try {
|
||||
qrcode = new QRCode(document.getElementById("qrcode"),
|
||||
{
|
||||
text: "sample",
|
||||
correctLevel: QRCode.CorrectLevel.L
|
||||
});
|
||||
cookieBtn.forEach(e => {
|
||||
e.onclick = () => {
|
||||
ckid = e.getAttribute("data-rel");
|
||||
get_code();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
alert("网络离线状态无法使用二维码获取Cookie,请刷新后重试!")
|
||||
cookieBtn.forEach(e => {
|
||||
e.disabled = true;
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
||||
//获取二维码
|
||||
function get_code() {
|
||||
let timeStamp = (new Date()).getTime()
|
||||
$.get('/qrcode?t='+timeStamp, function (data) {
|
||||
if (data.err == 0) {
|
||||
jq("#qrcontainer").removeClass("hidden")
|
||||
jq("#refresh_qrcode").addClass("hidden")
|
||||
qrcode.clear();
|
||||
qrcode.makeCode(data.qrcode);
|
||||
checkLogin();
|
||||
} else {
|
||||
Swal.fire({
|
||||
text: data.msg,
|
||||
icon: "error"
|
||||
})
|
||||
function get_code(){
|
||||
XHR.get(QRCODE_URL, null, (x,d) => {
|
||||
document.getElementById("qrcontainer").classList.remove("hidden");
|
||||
document.getElementById("refresh_qrcode").classList.add("hidden");
|
||||
qrcode.clear();
|
||||
qrcode.makeCode(d.qrcode_url);
|
||||
checkLogin(d.check_url);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkLogin(check_url){
|
||||
let cname = ckid == 1?"cookie":"cookie2"
|
||||
XHR.poll(3, CHECK_LOGIN_URL, { check_url: check_url, id: cname }, (x, d) => {
|
||||
if (d.error == 0) {
|
||||
XHR.halt();
|
||||
XHR._q = [];
|
||||
document.getElementById("qrcontainer").classList.add("hidden");
|
||||
document.getElementById("refresh_qrcode").classList.add("hidden");
|
||||
let prefix_array = document.getElementsByClassName("cbi-input-text")[0].getAttribute("id").split(".")
|
||||
prefix_array.pop()
|
||||
let id = `${prefix_array.join(".")}.${cname}`;
|
||||
document.getElementById(id).value = d.cookie
|
||||
} else if (d.error == 21 || d.error == 261) {
|
||||
XHR.halt();
|
||||
XHR._q = [];
|
||||
document.getElementById("refresh_qrcode").classList.remove("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
jq(".cookie-button").click(function(){
|
||||
ckid = jq(this).attr("data-rel");
|
||||
get_code()
|
||||
return false;
|
||||
})
|
||||
|
||||
jq('.refresh').click(get_code);
|
||||
|
||||
|
||||
function get_code(){
|
||||
let timeStamp = (new Date()).getTime()
|
||||
jq.ajax({
|
||||
url: QRCODE_URL+"?t="+timeStamp,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if(data.error == 0){
|
||||
jq("#qrcontainer").removeClass("hidden")
|
||||
jq("#refresh_qrcode").addClass("hidden")
|
||||
console.log(data.data.qrcode_url)
|
||||
qrcode.clear();
|
||||
qrcode.makeCode(data.data.qrcode_url);
|
||||
checkLogin(data.data.check_url,data.data.cookies);
|
||||
} else {
|
||||
alert("出错了请重试。")
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkLogin(check_url,cookies){
|
||||
var timeId = setInterval(() => {
|
||||
let cname = ckid == 1?"cookie":"cookie2"
|
||||
jq.post( CHECK_LOGIN_URL, { check_url:check_url,cookies: cookies ,id: cname}, function( data ) {
|
||||
if (data.error == 0) {
|
||||
clearInterval(timeId)
|
||||
jq("#qrcontainer").addClass("hidden")
|
||||
jq("#refresh_qrcode").addClass("hidden")
|
||||
let prefix_array = jq(".cbi-input-text").eq(0).attr("id").split(".");
|
||||
prefix_array.pop()
|
||||
let prefix = prefix_array.join(".")+".";
|
||||
console.log("."+prefix+cname,data.cstr);
|
||||
document.getElementById(prefix+cname).value =data.cstr
|
||||
} else if (data.error == 21 || data.error == 261) {
|
||||
clearInterval(timeId)
|
||||
jq("#refresh_qrcode").removeClass("hidden")
|
||||
}
|
||||
}, "json");
|
||||
}, 3000)
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@ -0,0 +1 @@
|
||||
/usr/share/jd-dailybonus/CookieSet.json
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
京东多合一签到脚本
|
||||
|
||||
更新时间: 2021.01.07 17:00 v1.90
|
||||
更新时间: 2021.01.20 20:00 v1.91
|
||||
有效接口: 40+
|
||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||
电报频道: @NobyDa
|
||||
@ -90,7 +90,7 @@ hostname = api.m.jd.com
|
||||
|
||||
var LogDetails = false; //是否开启响应日志, true则开启
|
||||
|
||||
var stop = 0; //自定义延迟签到,单位毫秒. 默认分批并发无延迟. 延迟作用于每个签到接口, 如填入延迟则切换顺序签到(耗时较长), VPN重启或越狱用户建议填写1, Surge用户请注意在SurgeUI界面调整脚本超时
|
||||
var stop = '0'; //自定义延迟签到, 单位毫秒. 默认分批并发无延迟; 该参数接受随机或指定延迟(例: '2000'则表示延迟2秒; '2000-5000'则表示延迟最小2秒,最大5秒内的随机延迟), 如填入延迟则切换顺序签到(耗时较长), Surge用户请注意在SurgeUI界面调整脚本超时; 注: 该参数Node.js或JSbox环境下已配置数据持久化, 留空(var stop = '')即可清除.
|
||||
|
||||
var DeleteCookie = false; //是否清除Cookie, true则开启.
|
||||
|
||||
@ -121,7 +121,7 @@ async function all() {
|
||||
JingDongShake(stop), //京东摇一摇
|
||||
JDSecKilling(stop), //京东秒杀
|
||||
JRLuckyLottery(stop), //金融抽奖顶部签到
|
||||
JingDongBuyCar(stop, '5fc3c1f2e91f46f09ab2b722e10d92bf'), //京东汽车
|
||||
JingDongBuyCar(stop, '319fd268c5df469192d9420a2de4d8d2'), //京东汽车
|
||||
JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '4D25A6F482'),
|
||||
JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'),
|
||||
JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C'),
|
||||
@ -135,7 +135,6 @@ async function all() {
|
||||
JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'), //京东母婴馆
|
||||
JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'), //京东数码电器馆
|
||||
// JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'), //京东晚市补贴金
|
||||
// JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'), //京东医药馆
|
||||
JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'), //京东女装馆
|
||||
JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'), //京东酒饮馆
|
||||
JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi'), //京东图书
|
||||
@ -146,10 +145,10 @@ async function all() {
|
||||
JDUserSignPre(stop, 'JDClothing', '京东商城-服饰', '4RBT3H9jmgYg1k2kBnHF8NAHm7m8'), //京东服饰
|
||||
JDUserSignPre(stop, 'JDUnderwear', '京东商城-内衣', '4PgpL1xqPSW1sVXCJ3xopDbB1f69'), //京东内衣馆
|
||||
JDUserSignPre(stop, 'JDSuitcase', '京东商城-箱包', 'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'), //京东箱包馆
|
||||
JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'), //京东校园
|
||||
JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '2QUxWHx5BSCNtnBDjtt5gZTq7zdZ'), //京东校园
|
||||
JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'), //京东健康
|
||||
// JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'), //京东宠物馆
|
||||
// JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'), //京东拍拍二手
|
||||
JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'), //京东拍拍二手
|
||||
JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'), //京东清洁馆
|
||||
JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'), //京东个人护理馆
|
||||
JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'), //京东珠宝馆
|
||||
@ -161,53 +160,52 @@ async function all() {
|
||||
await JingRongDoll(stop, 'JDDouble', '金融京豆-双签', 'F68B2C3E71', '', '', '', 'jingdou'); //京东金融 京豆双签
|
||||
break;
|
||||
default:
|
||||
await JingDongBean(stop); //京东京豆
|
||||
await JingDongStore(stop); //京东超市
|
||||
await JingDongWebcasts(stop); //京东直播
|
||||
await JingRongBean(stop); //金融简单赚钱
|
||||
await JingRongSteel(stop); //金融钢镚
|
||||
await JingDongTurn(stop); //京东转盘
|
||||
await JDFlashSale(stop); //京东闪购
|
||||
await JingDongCash(stop); //京东现金红包
|
||||
await JDMagicCube(stop, 2); //京东小魔方
|
||||
await JingDongGetCash(stop); //京东领现金
|
||||
await JingDongSubsidy(stop); //京东金贴
|
||||
await JingDongShake(stop); //京东摇一摇
|
||||
await JDSecKilling(stop); //京东秒杀
|
||||
await JRLuckyLottery(stop); //金融抽奖顶部签到
|
||||
await JingDongBuyCar(stop, '5fc3c1f2e91f46f09ab2b722e10d92bf'); //京东汽车
|
||||
await JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252');
|
||||
await JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C');
|
||||
await JingRongDoll(stop, 'JRFourDoll', '京东金融-签肆', '30C4F86264');
|
||||
await JingRongDoll(stop, 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F');
|
||||
await JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '4D25A6F482');
|
||||
await JingRongDoll(stop, 'XJDouble', '金融现金-双签', 'F68B2C3E71', '', '', '', 'xianjin'); //京东金融 现金双签
|
||||
await JingRongDoll(stop, 'JTDouble', '京东金贴-双签', '1DF13833F7'); //京东金融 金贴双签
|
||||
await JDUserSignPre(stop, 'JDUnderwear', '京东商城-内衣', '4PgpL1xqPSW1sVXCJ3xopDbB1f69'); //京东内衣馆
|
||||
await JDUserSignPre(stop, 'JDSuitcase', '京东商城-箱包', 'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'); //京东箱包馆
|
||||
await JDUserSignPre(stop, 'JDClothing', '京东商城-服饰', '4RBT3H9jmgYg1k2kBnHF8NAHm7m8'); //京东服饰
|
||||
await JDUserSignPre(stop, 'JDSchool', '京东商城-校园', '4812pn2PAcUyfNdWr7Cvpww5MCyW'); //京东校园
|
||||
await JDUserSignPre(stop, 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'); //京东健康
|
||||
await JDUserSignPre(stop, 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'); //京东鞋靴
|
||||
await JDUserSignPre(stop, 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'); //京东日历翻牌
|
||||
await JDUserSignPre(stop, 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'); //京东童装馆
|
||||
await JDUserSignPre(stop, 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'); //京东母婴馆
|
||||
await JDUserSignPre(stop, 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'); //京东数码电器馆
|
||||
// await JDUserSignPre(stop, 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'); //京东晚市补贴金
|
||||
// await JDUserSignPre(stop, 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'); //京东钟表馆
|
||||
// await JDUserSignPre(stop, 'JDDrug', '京东商城-医药', '3tqTG5sF1xCUyC6vgEF5CLCxGn7w'); //京东医药馆
|
||||
await JDUserSignPre(stop, 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'); //京东女装馆
|
||||
// await JDUserSignPre(stop, 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'); //京东宠物馆
|
||||
await JDUserSignPre(stop, 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi'); //京东图书
|
||||
// await JDUserSignPre(stop, 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'); //京东拍拍二手
|
||||
await JDUserSignPre(stop, 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'); //京东美妆馆
|
||||
await JDUserSignPre(stop, 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'); //京东酒饮馆
|
||||
await JDUserSignPre(stop, 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'); //京东菜场
|
||||
await JDUserSignPre(stop, 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'); //京东清洁馆
|
||||
await JDUserSignPre(stop, 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'); //京东个人护理馆
|
||||
await JDUserSignPre(stop, 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'); //京东珠宝馆
|
||||
await JingRongDoll(stop, 'JDDouble', '金融京豆-双签', 'F68B2C3E71', '', '', '', 'jingdou'); //京东金融 京豆双签
|
||||
await JingDongSpeedUp(stop); //京东天天加速
|
||||
await JingDongBean(0); //京东京豆
|
||||
await JingDongStore(Wait(stop)); //京东超市
|
||||
await JingDongWebcasts(Wait(stop)); //京东直播
|
||||
await JingRongBean(Wait(stop)); //金融简单赚钱
|
||||
await JingRongSteel(Wait(stop)); //金融钢镚
|
||||
await JingDongTurn(Wait(stop)); //京东转盘
|
||||
await JDFlashSale(Wait(stop)); //京东闪购
|
||||
await JingDongCash(Wait(stop)); //京东现金红包
|
||||
await JDMagicCube(Wait(stop), 2); //京东小魔方
|
||||
await JingDongGetCash(Wait(stop)); //京东领现金
|
||||
await JingDongSubsidy(Wait(stop)); //京东金贴
|
||||
await JingDongShake(Wait(stop)); //京东摇一摇
|
||||
await JDSecKilling(Wait(stop)); //京东秒杀
|
||||
await JRLuckyLottery(Wait(stop)); //金融抽奖顶部签到
|
||||
await JingDongBuyCar(Wait(stop), '319fd268c5df469192d9420a2de4d8d2'); //京东汽车
|
||||
await JingRongDoll(Wait(stop), 'JRTwoDoll', '京东金融-签贰', '3A3E839252');
|
||||
await JingRongDoll(Wait(stop), 'JRThreeDoll', '京东金融-签叁', '69F5EC743C');
|
||||
await JingRongDoll(Wait(stop), 'JRFourDoll', '京东金融-签肆', '30C4F86264');
|
||||
await JingRongDoll(Wait(stop), 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F');
|
||||
await JingRongDoll(Wait(stop), 'JRDoll', '京东金融-签壹', '4D25A6F482');
|
||||
await JingRongDoll(Wait(stop), 'XJDouble', '金融现金-双签', 'F68B2C3E71', '', '', '', 'xianjin'); //京东金融 现金双签
|
||||
await JingRongDoll(Wait(stop), 'JTDouble', '京东金贴-双签', '1DF13833F7'); //京东金融 金贴双签
|
||||
await JDUserSignPre(Wait(stop), 'JDUnderwear', '京东商城-内衣', '4PgpL1xqPSW1sVXCJ3xopDbB1f69'); //京东内衣馆
|
||||
await JDUserSignPre(Wait(stop), 'JDSuitcase', '京东商城-箱包', 'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'); //京东箱包馆
|
||||
await JDUserSignPre(Wait(stop), 'JDClothing', '京东商城-服饰', '4RBT3H9jmgYg1k2kBnHF8NAHm7m8'); //京东服饰
|
||||
await JDUserSignPre(Wait(stop), 'JDSchool', '京东商城-校园', '2QUxWHx5BSCNtnBDjtt5gZTq7zdZ'); //京东校园
|
||||
await JDUserSignPre(Wait(stop), 'JDHealth', '京东商城-健康', 'w2oeK5yLdHqHvwef7SMMy4PL8LF'); //京东健康
|
||||
await JDUserSignPre(Wait(stop), 'JDShoes', '京东商城-鞋靴', '4RXyb1W4Y986LJW8ToqMK14BdTD'); //京东鞋靴
|
||||
await JDUserSignPre(Wait(stop), 'JDCalendar', '京东日历-翻牌', '36V2Qw59VPNsuLxY84vCFtxFzrFs'); //京东日历翻牌
|
||||
await JDUserSignPre(Wait(stop), 'JDChild', '京东商城-童装', '3Af6mZNcf5m795T8dtDVfDwWVNhJ'); //京东童装馆
|
||||
await JDUserSignPre(Wait(stop), 'JDBaby', '京东商城-母婴', '3BbAVGQPDd6vTyHYjmAutXrKAos6'); //京东母婴馆
|
||||
await JDUserSignPre(Wait(stop), 'JD3C', '京东商城-数码', '4SWjnZSCTHPYjE5T7j35rxxuMTb6'); //京东数码电器馆
|
||||
// await JDUserSignPre(Wait(stop), 'JDSubsidy', '京东晚市-补贴', 'xK148m4kWj5hBcTPuJUNNXH3AkJ'); //京东晚市补贴金
|
||||
// await JDUserSignPre(Wait(stop), 'JDClocks', '京东商城-钟表', '2BcJPCVVzMEtMUynXkPscCSsx68W'); //京东钟表馆
|
||||
await JDUserSignPre(Wait(stop), 'JDWomen', '京东商城-女装', 'DpSh7ma8JV7QAxSE2gJNro8Q2h9'); //京东女装馆
|
||||
// await JDUserSignPre(Wait(stop), 'JDPet', '京东商城-宠物', '37ta5sh5ocrMZF3Fz5UMJbTsL42'); //京东宠物馆
|
||||
await JDUserSignPre(Wait(stop), 'JDBook', '京东商城-图书', '3SC6rw5iBg66qrXPGmZMqFDwcyXi'); //京东图书
|
||||
await JDUserSignPre(Wait(stop), 'JDShand', '京东拍拍-二手', '3S28janPLYmtFxypu37AYAGgivfp'); //京东拍拍二手
|
||||
await JDUserSignPre(Wait(stop), 'JDMakeup', '京东商城-美妆', '2smCxzLNuam5L14zNJHYu43ovbAP'); //京东美妆馆
|
||||
await JDUserSignPre(Wait(stop), 'JDFineWine', '京东商城-酒饮', 'zGwAUzL3pVGjptBBGeYfpKjYdtX'); //京东酒饮馆
|
||||
await JDUserSignPre(Wait(stop), 'JDVege', '京东商城-菜场', 'Wcu2LVCFMkBP3HraRvb7pgSpt64'); //京东菜场
|
||||
await JDUserSignPre(Wait(stop), 'JDClean', '京东商城-清洁', '2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'); //京东清洁馆
|
||||
await JDUserSignPre(Wait(stop), 'JDCare', '京东商城-个护', 'NJ1kd1PJWhwvhtim73VPsD1HwY3'); //京东个人护理馆
|
||||
await JDUserSignPre(Wait(stop), 'JDJewels', '京东商城-珠宝', 'zHUHpTHNTaztSRfNBFNVZscyFZU'); //京东珠宝馆
|
||||
await JingRongDoll(Wait(stop), 'JDDouble', '金融京豆-双签', 'F68B2C3E71', '', '', '', 'jingdou'); //京东金融 京豆双签
|
||||
await JingDongSpeedUp(Wait(stop)); //京东天天加速
|
||||
break;
|
||||
}
|
||||
await Promise.all([
|
||||
@ -316,11 +314,12 @@ function ReadCookie() {
|
||||
if ($nobyda.isJSBox || $nobyda.isNode) {
|
||||
if (Key) $nobyda.write(Key, EnvInfo);
|
||||
if (DualKey) $nobyda.write(DualKey, EnvInfo2);
|
||||
if (stop !== '0') $nobyda.write(stop, "JD_DailyBonusDelay");
|
||||
}
|
||||
add = DualKey || $nobyda.read(EnvInfo2) ? true : false
|
||||
KEY = Key ? Key : $nobyda.read(EnvInfo)
|
||||
out = parseInt($nobyda.read("JD_DailyBonusTimeOut")) || out
|
||||
stop = parseInt($nobyda.read("JD_DailyBonusDelay")) || stop
|
||||
stop = Wait($nobyda.read("JD_DailyBonusDelay"), true) || Wait(stop, true)
|
||||
boxdis = $nobyda.read("JD_Crash_disable") === "false" || $nobyda.isNode || $nobyda.isJSBox ? false : boxdis
|
||||
LogDetails = $nobyda.read("JD_DailyBonusLog") === "true" || LogDetails
|
||||
ReDis = ReDis ? $nobyda.write("", "JD_DailyBonusDisables") : ""
|
||||
@ -2189,6 +2188,21 @@ function disable(Val, name, way) {
|
||||
}
|
||||
}
|
||||
|
||||
function Wait(readDelay, ini) {
|
||||
if (!readDelay || readDelay === '0') return 0
|
||||
if (typeof(readDelay) == 'string') {
|
||||
var readDelay = readDelay.replace(/"|"|'|'/g, ''); //prevent novice
|
||||
if (readDelay.indexOf('-') == -1) return parseInt(readDelay) || 0;
|
||||
const raw = readDelay.split("-").map(Number);
|
||||
const plan = parseInt(Math.random() * (raw[1] - raw[0] + 1) + raw[0], 10);
|
||||
if (ini) console.log(`\n初始化随机延迟: 最小${raw[0]/1000}秒, 最大${raw[1]/1000}秒`);
|
||||
// else console.log(`\n预计等待: ${(plan / 1000).toFixed(2)}秒`);
|
||||
return ini ? readDelay : plan
|
||||
} else if (typeof(readDelay) == 'number') {
|
||||
return readDelay > 0 ? readDelay : 0
|
||||
} else return 0
|
||||
}
|
||||
|
||||
function GetCookie() {
|
||||
try {
|
||||
if ($request.headers && $request.url.match(/api\.m\.jd\.com.*=signBean/)) {
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/lua
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local json = require 'luci.jsonc'
|
||||
|
||||
function write_json(file, content)
|
||||
local json = require 'luci.jsonc'
|
||||
local f = assert(io.open(file, 'w'))
|
||||
f:write(json.stringify(content, 1))
|
||||
f:close()
|
||||
end
|
||||
|
||||
local data = {
|
||||
CookieJD = uci:get('jd-dailybonus', '@global[0]', 'cookie'),
|
||||
CookieJD2 = uci:get('jd-dailybonus', '@global[0]', 'cookie2'),
|
||||
JD_DailyBonusDelay = uci:get('jd-dailybonus', '@global[0]', 'stop'),
|
||||
JD_DailyBonusTimeOut = uci:get('jd-dailybonus', '@global[0]', 'out')
|
||||
}
|
||||
|
||||
write_json('/usr/share/jd-dailybonus/CookieSet.json', data)
|
||||
@ -1,168 +0,0 @@
|
||||
-- Copyright (C) 2021 jerrykuku <jerrykuku@gmail.com>
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
local uci = require 'luci.model.uci'.cursor()
|
||||
local config = 'jd-dailybonus'
|
||||
package.path = package.path .. ';/usr/share/jd-dailybonus/?.lua'
|
||||
local requests = require 'requests'
|
||||
local socket = require 'socket'
|
||||
local tinsert = table.insert
|
||||
local ssub, slen, schar, sbyte, sformat, sgsub = string.sub, string.len, string.char, string.byte, string.format, string.gsub
|
||||
local User_Agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
|
||||
local Host = 'plogin.m.jd.com'
|
||||
local jd_cookie = {}
|
||||
|
||||
--打印table
|
||||
function print_r(t)
|
||||
local print_r_cache = {}
|
||||
local function sub_print_r(t, indent)
|
||||
if (print_r_cache[tostring(t)]) then
|
||||
print(indent .. '*' .. tostring(t))
|
||||
else
|
||||
print_r_cache[tostring(t)] = true
|
||||
if (type(t) == 'table') then
|
||||
for pos, val in pairs(t) do
|
||||
if (type(val) == 'table') then
|
||||
print(indent .. '[' .. pos .. '] => ' .. tostring(t) .. ' {')
|
||||
sub_print_r(val, indent .. string.rep(' ', string.len(pos) + 8))
|
||||
print(indent .. string.rep(' ', string.len(pos) + 6) .. '}')
|
||||
elseif (type(val) == 'string') then
|
||||
print(indent .. '[' .. pos .. '] => "' .. val .. '"')
|
||||
else
|
||||
print(indent .. '[' .. pos .. '] => ' .. tostring(val))
|
||||
end
|
||||
end
|
||||
else
|
||||
print(indent .. tostring(t))
|
||||
end
|
||||
end
|
||||
end
|
||||
if (type(t) == 'table') then
|
||||
print(tostring(t) .. ' {')
|
||||
sub_print_r(t, ' ')
|
||||
print('}')
|
||||
else
|
||||
sub_print_r(t, ' ')
|
||||
end
|
||||
print()
|
||||
end
|
||||
|
||||
-- 分割字符串
|
||||
local function split(full, sep)
|
||||
full = full:gsub('%z', '') -- 这里不是很清楚 有时候结尾带个\0
|
||||
local off, result = 1, {}
|
||||
while true do
|
||||
local nStart, nEnd = full:find(sep, off)
|
||||
if not nEnd then
|
||||
local res = ssub(full, off, slen(full))
|
||||
if #res > 0 then -- 过滤掉 \0
|
||||
tinsert(result, res)
|
||||
end
|
||||
break
|
||||
else
|
||||
tinsert(result, ssub(full, off, nStart - 1))
|
||||
off = nEnd + 1
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--获取unix时间戳
|
||||
function jd_cookie.timestamp()
|
||||
return math.floor(socket.gettime() * 1000)
|
||||
end
|
||||
|
||||
--延时函数
|
||||
function sleep(n)
|
||||
os.execute('sleep ' .. n)
|
||||
end
|
||||
|
||||
--解析cookie
|
||||
function praseSetCookies(rcookie)
|
||||
local tbl = {}
|
||||
for k, v in rcookie:gmatch('([^;%s]+)=([^;]+)') do
|
||||
tbl[k] = v
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
--获取二维码链接和检测URL
|
||||
function jd_cookie.get_qrcode()
|
||||
local timeStamp = jd_cookie.timestamp()
|
||||
local url =
|
||||
'https://plogin.m.jd.com/cgi-bin/mm/new_login_entrance?lang=chs&appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' ..
|
||||
timeStamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport'
|
||||
local xformHeaders = {
|
||||
['Content-Type'] = 'application/x-www-form-urlencoded',
|
||||
['Connection'] = 'Keep-Alive',
|
||||
['Accept'] = 'application/json, text/plain, */*',
|
||||
['Accept-Language'] = 'zh-cn',
|
||||
['Referer'] = 'https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' ..
|
||||
timeStamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport',
|
||||
['User-Agent'] = User_Agent,
|
||||
['Host'] = Host
|
||||
}
|
||||
local response = requests.get {url, headers = xformHeaders}
|
||||
local s_token = response.json().s_token
|
||||
local dat = split(string.gsub(response.headers['set-cookie'], ' DOMAIN=.plogin.m.jd.com', ''), ';')
|
||||
local cookies = string.gsub(dat[1] .. dat[4] .. dat[6] .. dat[8], ',', ';') .. ';'
|
||||
|
||||
local timeStamp = jd_cookie.timestamp()
|
||||
local url = 'https://plogin.m.jd.com/cgi-bin/m/tmauthreflogurl?s_token=' .. s_token .. '&v=' .. timeStamp .. '&remember=true'
|
||||
local xformHeaders = {
|
||||
['Content-Type'] = 'application/x-www-form-urlencoded',
|
||||
['Connection'] = 'Keep-Alive',
|
||||
['Accept'] = 'application/json, text/plain, */*',
|
||||
['Accept-Language'] = 'zh-cn',
|
||||
['Referer'] = 'https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wq.jd.com/passport/LoginRedirect?state=' ..
|
||||
timeStamp .. '&returnurl=https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action&source=wq_passport',
|
||||
['User-Agent'] = User_Agent,
|
||||
['Host'] = Host
|
||||
}
|
||||
local response = requests.post {url, cookies = cookies, headers = xformHeaders}
|
||||
local json_body, error = response.json()
|
||||
local token = json_body['token']
|
||||
local ou_state = json_body['ou_state']
|
||||
local okl_token = praseSetCookies(response.headers['set-cookie']).okl_token
|
||||
local return_json = {
|
||||
qrcode_url = 'https://plogin.m.jd.com/cgi-bin/m/tmauth?appid=300&client_type=m&token=' .. token,
|
||||
check_url = 'https://plogin.m.jd.com/cgi-bin/m/tmauthchecktoken?&token=' .. token .. '&ou_state=' .. ou_state .. '&okl_token=' .. okl_token,
|
||||
cookies = cookies
|
||||
}
|
||||
return return_json
|
||||
end
|
||||
|
||||
--检测扫码状态 并返回cookie
|
||||
function jd_cookie.checkLogin(url, cookies)
|
||||
local xformHeaders = {
|
||||
['Content-Type'] = 'application/x-www-form-urlencoded',
|
||||
['Connection'] = 'Keep-Alive',
|
||||
['Accept'] = 'application/json, text/plain, */*',
|
||||
['Accept-Language'] = 'zh-cn',
|
||||
['Referer'] = 'https://plogin.m.jd.com/login/login?appid=300&returnurl=https://wqlogin2.jd.com/passport/LoginRedirect?state=',
|
||||
['User-Agent'] = User_Agent,
|
||||
['Host'] = Host
|
||||
}
|
||||
local data =
|
||||
'lang=chs&appid=300&source=wq_passport&returnurl=https://wqlogin2.jd.com/passport/LoginRedirect?state=1100399130787&returnurl=//home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&/myJd/home.action'
|
||||
local response = requests.post {url, data = data, cookies = cookies, headers = xformHeaders}
|
||||
--local cookie = jd_cookie.praseSetCookies(response.headers['set-cookie'])
|
||||
local json = response.json()
|
||||
local return_json = {}
|
||||
if json.errcode == 0 then
|
||||
local ucookie = praseSetCookies(response.headers['set-cookie'])
|
||||
return_json = {
|
||||
error = 0,
|
||||
cookie = ucookie
|
||||
}
|
||||
else
|
||||
return_json = {
|
||||
error = json.errcode,
|
||||
msg = json.message
|
||||
}
|
||||
end
|
||||
|
||||
return return_json
|
||||
end
|
||||
|
||||
return jd_cookie
|
||||
@ -12,7 +12,7 @@
|
||||
NAME=jd-dailybonus
|
||||
TEMP_SCRIPT=/tmp/JD_DailyBonus.js
|
||||
JD_SCRIPT=/usr/share/jd-dailybonus/JD_DailyBonus.js
|
||||
LOG_HTM=/www/JD_DailyBonus.htm
|
||||
LOG_FILE=/var/log/jd_dailybonus.log
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
@ -60,13 +60,13 @@ add_cron() {
|
||||
# Run Script
|
||||
|
||||
notify() {
|
||||
grep "Cookie失效" /www/JD_DailyBonus.htm >/dev/null
|
||||
grep "Cookie失效" ${LOG_FILE} >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
title="$(date '+%Y年%m月%d日') 京东签到 Cookie 失效"
|
||||
else
|
||||
title="$(date '+%Y年%m月%d日') 京东签到"
|
||||
fi
|
||||
desc=$(cat /www/JD_DailyBonus.htm | grep -E '签到号|签到概览|签到奖励|其他奖励|账号总计|其他总计' | sed 's/$/&\n/g')
|
||||
desc=$(cat ${LOG_FILE} | grep -E '签到号|签到概览|签到奖励|其他奖励|账号总计|其他总计' | sed 's/$/&\n/g')
|
||||
#serverchan
|
||||
sckey=$(uci_get_by_type global serverchan)
|
||||
if [ ! -z $sckey ]; then
|
||||
@ -95,12 +95,13 @@ notify() {
|
||||
}
|
||||
|
||||
run() {
|
||||
echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_HTM 2>/dev/null
|
||||
[ ! -f "/usr/bin/node" ] && echo -e "未安装node.js,请安装后再试!\nNode.js is not installed, please try again after installation!" >>$LOG_HTM && exit 1
|
||||
node $JD_SCRIPT >>$LOG_HTM 2>/dev/null && notify &
|
||||
echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_FILE 2>/dev/null
|
||||
[ ! -f "/usr/bin/node" ] && echo -e "未安装node.js,请安装后再试!\nNode.js is not installed, please try again after installation!" >>$LOG_FILE && exit 1
|
||||
(cd /usr/share/jd-dailybonus/ && node $JD_SCRIPT >>$LOG_FILE 2>/dev/null && notify &)
|
||||
}
|
||||
|
||||
save() {
|
||||
lua /usr/share/jd-dailybonus/gen_cookieset.lua
|
||||
add_cron
|
||||
}
|
||||
|
||||
|
||||
@ -1,303 +0,0 @@
|
||||
-- Lua Requests library for http ease
|
||||
|
||||
local http_socket = require('socket.http')
|
||||
local https_socket = require('ssl.https')
|
||||
local url_parser = require('socket.url')
|
||||
local ltn12 = require('ltn12')
|
||||
local json = require('cjson.safe')
|
||||
local md5sum = require('md5') -- TODO: Make modular?
|
||||
local mime = require('mime')
|
||||
|
||||
local requests = {
|
||||
_DESCRIPTION = 'Http requests made simpler',
|
||||
http_socket = http_socket,
|
||||
https_socket = https_socket
|
||||
}
|
||||
|
||||
local _requests = {}
|
||||
|
||||
--User facing function the make a request use Digest Authentication
|
||||
--TODO: Determine what else should live in authentication
|
||||
function requests.HTTPDigestAuth(user, password)
|
||||
return { _type = 'digest', user = user, password = password}
|
||||
end
|
||||
|
||||
--User facing function the make a request use Basic Authentication
|
||||
--TODO: Determine what else should live in authentication
|
||||
function requests.HTTPBasicAuth(user, password)
|
||||
return { _type = 'basic', user = user, password = password}
|
||||
end
|
||||
|
||||
function requests.post(url, args)
|
||||
return requests.request("POST", url, args)
|
||||
end
|
||||
|
||||
function requests.get(url, args)
|
||||
return requests.request("GET", url, args)
|
||||
end
|
||||
|
||||
function requests.delete(url, args)
|
||||
return requests.request("DELETE", url, args)
|
||||
end
|
||||
|
||||
function requests.patch(url, args)
|
||||
return requests.request("PATCH", url, args)
|
||||
end
|
||||
|
||||
function requests.put(url, args)
|
||||
return requests.request("PUT", url, args)
|
||||
end
|
||||
|
||||
function requests.options(url, args)
|
||||
return requests.request("OPTIONS", url, args)
|
||||
end
|
||||
|
||||
function requests.head(url, args)
|
||||
return requests.request("HEAD", url, args)
|
||||
end
|
||||
|
||||
function requests.trace(url, args)
|
||||
return requests.request("TRACE", url, args)
|
||||
end
|
||||
|
||||
--Sets up all the data for a request and makes the request
|
||||
function requests.request(method, url, args)
|
||||
local request
|
||||
|
||||
if type(url) == "table" then
|
||||
request = url
|
||||
if not request.url and request[1] then
|
||||
request.url = table.remove(request, 1)
|
||||
end
|
||||
else
|
||||
request = args or {}
|
||||
request.url = url
|
||||
end
|
||||
|
||||
request.method = method
|
||||
_requests.parse_args(request)
|
||||
|
||||
-- TODO: Find a better way to do this
|
||||
if request.auth and request.auth._type == 'digest' then
|
||||
local response = _requests.make_request(request)
|
||||
return _requests.use_digest(response, request)
|
||||
else
|
||||
return _requests.make_request(request)
|
||||
end
|
||||
end
|
||||
|
||||
--Makes a request
|
||||
function _requests.make_request(request)
|
||||
local response_body = {}
|
||||
local full_request = {
|
||||
method = request.method,
|
||||
url = request.url,
|
||||
headers = request.headers,
|
||||
sink = ltn12.sink.table(response_body),
|
||||
redirect = request.allow_redirects,
|
||||
proxy = request.proxy
|
||||
}
|
||||
if request.data then
|
||||
full_request.source = ltn12.source.string(request.data)
|
||||
end
|
||||
|
||||
local response = {}
|
||||
local ok
|
||||
local socket = string.find(full_request.url, '^https:') and not request.proxy and https_socket or http_socket
|
||||
|
||||
ok, response.status_code, response.headers, response.status = socket.request(full_request)
|
||||
|
||||
assert(ok, 'error in '..request.method..' request: '..response.status_code)
|
||||
response.text = table.concat(response_body)
|
||||
response.json = function () return json.decode(response.text) end
|
||||
|
||||
return response
|
||||
end
|
||||
|
||||
--Parses through all the possible arguments for a request
|
||||
function _requests.parse_args(request)
|
||||
_requests.check_url(request)
|
||||
_requests.check_data(request)
|
||||
_requests.create_header(request)
|
||||
_requests.check_timeout(request.timeout)
|
||||
_requests.check_redirect(request.allow_redirects)
|
||||
end
|
||||
|
||||
--Format the the url based on the params argument
|
||||
function _requests.format_params(url, params) -- TODO: Clean
|
||||
if not params or next(params) == nil then return url end
|
||||
|
||||
url = url..'?'
|
||||
for key, value in pairs(params) do
|
||||
if tostring(value) then
|
||||
url = url..tostring(key)..'='
|
||||
|
||||
if type(value) == 'table' then
|
||||
local val_string = ''
|
||||
|
||||
for _, val in ipairs(value) do
|
||||
val_string = val_string..tostring(val)..','
|
||||
end
|
||||
|
||||
url = url..val_string:sub(0, -2)
|
||||
else
|
||||
url = url..tostring(value)
|
||||
end
|
||||
|
||||
url = url..'&'
|
||||
end
|
||||
end
|
||||
|
||||
return url:sub(0, -2)
|
||||
end
|
||||
|
||||
--Check that there is a URL given and append to it if params are passed in.
|
||||
function _requests.check_url(request)
|
||||
assert(request.url, 'No url specified for request')
|
||||
request.url = _requests.format_params(request.url, request.params)
|
||||
end
|
||||
|
||||
-- Add to the HTTP header
|
||||
function _requests.create_header(request)
|
||||
request.headers = request.headers or {}
|
||||
if request.data then
|
||||
request.headers['Content-Length'] = request.data:len()
|
||||
end
|
||||
|
||||
if request.cookies then
|
||||
if request.headers.cookie then
|
||||
request.headers.cookie = request.headers.cookie..'; '..request.cookies
|
||||
else
|
||||
request.headers.cookie = request.cookies
|
||||
end
|
||||
end
|
||||
|
||||
if request.auth then
|
||||
_requests.add_auth_headers(request)
|
||||
end
|
||||
end
|
||||
|
||||
--Makes sure that the data is in a format that can be sent
|
||||
function _requests.check_data(request)
|
||||
if type(request.data) == "table" then
|
||||
request.data = json.encode(request.data)
|
||||
elseif request.data then
|
||||
request.data = tostring(request.data)
|
||||
end
|
||||
end
|
||||
|
||||
--Set the timeout
|
||||
function _requests.check_timeout(timeout)
|
||||
http_socket.TIMEOUT = timeout or 5
|
||||
https_socket.TIMEOUT = timeout or 5
|
||||
end
|
||||
|
||||
--Checks is allow_redirects parameter is set correctly
|
||||
function _requests.check_redirect(allow_redirects)
|
||||
if allow_redirects and type(allow_redirects) ~= "boolean" then
|
||||
error("allow_redirects expects a boolean value. received type = "..type(allow_redirects))
|
||||
end
|
||||
end
|
||||
|
||||
--Create the Authorization header for Basic Auth
|
||||
function _requests.basic_auth_header(request)
|
||||
local encoded = mime.b64(request.auth.user..':'..request.auth.password)
|
||||
request.headers.Authorization = 'Basic '..encoded
|
||||
end
|
||||
|
||||
-- Create digest authorization string for request header TODO: Could be better, but it should work
|
||||
function _requests.digest_create_header_string(auth)
|
||||
local authorization = 'Digest username="'..auth.user..'", realm="'..auth.realm..'", nonce="'..auth.nonce
|
||||
authorization = authorization..'", uri="'..auth.uri..'", qop='..auth.qop..', nc='..auth.nc
|
||||
authorization = authorization..', cnonce="'..auth.cnonce..'", response="'..auth.response..'"'
|
||||
|
||||
if auth.opaque then
|
||||
authorization = authorization..', opaque="'..auth.opaque..'"'
|
||||
end
|
||||
|
||||
return authorization
|
||||
end
|
||||
|
||||
--MD5 hash all parameters
|
||||
local function md5_hash(...)
|
||||
return md5sum.sumhexa(table.concat({...}, ":"))
|
||||
end
|
||||
|
||||
-- Creates response hash TODO: Add functionality
|
||||
function _requests.digest_hash_response(auth_table)
|
||||
return md5_hash(
|
||||
md5_hash(auth_table.user, auth_table.realm, auth_table.password),
|
||||
auth_table.nonce,
|
||||
auth_table.nc,
|
||||
auth_table.cnonce,
|
||||
auth_table.qop,
|
||||
md5_hash(auth_table.method, auth_table.uri)
|
||||
)
|
||||
end
|
||||
|
||||
-- Add digest authentication to the request header
|
||||
function _requests.digest_auth_header(request)
|
||||
if not request.auth.nonce then return end
|
||||
|
||||
request.auth.cnonce = request.auth.cnonce or string.format("%08x", os.time())
|
||||
|
||||
request.auth.nc_count = request.auth.nc_count or 0
|
||||
request.auth.nc_count = request.auth.nc_count + 1
|
||||
|
||||
request.auth.nc = string.format("%08x", request.auth.nc_count)
|
||||
|
||||
local url = url_parser.parse(request.url)
|
||||
request.auth.uri = url_parser.build{path = url.path, query = url.query}
|
||||
request.auth.method = request.method
|
||||
request.auth.qop = 'auth'
|
||||
|
||||
request.auth.response = _requests.digest_hash_response(request.auth)
|
||||
|
||||
request.headers.Authorization = _requests.digest_create_header_string(request.auth)
|
||||
end
|
||||
|
||||
--Checks the resonse code and adds additional headers for Digest Auth
|
||||
-- TODO: Rename this
|
||||
function _requests.use_digest(response, request)
|
||||
if response.status_code == 401 then
|
||||
_requests.parse_digest_response_header(response,request)
|
||||
_requests.create_header(request)
|
||||
response = _requests.make_request(request)
|
||||
response.auth = request.auth
|
||||
response.cookies = request.headers.cookie
|
||||
return response
|
||||
else
|
||||
response.auth = request.auth
|
||||
response.cookies = request.headers.cookie
|
||||
return response
|
||||
end
|
||||
end
|
||||
|
||||
--Parse the first response from the host to make the Authorization header
|
||||
function _requests.parse_digest_response_header(response, request)
|
||||
for key, value in response.headers['www-authenticate']:gmatch('(%w+)="(%S+)"') do
|
||||
request.auth[key] = value
|
||||
end
|
||||
|
||||
if request.headers.cookie then
|
||||
request.headers.cookie = request.headers.cookie..'; '..response.headers['set-cookie']
|
||||
else
|
||||
request.headers.cookie = response.headers['set-cookie']
|
||||
end
|
||||
|
||||
request.auth.nc_count = 0
|
||||
end
|
||||
|
||||
-- Call the correct authentication header function
|
||||
function _requests.add_auth_headers(request)
|
||||
local auth_func = {
|
||||
basic = _requests.basic_auth_header,
|
||||
digest = _requests.digest_auth_header
|
||||
}
|
||||
|
||||
auth_func[request.auth._type](request)
|
||||
end
|
||||
|
||||
--Return public functions
|
||||
requests._private = _requests
|
||||
return requests
|
||||
@ -1200,15 +1200,16 @@ firewall_redirect_exclude()
|
||||
|
||||
set_firewall()
|
||||
{
|
||||
|
||||
if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(iptables -t nat -nL PREROUTING --line-number |grep "redir ports 53$")"]; then
|
||||
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53
|
||||
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53
|
||||
|
||||
DNSPORT="$(uci get dhcp.@dnsmasq[0].port 2>/dev/null || echo 53)"
|
||||
if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(iptables -t nat -nL PREROUTING --line-number |grep 'dns_hijack')"]; then
|
||||
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment dns_hijack
|
||||
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment dns_hijack
|
||||
fi
|
||||
|
||||
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "redir ports 53" |wc -l)" -gt 2 ] && [ "$enable_redirect_dns" -eq 1 ]; then
|
||||
if [ "$(iptables -t nat -nL PREROUTING --line-number | grep "redir port $DNSPORT" | wc -l)" -gt 2 ] && [ "$enable_redirect_dns" -eq 1 ]; then
|
||||
echo "发现53端口被劫持,清理防火墙规则..." >$START_LOG
|
||||
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/redir ports 53/=' 2>/dev/null |sort -rn)
|
||||
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d | sed -n "/redir port $DNSPORT/=" 2>/dev/null |sort -rn)
|
||||
for pre_line in $pre_lines; do
|
||||
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
|
||||
done
|
||||
@ -1521,6 +1522,11 @@ revert_firewall()
|
||||
done >/dev/null 2>&1
|
||||
iptables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1
|
||||
|
||||
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/dns_hijack/=' 2>/dev/null |sort -rn)
|
||||
for pre_line in $pre_lines; do
|
||||
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
|
||||
done >/dev/null 2>&1
|
||||
|
||||
#ipv6
|
||||
#ip6tables -t mangle -F openclash >/dev/null 2>&1
|
||||
#ip6tables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=oaf
|
||||
PKG_VERSION:=3.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/destan19/OpenAppFilter.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2020-12-31
|
||||
PKG_SOURCE_VERSION:=5ac03f15728ad69805123637227a7777f0a50c7e
|
||||
PKG_MIRROR_HASH:=d8d71c8dcdd6e130d2e1b4cddf37781fb95c5d1b8e7090fe49c0e761490be324
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
RSTRIP:=:
|
||||
|
||||
define KernelPackage/oaf
|
||||
SECTION:=Kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Netfilter Extensions
|
||||
TITLE:=open app filter kernel module
|
||||
FILES:=$(PKG_BUILD_DIR)/oaf.ko
|
||||
DEPENDS:=+kmod-ipt-conntrack
|
||||
KCONFIG:=
|
||||
endef
|
||||
|
||||
define KernelPackage/oaf/description
|
||||
open appfilter kernel module
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
tar xJf $(DL_DIR)/$(PKG_SOURCE) -C $(TMP_DIR)
|
||||
$(CP) $(TMP_DIR)/$(PKG_NAME)-$(PKG_VERSION)/oaf/src/* $(PKG_BUILD_DIR)
|
||||
rm -rf $(TMP_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
endef
|
||||
|
||||
MAKE_OPTS:= \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
$(EXTRA_KCONFIG)
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(MAKE_OPTS) \
|
||||
modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,oaf))
|
||||
79
package/ctcgfw/open-app-filter/Makefile
Executable file → Normal file
79
package/ctcgfw/open-app-filter/Makefile
Executable file → Normal file
@ -1,49 +1,74 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=appfilter
|
||||
PKG_NAME:=open-app-filter
|
||||
PKG_VERSION:=3.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/destan19/OpenAppFilter.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-01-26
|
||||
PKG_SOURCE_VERSION:=95c95d366140f50166dbe7517d87787d05a6df1c
|
||||
PKG_MIRROR_HASH:=c54ac1ed8947e44c73af0501d1c05901745dfedb4feb73ed80aa9a8ba1e4b70e
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
#include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
RSTRIP:=:
|
||||
|
||||
define KernelPackage/oaf
|
||||
SECTION:=Kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Netfilter Extensions
|
||||
TITLE:=open app filter kernel module
|
||||
FILES:=$(PKG_BUILD_DIR)/oaf.ko
|
||||
DEPENDS:=+kmod-ipt-conntrack
|
||||
AUTOLOAD:=$(call AutoLoad,0,oaf)
|
||||
endef
|
||||
|
||||
define KernelPackage/oaf/description
|
||||
open appfilter kernel module
|
||||
endef
|
||||
|
||||
define Package/appfilter
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libubox-lua
|
||||
TITLE:=App filter userspace module
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libubox-lua +kmod-oaf
|
||||
TITLE:=App filter userspace module
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
MAKE_OPTS:= \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
$(EXTRA_KCONFIG)
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/oaf/src/* $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(MAKE_OPTS) \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Package/appfilter/description
|
||||
open appfilter app
|
||||
define Package/appfilter/conffiles
|
||||
/etc/config/appfilter
|
||||
endef
|
||||
|
||||
|
||||
define Package/appfilter/install
|
||||
echo "install"
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/open-app-filter/files/appfilter.sh $(1)/usr/bin/appfilter.sh
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/open-app-filter/files/gen_class.sh $(1)/usr/bin/gen_class.sh
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/open-app-filter/files/appfilter.lua $(1)/usr/bin/appfilter
|
||||
$(INSTALL_DIR) $(1)/etc/appfilter
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/open-app-filter/files/feature.cfg $(1)/etc/appfilter/feature.cfg
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(CP) ./files/feature.cfg $(1)/etc/appfilter/
|
||||
$(INSTALL_BIN) ./files/appfilter.init $(1)/etc/init.d/appfilter
|
||||
$(INSTALL_BIN) ./files/appfilter.sh $(1)/usr/bin
|
||||
$(INSTALL_BIN) ./files/gen_class.sh $(1)/usr/bin
|
||||
$(INSTALL_BIN) ./files/appfilter.lua $(1)/usr/bin/appfilter
|
||||
$(INSTALL_BIN) ./files/appfilter.config $(1)/etc/config/appfilter
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/open-app-filter/files/appfilter.config $(1)/etc/config/appfilter
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/open-app-filter/files/appfilter.init $(1)/etc/init.d/appfilter
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call KernelPackage,oaf))
|
||||
$(eval $(call BuildPackage,appfilter))
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
config global global
|
||||
|
||||
config appfilter appfilter
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
start() {
|
||||
lsmod | grep -q oaf 2>/dev/null || modprobe oaf
|
||||
gen_class.sh /etc/appfilter/feature.cfg
|
||||
appfilter.sh
|
||||
/usr/bin/appfilter &
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "stop appfilter"
|
||||
rmmod oaf >/dev/null 2>&1
|
||||
}
|
||||
@ -1,262 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local libubus = require "ubus"
|
||||
local uloop = require "uloop"
|
||||
|
||||
local UBUS_STATUS_OK = 0
|
||||
local UBUS_STATUS_INVALID_COMMAND = 1
|
||||
local UBUS_STATUS_INVALID_ARGUMENT = 2
|
||||
local UBUS_STATUS_METHOD_NOT_FOUND = 3
|
||||
local UBUS_STATUS_NOT_FOUND = 4
|
||||
local UBUS_STATUS_NO_DATA = 5
|
||||
local UBUS_STATUS_PERMISSION_DENIED = 6
|
||||
local UBUS_STATUS_TIMEOUT = 7
|
||||
local UBUS_STATUS_NOT_SUPPORTED = 8
|
||||
local UBUS_STATUS_UNKNOWN_ERROR = 9
|
||||
local UBUS_STATUS_CONNECTION_FAILED = 10
|
||||
local UBUS_STATUS_ALREADY_EXISTS = 11
|
||||
|
||||
local cfg_file = "/etc/appfilter/feature.cfg"
|
||||
|
||||
local cfg = {}
|
||||
local class = {}
|
||||
local ubus
|
||||
|
||||
cfg.__index = cfg
|
||||
class.__index = class
|
||||
function cfg:init(file)
|
||||
local f = io.open(file, "r")
|
||||
local t = {}
|
||||
local t2 = {}
|
||||
if f then
|
||||
for line in f:lines() do
|
||||
table.insert(t, line)
|
||||
local tt = line:match("#class (%S+)")
|
||||
if tt then
|
||||
table.insert(t2, tt)
|
||||
end
|
||||
end
|
||||
setmetatable(t, self)
|
||||
setmetatable(t2, self)
|
||||
return t,t2
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function cfg:lookup(o)
|
||||
if not o then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local tab = self
|
||||
for _, v in ipairs(tab) do
|
||||
if v:match(o) then
|
||||
if v:match("#class") then
|
||||
local tt = {}
|
||||
local t2 = {}
|
||||
local found
|
||||
for _, t in ipairs(tab) do
|
||||
repeat
|
||||
if t:match(o) then
|
||||
found = true
|
||||
table.insert(tt, t)
|
||||
break
|
||||
end
|
||||
|
||||
if t:match("#class") then
|
||||
found = false
|
||||
table.insert(t2, t)
|
||||
break
|
||||
end
|
||||
|
||||
if found then
|
||||
table.insert(tt, t)
|
||||
else
|
||||
table.insert(t2, t)
|
||||
end
|
||||
until true
|
||||
end
|
||||
setmetatable(tt, self)
|
||||
setmetatable(t2, self)
|
||||
return tt, t2
|
||||
else
|
||||
return v
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function cfg:lookup_class(m)
|
||||
if not m then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local t1, t2 = self:lookup(m)
|
||||
if type(t1) ~= "table" then return nil end
|
||||
return t1, t2
|
||||
end
|
||||
|
||||
function cfg:add_class(m)
|
||||
if not m then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local f = io.open(cfg_file, "r+")
|
||||
local tab = self
|
||||
if f then
|
||||
io.output(f)
|
||||
for _, v in ipairs(tab) do
|
||||
io.write(v)
|
||||
io.write("\n")
|
||||
end
|
||||
io.write("#class "..m)
|
||||
f:flush()
|
||||
f:close()
|
||||
return UBUS_STATUS_OK
|
||||
else
|
||||
return UBUS_STATUS_NOT_FOUND
|
||||
end
|
||||
end
|
||||
|
||||
function cfg:add_app(m, name, proto, sport, dport, url, request, dict)
|
||||
if not name then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local id
|
||||
local offset
|
||||
local f = io.open(cfg_file, "r+")
|
||||
io.output(f)
|
||||
local t1,t2 = self:lookup_class(m)
|
||||
if t1[#t1] == nil or "" then
|
||||
offset = 0
|
||||
id = math.modf(string.match(t1[#t1-1], "(%d+) %S+:") +1)
|
||||
else
|
||||
offset = 1
|
||||
id = math.modf(string.match(t1[#t1], "(%d+) %S+:") +1)
|
||||
end
|
||||
|
||||
local str = string.format("%d %s:[%s;%s;%s;%s;%s;%s]", id, name, proto, sport or "", dport or "", url or "", request or "", dict or "")
|
||||
table.insert(t1, #t1+offset, str)
|
||||
if f then
|
||||
for _, v in ipairs(t2) do
|
||||
if v then
|
||||
io.write(v)
|
||||
io.write("\n")
|
||||
end
|
||||
end
|
||||
for _, v in ipairs(t1) do
|
||||
if v then
|
||||
io.write(v)
|
||||
io.write("\n")
|
||||
end
|
||||
end
|
||||
f:flush()
|
||||
f:close()
|
||||
end
|
||||
return id
|
||||
end
|
||||
|
||||
function cfg:del_app(id, name)
|
||||
local t = self
|
||||
local f = io.open(cfg_file, "r+")
|
||||
local ret
|
||||
if id then
|
||||
for i, v in ipairs(t) do
|
||||
if v:match(id) then
|
||||
table.remove(t, i)
|
||||
ret = i
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if name then
|
||||
for i, v in ipairs(t) do
|
||||
if v:match(name) then
|
||||
table.remove(t, i)
|
||||
ret = i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if f then
|
||||
io.output(f)
|
||||
for _, v in ipairs(t) do
|
||||
io.write(v)
|
||||
io.write("\n")
|
||||
end
|
||||
f:flush()
|
||||
f:close()
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
local methods = {
|
||||
["appfilter"] = {
|
||||
add_class = {
|
||||
function(req, msg)
|
||||
if not msg.class then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local t = cfg:init(cfg_file)
|
||||
local ret
|
||||
if t:lookup_class(msg.class) then return ubus.reply(req, {ret = UBUS_STATUS_ALREADY_EXISTS}) end
|
||||
ret = t:add_class(msg.class)
|
||||
ubus.reply(req, {msg = ret})
|
||||
end, {class = libubus.STRING}
|
||||
},
|
||||
add_app = {
|
||||
function (req, msg)
|
||||
if not msg.class then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
if not msg.name then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
if not msg.proto then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local t = cfg:init(cfg_file)
|
||||
local ret
|
||||
if t:lookup(msg.name) then return ubus.reply(req, {ret = UBUS_STATUS_ALREADY_EXISTS}) end
|
||||
ret = t:add_app(msg.class, msg.name, msg.proto, msg.sport, msg.dport, msg.url, msg.request, msg.dict)
|
||||
ubus.reply(req, {ret = ret})
|
||||
end,{class = libubus.STRING, name = libubus.STRING, proto = libubus.STRING, sport = libubus.INT32, dport = libubus.INT32, url = libubus.STRING, request = libubus.STRING, dict = libubus.STRING}
|
||||
},
|
||||
del_app = {
|
||||
function(req, msg)
|
||||
local t = cfg:init(cfg_file)
|
||||
local ret = t:del_app(msg.id, msg.name)
|
||||
ubus.reply(req, {ret = ret})
|
||||
end,{id = libubus.INT32, name = libubus.STRING}
|
||||
},
|
||||
list_class = {
|
||||
function (req, msg)
|
||||
local _, c = cfg:init(cfg_file)
|
||||
ubus.reply(req, {result = c})
|
||||
end,{}
|
||||
},
|
||||
list_app = {
|
||||
function (req, msg)
|
||||
if not msg.class then return UBUS_STATUS_INVALID_ARGUMENT end
|
||||
local t = cfg:init(cfg_file)
|
||||
local ret = {}
|
||||
for i, v in ipairs(t:lookup_class(msg.class)) do
|
||||
if not v:match("#class") then
|
||||
local id, name = v:match("(%d+) (%S+):%[")
|
||||
ret[i-1] = {id = id, name = name}
|
||||
end
|
||||
end
|
||||
ubus.reply(req, {result = ret})
|
||||
end,{class = libubus.STRING}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ubus_init()
|
||||
local conn = libubus.connect()
|
||||
if not conn then
|
||||
error("Failed to connect to ubus")
|
||||
end
|
||||
|
||||
conn:add(methods)
|
||||
|
||||
return {
|
||||
call = function(object, method, params)
|
||||
return conn:call(object, method, params or {})
|
||||
end,
|
||||
reply = function(req, msg)
|
||||
conn:reply(req, msg)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
local function main()
|
||||
uloop.init()
|
||||
ubus = ubus_init()
|
||||
uloop.run()
|
||||
end
|
||||
|
||||
main()
|
||||
@ -1,88 +0,0 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
config_apply()
|
||||
{
|
||||
test -z "$1" && return 1
|
||||
|
||||
if [ -e "/dev/appfilter" ];then
|
||||
echo "config json str=$1"
|
||||
echo "$1" >/dev/appfilter
|
||||
fi
|
||||
}
|
||||
|
||||
clean_rule()
|
||||
{
|
||||
json_init
|
||||
echo "clean appfilter rule..."
|
||||
|
||||
json_add_int "op" 3
|
||||
json_add_object "data"
|
||||
json_str=`json_dump`
|
||||
|
||||
config_apply "$json_str"
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
load_rule()
|
||||
{
|
||||
json_init
|
||||
|
||||
config_load appfilter
|
||||
config_get enable "global" enable
|
||||
echo "enable = $enable"
|
||||
if [ x"$enable" != x"1" ];then
|
||||
echo "appfilter is disabled"
|
||||
echo 0 >/proc/sys/oaf/enable>/dev/null
|
||||
return 0
|
||||
else
|
||||
insmod oaf >/dev/null
|
||||
echo 1 >/proc/sys/oaf/enable
|
||||
fi
|
||||
echo "appfilter is enabled"
|
||||
json_add_int "op" 1
|
||||
|
||||
json_add_object "data"
|
||||
json_add_array "apps"
|
||||
|
||||
for file in `ls /tmp/appfilter/*.class`
|
||||
do
|
||||
class_name=`echo "$file" | awk -F/ '{print $4}'| awk -F. '{print $1}'`
|
||||
config_get appid_list "appfilter" "${class_name}apps"
|
||||
echo "appid_list=$appid_list"
|
||||
|
||||
if ! test -z "$appid_list";then
|
||||
for appid in $appid_list:
|
||||
do
|
||||
json_add_int "" $appid
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
json_str=`json_dump`
|
||||
config_apply "$json_str"
|
||||
json_cleanup
|
||||
}
|
||||
load_mac_list()
|
||||
{
|
||||
json_init
|
||||
config_load appfilter
|
||||
json_add_int "op" 4
|
||||
json_add_object "data"
|
||||
json_add_array "mac_list"
|
||||
config_get appid_list "user" "users"
|
||||
echo "appid list=$appid_list"
|
||||
for appid in $appid_list:
|
||||
do
|
||||
echo "appid=$appid"
|
||||
json_add_string "" $appid
|
||||
done
|
||||
json_str=`json_dump`
|
||||
config_apply "$json_str"
|
||||
echo "json str=$json_str"
|
||||
json_cleanup
|
||||
}
|
||||
clean_rule
|
||||
load_rule
|
||||
load_mac_list
|
||||
@ -1,175 +0,0 @@
|
||||
#id name:[proto;sport;dport;host url;request;dict]
|
||||
#class chat
|
||||
1001 QQ:[tcp;;;;;00:02|-1:03,tcp;;;;;02:02|-1:03,tcp;;14000;;;,tcp;;8080;;;00:ca|01:3c,tcp;;;;;00:00|01:00|02:00|03:15]
|
||||
1002 微信:[tcp;;;;;01:f1|02:03,tcp;;;;;00:ab|01:00|02:00,tcp;;80;;/mmtls;]
|
||||
1003 微博:[tcp;;443;weibo;;]
|
||||
1004 陌陌:[tcp;;;momo;;,tcp;;;;;04:2f|05:66|06:65|07:65,tcp;;;;;00:03|01:03|02:00]
|
||||
1005 支付宝:[tcp;;443;alipay.com;;]
|
||||
|
||||
#class game
|
||||
2001 王者荣耀:[tcp;;;;;00:33|01:66|02:00|03:09,udp;;;;;00:01|01:02|02:00|03:00]
|
||||
2002 和平精英:[tcp;;;;;00:43|1:66|02:aa,tcp;;;;;00:33|1:66|03:0a|05:0a|,tcp;;;;;00:01|1:00|02:00,udp;;;;;00:59|01:ad|03:45|05:e4,udp;;;;;00:b9|01:5d|03:39|05:77]
|
||||
2003 英雄联盟:[udp;;;;;44:00|45:00|46:00|47:02]
|
||||
2015 我的世界:[tcp;;443;g79mclobt.nie.netease;;]
|
||||
2004 荒野行动:[udp;;;;;00:05|01:09,tcp;;;;;00:02|01:00|02:00|03:00]
|
||||
2005 欢乐斗地主:[tcp;;8000;;;00:74|01:67|02:77|03:5f]
|
||||
2006 梦幻西游:[tcp;;;;;00:0e|01:00|02:fe|03:ff]
|
||||
2007 明日之后:[udp;;;;;00:05|01:09|02:00,tcp;;;;;00:02|01:00|02:00|03:00|04:00|05:00]
|
||||
2008 QQ飞车:[udp;;;;;00:28|01:28,tcp;;10000;;;00:33|01:66|02:00|03:08]
|
||||
2009 跑跑卡丁车:[tcp;;8888;;;00:33|01:66|02:00|03:08]
|
||||
2010 开心消消乐:[tcp;;80;happyelements;;]
|
||||
2011 狂野飙车:[tcp;;;asphalt9;;]
|
||||
2012 率土之滨:[tcp;;10001;;;00:00|01:00,tcp;;8001;;;00:00|01:00]
|
||||
2013 一刀传世:[tcp;;8040;;;00:47|01:45]
|
||||
2014 第五人格:[tcp;;4010;;;,tcp;;4010;;;,tcp;;4020;;;,tcp;;4030;;;,tcp;;4040;;;,tcp;;4050;;;,tcp;;4060;;;,tcp;;4070;;;,tcp;;4080;;;,tcp;;4090;;;]
|
||||
2016 皇室战争:[udp;;9339;;;]
|
||||
2017 炉石传说:[tcp;;3724;;;00:73:01:00:02:00]
|
||||
|
||||
#class video
|
||||
3001 抖音短视频:[tcp;;80;-dy-;;,tcp;;;-dy.;;]
|
||||
3002 火山小视频:[tcp;;;.huoshan.com;;,tcp;;;hs.pstatp.com;;,tcp;;;hs.ixigua.com;;]
|
||||
3003 腾讯视频:[tcp;;443;v.qq.com;;,tcp;;443;tc.qq.com;;,tcp;;443;video.qq.com;;,tcp;;443;btrace.qq.com;;]
|
||||
3004 爱奇艺:[tcp;;443;iqiyi.com;;,tcp;;443;iqiyi.com;;]
|
||||
3005 微视:[tcp;;80;;;00:34|01:16|02:75,tcp;;80;weishi.qq.com;;]
|
||||
3006 斗鱼直播:[tcp;;;douyu;;,tcp;;;douyu;;-2:2f|-1:00]
|
||||
3008 虎牙直播:[tcp;;;huya;;,udp;;;;;01:00|02:00|03:00|04:23,udp;;;;;01:00|02:00|03:00|04:24]
|
||||
3009 快手:[tcp;;;kuaishou;;,tcp;;;ksyuncdn.com;;,tcp;;;.gifshow.com;;,tcp;;;yximgs.com;;]
|
||||
3010 小红书:[tcp;;;xiaohongshu;;,tcp;;;xhscdn;;]
|
||||
3011 花椒直播:[tcp;;;huajiao;;]
|
||||
3012 映客直播:[tcp;;;;.inke.cn;]
|
||||
3013 YY:[udp;;;;;02:00|03:00|04:08,udp;;;;;00:4f|01:00|02:00]
|
||||
3014 哔哩哔哩:[tcp;;;bilivideo;;,tcp;;480;;upgcxcode;]
|
||||
3016 芒果tv:[tcp;;443;mgtv;;,tcp;;80;mgtv;;,tcp;;443;hitv;;]
|
||||
3017 西瓜视频:[tcp;;;xg.ixigua;;,tcp;;443;snsdk;;,tcp;;;xg-p.ixigua;;]
|
||||
3018 搜狐视频:[tcp;;;aty.sohu.com;;,tcp;;;tv.itc.cn;;]
|
||||
3019 播聊:[tcp;;80;randlove.cn;;,tcp;;;mob.com;;,tcp;;;yueliao;;,tcp;;;5glive;;]
|
||||
3020 咪咕视频:[tcp;;;miguvideo;;,tcp;;;migu.cn;;]
|
||||
3021 韩剧TV:[tcp;;;hanju.koudaibaobao;;]
|
||||
3022 人人视频:[tcp;;;rr.tv;;]
|
||||
|
||||
#class shopping
|
||||
4001 淘宝:[tcp;;;taobao;;,tcp;;;alicdn.com;;,tcp;;;tmall.com;;,tcp;;;;;00:d3|01:00,,tcp;;;;;00:d4|01:00,,tcp;;;;;00:d3|01:00]
|
||||
4002 京东:[tcp;;;360buyimg;;,tcp;;;jd.com;;,tcp;;;jdcdn.com;;,tcp;;;;;00:d5|01:00]
|
||||
4003 唯品会:[tcp;;;vips-mobile;;,tcp;;;vipshop;;,tcp;;;vip.com;;,tcp;;;vipstatic.com;;,tcp;;;appsimg.com;;]
|
||||
4004 拼多多:[tcp;;;pinduoduo;;,tcp;;;yangkeduo.com;;,tcp;;;s1p.cdntip.com;;]
|
||||
4005 蘑菇街:[tcp;;;mogujie;;,tcp;;;mogucdn;;,tcp;;;;;00:73|01:ea|02:68|03:fb|04:3f]
|
||||
4006 苏宁易购:[tcp;;;.suning.;;]
|
||||
4007 当当网:[tcp;;;.dangdang.com;;]
|
||||
4008 1号店:[tcp;;;.yhd.com;;]
|
||||
|
||||
|
||||
#class music
|
||||
5001 网易云音乐:[tcp;;;music.163;;,tcp;;;music.126;;]
|
||||
5002 QQ音乐:[tcp;;;;^/amobile.music.tc.qq.com;,tcp;;;qqmusic;;]
|
||||
5003 酷狗音乐:[tcp;;;kugou;;,tcp;;;kgimg;;,tcp;;;fanxing;;]
|
||||
5004 酷我音乐:[tcp;;;.kuwo.cn;;]
|
||||
5005 喜马拉雅:[tcp;;;.ximalaya.com;;]
|
||||
5006 千千音乐:[tcp;;;music.taihe.com;;]
|
||||
5007 虾米音乐:[tcp;;;xiami;;]
|
||||
5008 音悦台:[tcp;;;yinyuetai.com;;]
|
||||
5009 豆瓣FM:[tcp;;;douban.fm;;]
|
||||
5010 唱吧:[tcp;;;changba.com;;]
|
||||
5011 音乐随心听:[tcp;;;fm.taihe.com;;]
|
||||
5012 懒人听书:[tcp;;;lrts.me;;]
|
||||
|
||||
#class employee
|
||||
6001 前程无忧:[tcp;;;51job;;]
|
||||
6002 智联招聘:[tcp;;;zhaopin;;]
|
||||
6003 猎聘:[tcp;;;liepin;;]
|
||||
6004 赶集网:[tcp;;;58.com;;,tcp;;;58cdn;;]
|
||||
6005 同城急聘:[tcp;;;xiaomei;;]
|
||||
6006 领英:[tcp;;;linkedin;;]
|
||||
6007 斗米:[tcp;;;doumi;;]
|
||||
6008 看准:[tcp;;;kanzhun.com;;]
|
||||
6009 应届生求职:[tcp;;;yingjiesheng.com;;]
|
||||
6010 中华英才网:[tcp;;;chinahr.com;;]
|
||||
6011 拉勾网:[tcp;;;lagou.com;;]
|
||||
6012 大街网:[tcp;;;dajie.com;;]
|
||||
6013 boss直聘:[tcp;;;zhipin.com;;]
|
||||
6014 实习僧:[tcp;;;shixiseng.com;;]
|
||||
|
||||
#class download
|
||||
7001 迅雷:[udp;12345;;;;,udp;15000;;;;,tcp;;54321;;;,tcp;;12345;;;,udp;6881;;;;,tcp;;;xunlei.com;;,tcp;;;sandai;;,udp;;8000;;;,udp;;12346;;;,udp;12346;;;;]
|
||||
7002 AppStore:[tcp;;80;iosapps.itunes.apple.com;;]
|
||||
7003 samba共享:[tcp;;445;;;]
|
||||
7004 ftp文件传输:[tcp;;21;;;]
|
||||
7005 Vivo应用商店:[tcp;;443;appstore.vivo;;,tcp;;443;apkappdefwsdl.vivo;;]
|
||||
|
||||
#class website
|
||||
8001 百度:[tcp;;;baidu.com;;]
|
||||
8002 新浪:[tcp;;;sina.com;;]
|
||||
8003 搜狐:[tcp;;;sohu.com;;]
|
||||
8004 网易:[tcp;;;163.com;;,tcp;;443;126.com;;]
|
||||
8005 凤凰网:[tcp;;;ifeng.com;;]
|
||||
8006 人民网:[tcp;;;people.com.cn;;]
|
||||
8007 凤凰网:[tcp;;;ifeng.com;;]
|
||||
8008 中华网:[tcp;;;china.com;;]
|
||||
8009 hao123:[tcp;;;hao123.com;;,]
|
||||
8010 2345:[tcp;;;2345.com;;,]
|
||||
8011 4399游戏:[tcp;;;4399.com;;]
|
||||
8012 7k7k游戏:[tcp;;;7k7k.com;;]
|
||||
8013 17173游戏:[tcp;;;17173.com;;]
|
||||
8014 37网游:[tcp;;;37.com;;]
|
||||
8015 游民星空:[tcp;;;gamersky.com;;]
|
||||
8016 游侠网:[tcp;;;ali213.net;;]
|
||||
8017 世纪佳缘:[tcp;;;jiayuan.com;;]
|
||||
8018 珍爱网:[tcp;;;zhenai.com;;]
|
||||
8019 百合网:[tcp;;;baihe.com;;]
|
||||
8020 天涯社区:[tcp;;;tianya.cn;;]
|
||||
8021 携程网:[tcp;;;ctrip.com;;]
|
||||
8022 飞猪:[tcp;;;fliggy.com;;]
|
||||
8023 12306:[tcp;;;12306.cn;;]
|
||||
8024 马蜂窝:[tcp;;;mafengwo.cn;;]
|
||||
8025 途牛:[tcp;;;tuniu.com;;]
|
||||
8026 穷游网:[tcp;;;qyer.com;;]
|
||||
8027 驴妈妈:[tcp;;;lvmama.com;;]
|
||||
8028 同程旅游:[tcp;;;ly.com;;]
|
||||
8029 太平洋汽车:[tcp;;;pcauto.com.cn;;]
|
||||
8030 易车网:[tcp;;;bitauto.com;;]
|
||||
8031 爱卡汽车:[tcp;;;xcar.com.cn;;]
|
||||
8032 雪球:[tcp;;;xueqiu.com;;]
|
||||
8033 东方财富:[tcp;;;eastmoney.com;;]
|
||||
8034 证券之星:[tcp;;;stockstar.com;;]
|
||||
8035 和讯:[tcp;;;hexun.com;;]
|
||||
8036 第一财经:[tcp;;;yicai.com;;]
|
||||
8037 全景网:[tcp;;;p5w.net;;]
|
||||
8038 中彩网:[tcp;;;zhcw.com;;]
|
||||
8039 中国体育彩票:[tcp;;;lottery.gov.cn;;]
|
||||
8040 竞彩网:[tcp;;;sporttery.cn;;]
|
||||
8041 豆丁:[tcp;;;docin.com;;]
|
||||
8042 豆瓣:[tcp;;;douban.com;;]
|
||||
8043 知乎:[tcp;;;zhihu.com;;]
|
||||
8044 缤客:[tcp;;;booking.com;;]
|
||||
8045 缤客:[tcp;;;booking.com;;]
|
||||
8046 猫扑:[tcp;;;mop.com;;]
|
||||
8047 赶集网:[tcp;;;ganji.com;;]
|
||||
8048 安居客:[tcp;;;anjuke.com;;]
|
||||
8049 房天下:[tcp;;;fang.com;;]
|
||||
8050 链家:[tcp;;;lianjia.com;;]
|
||||
8051 百姓网:[tcp;;;baixing.com;;]
|
||||
8052 下厨房:[tcp;;;xiachufang.com;;]
|
||||
8053 大众点评:[tcp;;;dianping.com;;]
|
||||
8054 58同城:[tcp;;;58.com;;]
|
||||
8055 天眼查:[tcp;;;tianyancha.com;;]
|
||||
8056 千图网:[tcp;;;58pic.com;;]
|
||||
8057 csdn社区:[tcp;;;csdn.net;;]
|
||||
8058 有道词典:[tcp;;;dict.youdao.com;;]
|
||||
8059 动漫之家:[tcp;;;dmzj.com;;]
|
||||
8060 汽车之家:[tcp;;;autohome.com.cn;;]
|
||||
8061 纵横中文网:[tcp;;;zongheng.com;;]
|
||||
8062 起点中文网:[tcp;;;qidian.com;;]
|
||||
8063 飞卢:[tcp;;;faloo.com;;]
|
||||
8064 潇湘书院:[tcp;;;xxsy.net;;]
|
||||
8065 cctv5:[tcp;;;sports.cctv.com;;]
|
||||
8066 虎扑体育:[tcp;;;www.hupu.com;;]
|
||||
8067 建设银行:[tcp;;;ccb.com;;]
|
||||
8068 农业银行:[tcp;;;abchina.com;;]
|
||||
8069 中国银行:[tcp;;;boc.cn;;]
|
||||
8070 交通银行:[tcp;;;bankcomm.com;;]
|
||||
8071 招商银行:[tcp;;;cmbchina.com;;]
|
||||
8072 邮政储蓄:[tcp;;;psbc.com;;]
|
||||
8073 兴业银行:[tcp;;;cib.com.cn;;]
|
||||
8074 浦发银行:[tcp;;;spdb.com.cn;;]
|
||||
8075 中信银行:[tcp;;;citicbank.com;;]
|
||||
8076 上海银行:[tcp;;;bosc.cn;;]
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
f_file=$1
|
||||
test -z "$f_file" && return
|
||||
test -d /tmp/appfilter && return
|
||||
cur_class=""
|
||||
cur_class_file=""
|
||||
mkdir /tmp/appfilter
|
||||
while read line
|
||||
do
|
||||
echo "$line"| grep "^#class"
|
||||
if [ $? -eq 0 ];then
|
||||
class=`echo $line| grep '#class' | awk '{print $2}'`
|
||||
if ! test -z "$class";then
|
||||
cur_class=$class
|
||||
cur_class_file="/tmp/appfilter/${cur_class}.class"
|
||||
if [ -e "$cur_class_file" ];then
|
||||
rm $cur_class_file
|
||||
fi
|
||||
touch $cur_class_file
|
||||
fi
|
||||
fi
|
||||
test -z "$cur_class" && continue
|
||||
appid=`echo "$line" |awk '{print $1}'`
|
||||
appname=`echo "$line" | awk '{print $2}' | awk -F: '{print $1}'`
|
||||
|
||||
echo "$appid $appname" >> $cur_class_file
|
||||
done < $f_file
|
||||
echo "ok"
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
--- a/os_dep/linux/os_intfs.c
|
||||
+++ b/os_dep/linux/os_intfs.c
|
||||
@@ -2803,6 +2803,7 @@ static int netdev_vir_if_close(struct net_device *pnetdev)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
+ struct wireless_dev *wdev = padapter->rtw_wdev;
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT" , bup=%d\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
|
||||
padapter->net_closed = _TRUE;
|
||||
@ -1,13 +0,0 @@
|
||||
--- a/os_dep/linux/os_intfs.c
|
||||
+++ b/os_dep/linux/os_intfs.c
|
||||
@@ -2817,8 +2817,10 @@ static int netdev_vir_if_close(struct net_device *pnetdev)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
+#ifndef CONFIG_CONCURRENT_MODE
|
||||
wdev->iftype = NL80211_IFTYPE_MONITOR;
|
||||
wdev->current_bss = NULL;
|
||||
+#endif
|
||||
rtw_scan_abort(padapter);
|
||||
rtw_cfg80211_wait_scan_req_empty(padapter, 200);
|
||||
adapter_wdev_data(padapter)->bandroid_scan = _FALSE;
|
||||
@ -0,0 +1,11 @@
|
||||
--- a/os_dep/linux/os_intfs.c
|
||||
+++ b/os_dep/linux/os_intfs.c
|
||||
@@ -238,7 +238,7 @@
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
-int rtw_vht_enable = 1; /* 0:disable, 1:enable, 2:force auto enable */
|
||||
+int rtw_vht_enable = 2; /* 0:disable, 1:enable, 2:force auto enable */
|
||||
module_param(rtw_vht_enable, int, 0644);
|
||||
|
||||
int rtw_ampdu_factor = 7;
|
||||
@ -9,20 +9,15 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tinyfecVPN
|
||||
PKG_VERSION:=20180820.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/wangyu-/tinyfecVPN.git
|
||||
PKG_SOURCE_VERSION:=e8364ba8ff94415ee3bedcbdb9557bfe5994a469
|
||||
PKG_MIRROR_HASH:=30fd808b0203c70e8e6cfe8ca55b907faaea6a8be12a7a7fef6658f4ddbb523c
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/wangyu-/tinyfecVPN/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=ab758480e3ae43e851d2285a4441dee9c0b524b1a279e38e701302aa61617a5d
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=Yu Wang
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -43,8 +38,7 @@ endef
|
||||
|
||||
MAKE_FLAGS += cross
|
||||
|
||||
define Build/Prepare
|
||||
$(PKG_UNPACK)
|
||||
define Build/Configure
|
||||
sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
|
||||
sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
|
||||
echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
|
||||
|
||||
@ -9,20 +9,15 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tinyPortMapper
|
||||
PKG_VERSION:=20200818.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/wangyu-/tinyPortMapper.git
|
||||
PKG_SOURCE_VERSION:=b6c5c05ba9a9db00571d185edcd534434f41b50a
|
||||
PKG_MIRROR_HASH:=93946ec018ef515d0f443fd9a6e6510ce3ceb1be373a2393fe2daeeb5e7ced95
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/wangyu-/tinyPortMapper/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=094aef3fa0646fe3d0418f87767c1dd24ba1a80518f1e8a7cae2783aed88e732
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=Yu Wang
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -42,8 +37,7 @@ endef
|
||||
|
||||
MAKE_FLAGS += cross
|
||||
|
||||
define Build/Prepare
|
||||
$(PKG_UNPACK)
|
||||
define Build/Configure
|
||||
sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
|
||||
sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
|
||||
echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' '{print $2}')"
|
||||
[ -z "${cpu_arch}" ] && cpu_arch="?"
|
||||
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
|
||||
|
||||
if grep -q "bcm27xx" "/etc/openwrt_release"; then
|
||||
|
||||
@ -44,12 +44,14 @@ gen_nginx_config() {
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
location ~ \.php(.*)$ {
|
||||
root $project_directory;
|
||||
try_files \$uri = 404; # PHP 文件不存在返回404
|
||||
fastcgi_pass unix:/var/run/php7-fpm.sock; # 通过 Unix 套接字执行 PHP
|
||||
fastcgi_index index.php;
|
||||
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; # 修复 Nginx fastcgi 漏洞
|
||||
fastcgi_param PATH_INFO \$fastcgi_path_info;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
}
|
||||
}
|
||||
@ -75,7 +77,7 @@ gen_php_config() {
|
||||
unserialize_callback_func =
|
||||
serialize_precision = 100
|
||||
|
||||
open_basedir = $storage_device_path:/tmp/:/proc/
|
||||
open_basedir = $storage_device_path:/tmp/:/proc/:/usr/bin/
|
||||
disable_functions =
|
||||
disable_classes =
|
||||
expose_php = On
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=182
|
||||
PKG_RELEASE:=9
|
||||
PKG_VERSION:=183
|
||||
PKG_RELEASE:=5
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/shadowsocksr
|
||||
@ -41,11 +41,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Simple_Obfs
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
|
||||
bool "Include Trojan"
|
||||
default y if i386||arm
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go
|
||||
bool "Include Trojan-Go"
|
||||
default y if x86_64||aarch64
|
||||
default y if arm||mipsel
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
||||
bool "Include V2ray"
|
||||
@ -69,7 +65,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Simple_Obfs \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray
|
||||
@ -77,8 +72,8 @@ PKG_CONFIG_DEPENDS:= \
|
||||
LUCI_TITLE:=SS/SSR/V2Ray/Trojan/NaiveProxy/Socks5/Tun LuCI interface
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+coreutils +coreutils-base64 +dns2socks +dnsmasq-full +ipset +ip-full \
|
||||
+iptables-mod-tproxy +lua +libuci-lua +microsocks +pdnsd-alt +tcping +resolveip \
|
||||
+shadowsocksr-libev-alt +wget-ssl \
|
||||
+iptables-mod-tproxy +ipt2socks-alt +lua +libuci-lua +microsocks +pdnsd-alt +tcping \
|
||||
+resolveip +shadowsocksr-libev-alt +wget-ssl \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2:redsocks2 \
|
||||
@ -89,9 +84,8 @@ LUCI_DEPENDS:=+coreutils +coreutils-base64 +dns2socks +dnsmasq-full +ipset +ip-f
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Simple_Obfs:simple-obfs \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go:trojan-go \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin:v2ray-plugin \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin:v2ray-plugin \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
@ -65,6 +65,24 @@ local encrypt_methods_ss = {
|
||||
"chacha20-ietf"
|
||||
}
|
||||
|
||||
local encrypt_methods_v2ray_ss = {
|
||||
-- xray_ss
|
||||
"none",
|
||||
"plain",
|
||||
"aes-128-cfb",
|
||||
"aes-256-cfb",
|
||||
"chacha20",
|
||||
"chacha20-ietf",
|
||||
-- aead
|
||||
"aes-128-gcm",
|
||||
"aes-256-gcm",
|
||||
"chacha20-poly1305",
|
||||
"chacha20-ietf-poly1305",
|
||||
"aead_aes_128_gcm",
|
||||
"aead_aes_256_gcm",
|
||||
"aead_chacha20_poly1305"
|
||||
}
|
||||
|
||||
local protocol = {
|
||||
-- ssr
|
||||
"origin",
|
||||
@ -132,10 +150,9 @@ if is_finded("ss-redir") then
|
||||
o:value("ss", translate("Shadowsocks New Version"))
|
||||
end
|
||||
if is_finded("xray") or is_finded("v2ray") then
|
||||
o:value("vmess", translate("Vmess"))
|
||||
o:value("vless", translate("VLESS"))
|
||||
o:value("v2ray", translate("V2Ray/XRay"))
|
||||
end
|
||||
if is_finded("trojan")then
|
||||
if is_finded("trojan") then
|
||||
o:value("trojan", translate("Trojan"))
|
||||
end
|
||||
if is_finded("trojan-go") then
|
||||
@ -145,10 +162,13 @@ end
|
||||
if is_finded("naive") then
|
||||
o:value("naiveproxy", translate("NaiveProxy"))
|
||||
end
|
||||
if is_finded("redsocks2") then
|
||||
if is_finded("ipt2socks-alt") or is_finded("ipt2socks") then
|
||||
o:value("socks5", translate("Socks5"))
|
||||
end
|
||||
if is_finded("redsocks2") then
|
||||
o:value("tun", translate("Network Tunnel"))
|
||||
end
|
||||
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
o = s:option(Value, "alias", translate("Alias(optional)"))
|
||||
@ -162,13 +182,21 @@ end
|
||||
o:depends("type", "tun")
|
||||
o.description = translate("Redirect traffic to this network interface")
|
||||
|
||||
o = s:option(ListValue, "v2ray_protocol", translate("V2Ray/XRay protocol"))
|
||||
o:value("vmess", translate("VMess"))
|
||||
o:value("vless", translate("VLESS"))
|
||||
o:value("trojan", translate("Trojan"))
|
||||
o:value("shadowsocks", translate("Shadowsocks"))
|
||||
o:value("socks", translate("Socks"))
|
||||
o:value("http", translate("HTTP"))
|
||||
o:depends("type", "v2ray")
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = false
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "v2ray")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "naiveproxy")
|
||||
o:depends("type", "socks5")
|
||||
@ -179,8 +207,7 @@ o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "v2ray")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "naiveproxy")
|
||||
o:depends("type", "socks5")
|
||||
@ -190,11 +217,15 @@ o = s:option(Flag, "auth_enable", translate("Enable Authentication"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
o:depends("type", "socks5")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "http"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "socks"})
|
||||
|
||||
o = s:option(Value, "username", translate("Username"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "naiveproxy")
|
||||
o:depends({type = "socks5", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "socks", auth_enable = true})
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.password = true
|
||||
@ -204,6 +235,10 @@ o:depends("type", "ss")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "naiveproxy")
|
||||
o:depends({type = "socks5", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "socks", auth_enable = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "trojan"})
|
||||
o:depends("type", "trojan-go")
|
||||
|
||||
o = s:option(ListValue, "encrypt_method", translate("Encrypt Method"))
|
||||
@ -220,6 +255,13 @@ end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "encrypt_method_v2ray_ss", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_v2ray_ss) do
|
||||
o:value(v)
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
|
||||
-- Shadowsocks Plugin
|
||||
o = s:option(ListValue, "plugin", translate("Obfs"))
|
||||
o:value("none", translate("None"))
|
||||
@ -262,20 +304,20 @@ o = s:option(Value, "alter_id", translate("AlterId"))
|
||||
o.datatype = "port"
|
||||
o.default = 16
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess"})
|
||||
|
||||
-- VmessId
|
||||
o = s:option(Value, "vmess_id", translate("Vmess/VLESS ID (UUID)"))
|
||||
o.rmempty = true
|
||||
o.default = uuid
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless"})
|
||||
|
||||
-- VLESS Encryption
|
||||
o = s:option(Value, "vless_encryption", translate("VLESS Encryption"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:depends("type", "vless")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless"})
|
||||
|
||||
-- 加密方式
|
||||
o = s:option(ListValue, "security", translate("Encrypt Method"))
|
||||
@ -283,7 +325,7 @@ for _, v in ipairs(securitys) do
|
||||
o:value(v, v:upper())
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess"})
|
||||
|
||||
-- 传输协议
|
||||
o = s:option(ListValue, "transport", translate("Transport"))
|
||||
@ -293,8 +335,7 @@ o:value("ws", "WebSocket")
|
||||
o:value("h2", "HTTP/2")
|
||||
o:value("quic", "QUIC")
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "v2ray")
|
||||
|
||||
trojan_transport = s:option(ListValue, "trojan_transport", translate("Transport"))
|
||||
trojan_transport:value("original", "Original")
|
||||
@ -469,8 +510,8 @@ o:depends("ss_aead", "1")
|
||||
o = s:option(Flag, "tls", translate("TLS"))
|
||||
o.rmempty = true
|
||||
o.default = "0"
|
||||
o:depends("type", "vmess")
|
||||
o:depends({type = "vless", xtls = false})
|
||||
o:depends({type = "v2ray", xtls = false})
|
||||
-- o:depends({type = "v2ray", v2ray_protocol = "vless", xtls = false})
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "trojan-go")
|
||||
|
||||
@ -479,7 +520,10 @@ if is_finded("xray") then
|
||||
o = s:option(Flag, "xtls", translate("XTLS"))
|
||||
o.rmempty = true
|
||||
o.default = "0"
|
||||
o:depends({type = "vless", transport = "tcp", tls = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "kcp", tls = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "tcp", tls = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "kcp", tls = false})
|
||||
end
|
||||
|
||||
-- Flow
|
||||
@ -522,8 +566,7 @@ o.description = translate("If true, allowss insecure connection at TLS client, e
|
||||
-- [[ Mux ]]--
|
||||
o = s:option(Flag, "mux", translate("Mux"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "vmess")
|
||||
o:depends({type = "vless", xtls = false})
|
||||
o:depends({type = "v2ray", xtls = false})
|
||||
|
||||
o = s:option(Value, "concurrency", translate("Concurrency"))
|
||||
o.datatype = "uinteger"
|
||||
@ -537,10 +580,10 @@ o.rmempty = true
|
||||
o.default = "0"
|
||||
o:depends({type = "trojan", tls = true, insecure = false})
|
||||
o:depends({type = "trojan-go", tls = true, insecure = false})
|
||||
o:depends({type = "vmess", tls = true, insecure = false})
|
||||
o:depends({type = "vless", tls = true, insecure = false})
|
||||
o:depends({type = "vmess", xtls = true, insecure = false})
|
||||
o:depends({type = "vless", xtls = true, insecure = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess", tls = true, insecure = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", tls = true, insecure = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vmess", xtls = true, insecure = false})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", xtls = true, insecure = false})
|
||||
o.description = translate("If you have a self-signed certificate,please check the box")
|
||||
|
||||
o = s:option(DummyValue, "upload", translate("Upload"))
|
||||
|
||||
@ -131,7 +131,9 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method_ss')[0].value = method || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].value = plugin || "none";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].dispatchEvent(event);
|
||||
if (plugin != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin_opts')[0].value = pluginOpts || "";
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param);
|
||||
}
|
||||
@ -141,7 +143,6 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = part2[0];
|
||||
@ -196,8 +197,10 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = url0;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "v2ray";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].value = "trojan";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var password = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
@ -279,8 +282,10 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
case "vmess":
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "v2ray";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].value = "vmess";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
@ -337,8 +342,10 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = url0;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "v2ray";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].value = "vless";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var uuid = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user