mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-09 21:48:03 +08:00
update 2026-10-23 00:28:40
This commit is contained in:
1 parent
3f38c69f75
commit
d64c67f0ed
320 files changed
+109777
-2309
No files matched your search
@@ -1,46 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2009-2013 OpenWrt.org
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=BaiduPCS-Go
|
||||
PKG_VERSION:=3.9.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/qjfoidnh/BaiduPCS-Go/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=de71666e961a3eeb90f8aca7b11934c3f0296d1870e036a7c086ba1decfca8ab
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/qjfoidnh/BaiduPCS-Go
|
||||
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/BaiduPCS-Go
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Download Manager
|
||||
TITLE:=Terminal utility for Baidu Network Disk
|
||||
URL:=https://github.com/qjfoidnh/BaiduPCS-Go
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/BaiduPCS-Go/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/BaiduPCS-Go $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,BaiduPCS-Go))
|
||||
$(eval $(call BuildPackage,BaiduPCS-Go))
|
||||
@@ -1,85 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 OpenWrt.org
|
||||
#
|
||||
# KFERMercer <KFER.Mercer@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=baidupcs-web
|
||||
PKG_VERSION:=3.7.1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/baidupcs-web
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=BaiduPCS-Web is a web controller for BaiduPCS-Go
|
||||
URL:=https://github.com/Erope/baidupcs-web
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BaiduPCS-Web is a web controller for BaiduPCS-Go
|
||||
endef
|
||||
|
||||
# 禁止OpenWrt对二进制文件进行strip
|
||||
STRIP:=true
|
||||
|
||||
ifeq ($(ARCH),i386)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=386
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=amd64
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mipsel)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=mipsle
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mips)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=mipsle
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ifeq ($(BOARD),bcm53xx)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=armv5
|
||||
else ifeq ($(BOARD),kirkwood)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=armv5
|
||||
else
|
||||
PKG_ARCH_BAIDUPCS-WEB:=armv7
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),aarch64)
|
||||
PKG_ARCH_BAIDUPCS-WEB:=arm64
|
||||
endif
|
||||
|
||||
PKG_SOURCE:=BaiduPCS-Go-v$(PKG_VERSION)-linux-$(PKG_ARCH_BAIDUPCS-WEB).zip
|
||||
PKG_SOURCE_URL:=https://github.com/coolsnowwolf/baidupcs-web/raw/master/
|
||||
|
||||
UNZIP_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-unzip
|
||||
|
||||
PKG_HASH:=skip
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -vp $(UNZIP_DIR)
|
||||
unzip -od $(UNZIP_DIR) $(DL_DIR)/$(PKG_SOURCE)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/baidupcs-web/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(UNZIP_DIR)/*/BaiduPCS-Go $(1)/usr/bin/baidupcs-web
|
||||
chmod 755 $(1)/usr/bin/baidupcs-web
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,baidupcs-web))
|
||||
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2009-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcryptopp
|
||||
PKG_VERSION:=5.6.4
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=cryptopp$(subst .,,$(PKG_VERSION)).zip
|
||||
PKG_SOURCE_URL:=http://www.cryptopp.com/
|
||||
PKG_MD5SUM:=4ee7e5cdd4a45a14756c169eaf2a77fc
|
||||
|
||||
PKG_USE_NINJA:=0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libcryptopp
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
TITLE:=Free C++ class library of cryptographic schemes
|
||||
URL:=http://packages.debian.org/sid/libcrypto++-dev
|
||||
endef
|
||||
|
||||
define Package/libcryptopp/description
|
||||
Crypto++ is library for creating C++ programs which use cryptographic algorithms.
|
||||
The library uses a Pipes & Filters architecture with heavy use of templates and
|
||||
abstract base classes.
|
||||
endef
|
||||
|
||||
#CONFIGURE_ARGS += \
|
||||
# --enable-static \
|
||||
# --enable-shared
|
||||
|
||||
#TARGET_LDFLAGS += \
|
||||
# -lpthread
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS="$(FPIC)"
|
||||
CMAKE_OPTIONS += -DBUILD_STATIC=ON
|
||||
CMAKE_OPTIONS += -DBUILD_SHARED=ON
|
||||
|
||||
UNPACK_CMD=cd $(PKG_BUILD_DIR) && unzip "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
cd $(PKG_BUILD_DIR) && rm -f GNUmakefile GNUmakefile-cross
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/cryptopp
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/cryptopp/* $(1)/usr/include/cryptopp/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcryptopp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcryptopp))
|
||||
@@ -1,22 +0,0 @@
|
||||
#
|
||||
# <https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
#
|
||||
# Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
|
||||
# Copyright (C) 2020 [CTCGFW] Project OpenWRT
|
||||
#
|
||||
# THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-baidupcs-web
|
||||
LUCI_TITLE:=LuCI support for BaiduPCS-Go
|
||||
LUCI_DEPENDS:=+baidupcs-web +wget +openssl-util
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=6
|
||||
PKG_MAINTAINER:=<https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -1,18 +0,0 @@
|
||||
module("luci.controller.baidupcs-web", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/baidupcs-web") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "nas", "baidupcs-web"}, cbi("baidupcs-web"), _("BaiduPCS Web"), 300).dependent = true
|
||||
entry({"admin", "nas", "baidupcs-web", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running=luci.sys.call("pgrep baidupcs-web >/dev/null") == 0
|
||||
-- e.port = luci.sys.exec("uci get baidupcs-web.config.port")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -1,48 +0,0 @@
|
||||
--[[
|
||||
|
||||
Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
|
||||
Copyright (C) 2020 [CTCGFW] Project OpenWRT
|
||||
|
||||
THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3
|
||||
|
||||
]]--
|
||||
|
||||
m = Map("baidupcs-web")
|
||||
m.title = translate("BaiduPCS-Web")
|
||||
m.description = translate("基于BaiduPCS-Go, 可以让你高效的使用百度云")
|
||||
|
||||
m:section(SimpleSection).template = "baidupcs-web/baidupcs-web_status"
|
||||
|
||||
s = m:section(TypedSection, "baidupcs-web")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable = s:option(Flag, "enabled", translate("启用"))
|
||||
enable.rmempty = false
|
||||
|
||||
o = s:option(Value, "port", translate("网页端口"))
|
||||
o.datatype = "port"
|
||||
o.placeholder = "5299"
|
||||
o.default = "5299"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "download_dir", translate("下载目录"))
|
||||
o.placeholder = "/opt/baidupcsweb-download"
|
||||
o.default = "/opt/baidupcsweb-download"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "max_download_rate", translate("最大下载速度"))
|
||||
o.placeholder = "0"
|
||||
|
||||
o = s:option(Value, "max_upload_rate", translate("最大上传速度"))
|
||||
o.placeholder = "0"
|
||||
o.description = translate("0代表不限制, 单位为每秒的传输速率, 后缀'/s' 可省略, 如 2MB/s, 2MB, 2m, 2mb 均为一个意思")
|
||||
|
||||
o = s:option(Value, "max_download_load", translate("同时进行下载文件的最大数量"))
|
||||
o.placeholder = "1"
|
||||
o.description = translate("不要太贪心, 当心被封号")
|
||||
|
||||
o = s:option(Value, "max_parallel", translate("最大并发连接数"))
|
||||
o.placeholder = "8"
|
||||
|
||||
return m
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
|
||||
THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3.
|
||||
-->
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[nas]], [[baidupcs-web]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('baidupcs-web_status');
|
||||
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>BaiduPCS-Web <%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:打开管理页面%>" onclick="openClient();" />';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>BaiduPCS-Web <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function openClient() {
|
||||
var curWwwPath = window.document.location.href;
|
||||
var pathName = window.document.location.pathname;
|
||||
var pos = curWwwPath.indexOf(pathName);
|
||||
var localhostPath = curWwwPath.substring(0, pos);
|
||||
var clientPort = window.document.getElementById("cbid.baidupcs-web.config.port").value
|
||||
var url = localhostPath + ":" + clientPort;
|
||||
window.open(url)
|
||||
};
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="baidupcs-web_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
config baidupcs-web 'config'
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
BaiduPCSWeb="/usr/bin/baidupcs-web"
|
||||
|
||||
enabled="$(uci -q get baidupcs-web.config.enabled)"
|
||||
port="$(uci -q get baidupcs-web.config.port)"
|
||||
download_dir="$(uci -q get baidupcs-web.config.download_dir)"
|
||||
max_download_rate="$(uci -q get baidupcs-web.config.max_download_rate || echo '0')"
|
||||
max_upload_rate="$(uci -q get baidupcs-web.config.max_upload_rate || echo '0')"
|
||||
max_download_load="$(uci -q get baidupcs-web.config.max_download_load || echo '1')"
|
||||
max_parallel="$(uci -q get baidupcs-web.config.max_parallel || echo '8')"
|
||||
|
||||
start() {
|
||||
stop
|
||||
[ "$enabled" == "1" ] || exit 0
|
||||
mkdir -p "${download_dir}"
|
||||
"${BaiduPCSWeb}" config set \
|
||||
--savedir "${download_dir}" \
|
||||
--max_download_rate "${max_download_rate}" \
|
||||
--max_upload_rate "${max_upload_rate}" \
|
||||
--max_download_load "${max_download_load}" \
|
||||
--max_parallel "${max_parallel}" \
|
||||
--max_upload_parallel "${max_parallel}" \
|
||||
>/dev/null 2>&1
|
||||
|
||||
"${BaiduPCSWeb}" web --port "${port}" --access >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall "${BaiduPCSWeb}" >/dev/null 2>&1
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-baidupcs-web": {
|
||||
"description": "Grant UCI access for luci-app-baidupcs-web",
|
||||
"read": {
|
||||
"uci": [ "baidupcs-web" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "baidupcs-web" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"config": "baidupcs-web",
|
||||
"init": "baidupcs-web"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI for Nps
|
||||
LUCI_DEPENDS:=+wget +npc
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.1
|
||||
PKG_RELEASE:=6
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -1,17 +0,0 @@
|
||||
module("luci.controller.nps",package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/nps") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "nps"}, cbi("nps"), _("Nps Penetrate"), 100).dependent = true
|
||||
entry({"admin", "services", "nps", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep npc > /dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -1,54 +0,0 @@
|
||||
m = Map("nps")
|
||||
m.title = translate("Nps Penetrate")
|
||||
m.description = translate("Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.")
|
||||
|
||||
m:section(SimpleSection).template = "nps/nps_status"
|
||||
|
||||
s = m:section(TypedSection, "nps")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable = s:option(Flag, "enabled", translate("Enable"))
|
||||
enable.rmempty = false
|
||||
|
||||
server = s:option(Value, "server_addr", translate("Server"))
|
||||
server.description = translate("Must an IPv4 address")
|
||||
server.datatype = "ipaddr"
|
||||
server.optional = false
|
||||
server.rmempty = false
|
||||
|
||||
port = s:option(Value, "server_port", translate("Port"))
|
||||
port.datatype = "port"
|
||||
port.default = "8024"
|
||||
port.optional = false
|
||||
port.rmempty = false
|
||||
|
||||
protocol = s:option(ListValue, "protocol", translate("Protocol Type"))
|
||||
protocol:value("tcp", translate("TCP Protocol"))
|
||||
protocol:value("kcp", translate("KCP Protocol"))
|
||||
protocol.default = "tcp"
|
||||
|
||||
vkey = s:option(Value, "vkey", translate("vkey"))
|
||||
vkey.optional = false
|
||||
vkey.password = true
|
||||
vkey.rmempty = false
|
||||
|
||||
compress = s:option(Flag, "compress", translate("Enable Compression"))
|
||||
compress.description = translate("The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources.")
|
||||
compress.default = "1"
|
||||
compress.rmempty = false
|
||||
|
||||
crypt = s:option(Flag, "crypt", translate("Enable Encryption"))
|
||||
crypt.description = translate("Encrypted the communication between Npc and Nps, will effectively prevent the traffic intercepted.")
|
||||
crypt.default = "1"
|
||||
crypt.rmempty = false
|
||||
|
||||
log_level = s:option(ListValue, "log_level", translate("Log Level"))
|
||||
log_level:value("0", "Emergency")
|
||||
log_level:value("2", "Critical")
|
||||
log_level:value("3", "Error")
|
||||
log_level:value("4", "Warning")
|
||||
log_level:value("7", "Debug")
|
||||
log_level.default = "3"
|
||||
|
||||
return m
|
||||
@@ -1,22 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[nps]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('nps_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = "<em><b><font color=green>Nps <%:RUNNING%></font></b></em>";
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = "<em><b><font color=red>Nps <%:NOT RUNNING%></font></b></em>";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="nps_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
@@ -1,47 +0,0 @@
|
||||
msgid "Nps Penetrate"
|
||||
msgstr "Nps 内网穿透"
|
||||
|
||||
msgid "Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
|
||||
msgstr "Nps 是一种快速反向代理,可帮助您将 NAT 或防火墙后面的本地服务器公开到 Internet。"
|
||||
|
||||
msgid "Must an IPv4 address"
|
||||
msgstr "必须是 IPv4 地址"
|
||||
|
||||
msgid "vkey"
|
||||
msgstr "密钥(vkey)"
|
||||
|
||||
msgid "Enable Compression"
|
||||
msgstr "使用压缩传输"
|
||||
|
||||
msgid "Enable Encryption"
|
||||
msgstr "使用加密传输"
|
||||
|
||||
msgid "The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources."
|
||||
msgstr "压缩传输内容,加快流量转发速度,会额外消耗 CPU 资源。"
|
||||
|
||||
msgid "Encrypted the communication between Npc and Nps, will effectively prevent the traffic intercepted."
|
||||
msgstr "加密传输 npc 与 nps 之间的通信内容,会有效防止流量被拦截。"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "Basic Setting"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Protocol Type"
|
||||
msgstr "协议类型"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务端地址"
|
||||
|
||||
msgid "TCP Protocol"
|
||||
msgstr "TCP"
|
||||
|
||||
msgid "KCP Protocol"
|
||||
msgstr "KCP"
|
||||
|
||||
msgid "Log Level"
|
||||
msgstr "日志级别"
|
||||
@@ -1 +0,0 @@
|
||||
zh-cn
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
config nps
|
||||
option enabled '0'
|
||||
option server_addr '1.1.1.1'
|
||||
option server_port '8024'
|
||||
option protocol 'tcp'
|
||||
option compress '1'
|
||||
option crypt '1'
|
||||
option vkey 'aaa'
|
||||
option log_level '4'
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
|
||||
START=50
|
||||
USE_PROCD=1
|
||||
|
||||
LOGFILE="/tmp/nps.log"
|
||||
tmpconf="/tmp/etc/nps.conf"
|
||||
|
||||
nps_header() {
|
||||
local enabled server_addr server_port protocol vkey compress crypt log_level
|
||||
|
||||
config_get enabled $1 enabled
|
||||
config_get server_addr $1 server_addr
|
||||
config_get server_port $1 server_port
|
||||
config_get protocol $1 protocol
|
||||
config_get vkey $1 vkey
|
||||
config_get compress $1 compress
|
||||
config_get crypt $1 crypt
|
||||
config_get log_level $1 log_level
|
||||
|
||||
[ -f $tmpconf ] && rm $tmpconf
|
||||
echo "[common]" >$tmpconf
|
||||
echo "server_addr=${server_addr}:${server_port}" >>$tmpconf
|
||||
echo "conn_type=${protocol}" >>$tmpconf
|
||||
echo "vkey=${vkey}" >>$tmpconf
|
||||
echo "auto_reconnection=true" >>$tmpconf
|
||||
|
||||
nps_write_bool compress $1
|
||||
nps_write_bool crypt $1
|
||||
|
||||
Log_level=$log_level
|
||||
Enabled=$enabled
|
||||
}
|
||||
|
||||
nps_write_bool() {
|
||||
local opt="$1"
|
||||
local config="$2"
|
||||
local val
|
||||
|
||||
config_get_bool val $config "$opt"
|
||||
if [ "$val" -eq 0 ]; then
|
||||
echo "${opt}=false" >> $tmpconf
|
||||
else
|
||||
echo "${opt}=true" >> $tmpconf
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load nps
|
||||
config_foreach nps_header nps
|
||||
|
||||
if [ "$Enabled" = "1" ];then
|
||||
logger -t FRPC 'Starting Nps service'
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/bin/npc -config=$tmpconf -log_level=$Log_level -log_path=$LOGFILE
|
||||
#procd_set_param file $tmpconf
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "nps"
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-nps": {
|
||||
"description": "Grant UCI access for luci-app-nps",
|
||||
"read": {
|
||||
"uci": [ "nps" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "nps" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"config": "nps",
|
||||
"init": "nps"
|
||||
}
|
||||
@@ -7,28 +7,11 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-qbittorrent
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
LUCI_TITLE:=LuCI support for qBittorrent
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:= \
|
||||
+PACKAGE_luci-app-qbittorrent_static:qBittorrent-static \
|
||||
+PACKAGE_luci-app-qbittorrent_dynamic:qbittorrent
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
choice
|
||||
prompt "Build Version Selection"
|
||||
default PACKAGE_luci-app-qbittorrent_dynamic
|
||||
|
||||
config PACKAGE_luci-app-qbittorrent_static
|
||||
bool "Static Build"
|
||||
depends on arm||aarch64||x86_64
|
||||
|
||||
config PACKAGE_luci-app-qbittorrent_dynamic
|
||||
bool "Dynamic Build"
|
||||
|
||||
endchoice
|
||||
endef
|
||||
LUCI_DEPENDS:=+qBittorrent-static
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-xlnetacc
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_MAINTAINER:=Sense <sensec@gmail.com>
|
||||
|
||||
LUCI_TITLE:=LuCI Support for XLNetAcc
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+jshn +curl +openssl-util
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/xlnetacc
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -1,36 +0,0 @@
|
||||
module("luci.controller.xlnetacc",package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/xlnetacc") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "xlnetacc"}, alias("admin", "services", "xlnetacc", "general"), _("XLNetAcc"), 90).dependent = true
|
||||
entry({"admin", "services", "xlnetacc", "general"}, cbi("xlnetacc"), _("Settings"), 1).leaf = true
|
||||
entry({"admin", "services", "xlnetacc", "log"}, template("xlnetacc/logview"), _("Log"), 2).leaf = true
|
||||
entry({"admin", "services", "xlnetacc", "status"}, call("action_status")).leaf = true
|
||||
entry({"admin", "services", "xlnetacc", "logdata"}, call("action_log")).leaf = true
|
||||
end
|
||||
|
||||
function action_status()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
run_state = luci.sys.call("ps -w | grep xlnetacc.sh | grep -v grep >/dev/null")==0,
|
||||
down_state = nixio.fs.readfile("/var/state/xlnetacc_down_state") or "",
|
||||
up_state = nixio.fs.readfile("/var/state/xlnetacc_up_state") or ""
|
||||
})
|
||||
end
|
||||
|
||||
function action_log()
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local util = require "luci.util"
|
||||
local log_data = {}
|
||||
|
||||
log_data.syslog = util.trim(util.exec("logread | grep xlnetacc"))
|
||||
if uci:get("xlnetacc","general","logging")~="0" then
|
||||
log_data.client = nixio.fs.readfile("/var/log/xlnetacc.log") or ""
|
||||
end
|
||||
uci:unload("xlnetacc")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(log_data)
|
||||
end
|
||||
@@ -1,57 +0,0 @@
|
||||
local m,s,o
|
||||
local uci = luci.model.uci.cursor()
|
||||
|
||||
m = Map("xlnetacc")
|
||||
m.title = translate("XLNetAcc - Settings")
|
||||
m.description = translate("XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software.")
|
||||
|
||||
m:section(SimpleSection).template = "xlnetacc/xlnetacc_status"
|
||||
|
||||
s = m:section(NamedSection, "general", "general")
|
||||
s.title = translate("General Settings")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "down_acc", translate("Enable DownLink Upgrade"))
|
||||
|
||||
o = s:option(Flag, "up_acc", translate("Enable UpLink Upgrade"))
|
||||
|
||||
o = s:option(Flag, "logging", translate("Enable Logging"))
|
||||
o.default = 1
|
||||
|
||||
o = s:option(Flag, "verbose", translate("Enable verbose logging"))
|
||||
o:depends("logging",1)
|
||||
|
||||
o = s:option(ListValue, "network", translate("Upgrade interface"))
|
||||
uci:foreach("network","interface",function(section)
|
||||
if section[".name"]~="loopback" then
|
||||
o:value(section[".name"])
|
||||
end
|
||||
end)
|
||||
|
||||
o = s:option(Value, "keepalive", translate("Keepalive interval"))
|
||||
o.description = translate("5 ~ 60 minutes")
|
||||
for _,v in ipairs({5,10,20,30,60}) do
|
||||
o:value(v,v.." "..translate("minutes"))
|
||||
end
|
||||
o.datatype = "range(5,60)"
|
||||
o.default = 10
|
||||
|
||||
o = s:option(Value, "relogin", translate("Account relogin"))
|
||||
o.description = translate("1 ~ 48 hours")
|
||||
o:value(0, translate("Not enabled"))
|
||||
for _,v in ipairs({3,12,18,24,30}) do
|
||||
o:value(v,v.." "..translate("hours"))
|
||||
end
|
||||
o.datatype = "max(48)"
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Value, "account", translate("XLNetAcc account"))
|
||||
|
||||
o = s:option(Value, "password", translate("XLNetAcc password"))
|
||||
o.password = true
|
||||
|
||||
return m
|
||||
@@ -1,49 +0,0 @@
|
||||
<%css=[[
|
||||
#log_text{
|
||||
padding:10px;
|
||||
text-align:left;
|
||||
height:500px;
|
||||
overflow:auto;
|
||||
}
|
||||
#log_text pre{
|
||||
word-break:break-all;
|
||||
margin:0;
|
||||
}
|
||||
.description{
|
||||
color:#ffffff;
|
||||
background-color:#0099ff;
|
||||
}
|
||||
]]
|
||||
%>
|
||||
|
||||
<%+header%>
|
||||
|
||||
<div class="cbi-map">
|
||||
<h2 name="content"><%:XLNetAcc - Log%></h2>
|
||||
<fieldset class="cbi-section">
|
||||
<fieldset class="cbi-section-node">
|
||||
<div id="log_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading...%>" style="vertical-align:middle"/><%:Collecting data...%></div>
|
||||
<div style="text-align:right"><small><%:Refresh every 5 seconds.%></small></div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<%=resource%>/cbi.js?v=1.0.5"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var log_id=document.getElementById('log_text');
|
||||
XHR.poll(5,'<%=luci.dispatcher.build_url("admin","services","xlnetacc","logdata")%>',null,function(x,data){
|
||||
if (log_id&&data){
|
||||
log_id.innerHTML=String.format(
|
||||
'<pre>%s%s%s%s</pre>',
|
||||
'<span class="description"><strong><%:syslog:%></strong></span><br/>',
|
||||
data.syslog || '<%:No log data.%>',
|
||||
'<br/><br/><span class="description"><strong><%:log file:%></strong></span><br/>',
|
||||
data.client || '<%:No log data.%>'
|
||||
);
|
||||
}else if (log_id){
|
||||
log_id.innerHTML='<strong><%:Error get log data.%></strong>';
|
||||
}
|
||||
});
|
||||
//]]></script>
|
||||
|
||||
<%+footer%>
|
||||
@@ -1,21 +0,0 @@
|
||||
<fieldset class="cbi-section">
|
||||
<legend><%:Running Status%></legend>
|
||||
<table width="100%" cellspacing="10" id="_xlnetacc_status_table">
|
||||
<tr><td width="33%"><%:XLNetAcc Running Status%></td><td id="_run_state"><em><%:Collecting data...%></em></td></tr>
|
||||
<tr><td width="33%"><%:DownLink Upgrade Status%></td><td id="_down_state"><em><%:Collecting data...%></em></td></tr>
|
||||
<tr><td width="33%"><%:UpLink Upgrade Status%></td><td id="_up_state"><em><%:Collecting data...%></em></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var run_state=document.getElementById('_run_state');
|
||||
var down_state=document.getElementById('_down_state');
|
||||
var up_state=document.getElementById('_up_state');
|
||||
XHR.poll(5,'<%=luci.dispatcher.build_url("admin","services","xlnetacc","status")%>',null,function(x,status){
|
||||
if ( x&&x.status==200 ){
|
||||
run_state.innerHTML=status.run_state?'<em><b><font color=green><%:RUNNING%></font></b></em>':'<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
|
||||
down_state.innerHTML=status.down_state?status.down_state:'<%:No upgrade information%>';
|
||||
up_state.innerHTML=status.up_state?status.up_state:'<%:No upgrade information%>';
|
||||
}
|
||||
});
|
||||
//]]></script>
|
||||
@@ -1,116 +0,0 @@
|
||||
msgid "XLNetAcc"
|
||||
msgstr "迅雷快鸟"
|
||||
|
||||
msgid "XLNetAcc - Settings"
|
||||
msgstr "迅雷快鸟 - 设置"
|
||||
|
||||
msgid "XLNetAcc - Log"
|
||||
msgstr "迅雷快鸟 - 日志"
|
||||
|
||||
msgid "XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software."
|
||||
msgstr "迅雷快鸟是迅雷联合宽带运营商推出的一款致力于帮助用户解决宽带低、网速慢、上网体验差的专业级宽带加速软件。"
|
||||
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
msgid "Log"
|
||||
msgstr "日志"
|
||||
|
||||
msgid "Running Status"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "XLNetAcc Running Status"
|
||||
msgstr "快鸟运行状态"
|
||||
|
||||
msgid "DownLink Upgrade Status"
|
||||
msgstr "下行提速状态"
|
||||
|
||||
msgid "UpLink Upgrade Status"
|
||||
msgstr "上行提速状态"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "No upgrade information"
|
||||
msgstr "暂无提速信息"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Enable DownLink Upgrade"
|
||||
msgstr "开启下行提速"
|
||||
|
||||
msgid "Enable UpLink Upgrade"
|
||||
msgstr "开启上行提速"
|
||||
|
||||
msgid "Enable Logging"
|
||||
msgstr "启用日志记录"
|
||||
|
||||
msgid "Enable verbose logging"
|
||||
msgstr "启用详细日志"
|
||||
|
||||
msgid "Upgrade interface"
|
||||
msgstr "指定提速接口"
|
||||
|
||||
msgid "Keepalive interval"
|
||||
msgstr "保持连接周期"
|
||||
|
||||
msgid "Account relogin"
|
||||
msgstr "帐号重新登录"
|
||||
|
||||
msgid "Not enabled"
|
||||
msgstr "未启用"
|
||||
|
||||
msgid "5 ~ 60 minutes"
|
||||
msgstr "5 ~ 60 分钟"
|
||||
|
||||
msgid "minutes"
|
||||
msgstr "分钟"
|
||||
|
||||
msgid "1 ~ 48 hours"
|
||||
msgstr "1 ~ 48 小时"
|
||||
|
||||
msgid "hours"
|
||||
msgstr "小时"
|
||||
|
||||
msgid "XLNetAcc account"
|
||||
msgstr "迅雷快鸟帐号"
|
||||
|
||||
msgid "XLNetAcc password"
|
||||
msgstr "迅雷快鸟密码"
|
||||
|
||||
msgid "Does not store the plaintext password, automatically emptied after start."
|
||||
msgstr "不存储明文密码,启动后自动清空。"
|
||||
|
||||
msgid "Encrypted password"
|
||||
msgstr "加密后的密码"
|
||||
|
||||
msgid "Auto-generate in accordance with the plaintext password, do not modify it!"
|
||||
msgstr "根据明文密码自动生成,请勿修改!"
|
||||
|
||||
msgid "Log Data"
|
||||
msgstr "日志数据"
|
||||
|
||||
msgid "Loading..."
|
||||
msgstr "正在加载..."
|
||||
|
||||
msgid "Refresh every 5 seconds."
|
||||
msgstr "每 5 秒刷新。"
|
||||
|
||||
msgid "syslog:"
|
||||
msgstr "系统日志:"
|
||||
|
||||
msgid "log file:"
|
||||
msgstr "日志文件:"
|
||||
|
||||
msgid "No log data."
|
||||
msgstr "无日志数据。"
|
||||
|
||||
msgid "Error get log data."
|
||||
msgstr "获取日志数据失败。"
|
||||
@@ -1 +0,0 @@
|
||||
zh-cn
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
config general 'general'
|
||||
option enabled '0'
|
||||
option network 'wan'
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/etc/init.d/xlnetacc enabled || exit 0
|
||||
[ "$INTERFACE" != "$(uci get xlnetacc.general.network)" ] && exit 0
|
||||
|
||||
case "$ACTION" in
|
||||
ifup)
|
||||
/etc/init.d/xlnetacc start
|
||||
;;
|
||||
ifdown)
|
||||
/etc/init.d/xlnetacc stop
|
||||
;;
|
||||
esac
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
STOP=10
|
||||
SERVICE_DAEMONIZE=1
|
||||
|
||||
NAME=xlnetacc
|
||||
|
||||
start() {
|
||||
local retry=1
|
||||
while ps -w | grep ${NAME}.sh | grep -v grep >/dev/null 2>&1; do
|
||||
[ $retry -ge 10 ] && return 1 || let retry++
|
||||
sleep 1
|
||||
done
|
||||
rm -f /var/lock/xlnetacc.lock
|
||||
|
||||
config_load "$NAME"
|
||||
config_get_bool enabled "general" "enabled" 0
|
||||
config_get_bool down_acc "general" "down_acc" 0
|
||||
config_get_bool up_acc "general" "up_acc" 0
|
||||
config_get network "general" "network"
|
||||
config_get username "general" "account"
|
||||
config_get password "general" "password"
|
||||
( [ $enabled -eq 0 ] || [ $down_acc -eq 0 -a $up_acc -eq 0 ] || [ -z "$username" -o -z "$password" -o -z "$network" ] ) && return 2
|
||||
|
||||
logger -p "daemon.notice" -t "$NAME" "XLNetAcc is starting ..."
|
||||
service_start /usr/bin/${NAME}.sh --start
|
||||
}
|
||||
|
||||
stop() {
|
||||
ps -w | grep ${NAME}.sh | grep -v grep >/dev/null 2>&1 || return 1
|
||||
local pid spid
|
||||
for pid in $(ps -w | grep ${NAME}.sh | grep -v grep | awk '{print $1}'); do
|
||||
echo "Stop XLNetAcc process PID: $pid"
|
||||
kill $pid >/dev/null 2>&1
|
||||
for spid in $(pgrep -P $pid "sleep"); do
|
||||
echo "Stop XLNetAcc process SPID: $spid"
|
||||
kill $spid >/dev/null 2>&1
|
||||
done
|
||||
done
|
||||
rm -f /var/lock/xlnetacc.lock
|
||||
logger -p "daemon.notice" -t "$NAME" "XLNetAcc has stoped."
|
||||
return 0
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop && sleep 1
|
||||
start
|
||||
}
|
||||
@@ -1,609 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 声明常量
|
||||
readonly packageName='com.xunlei.vip.swjsq'
|
||||
readonly protocolVersion=300
|
||||
readonly businessType=68
|
||||
readonly sdkVersion='3.1.2.185150'
|
||||
readonly clientVersion='2.7.2.0'
|
||||
readonly agent_xl="android-ok-http-client/xl-acc-sdk/version-$sdkVersion"
|
||||
readonly agent_down='okhttp/3.9.1'
|
||||
readonly agent_up='android-async-http/xl-acc-sdk/version-1.0.0.1'
|
||||
readonly client_type_down='android-swjsq'
|
||||
readonly client_type_up='android-uplink'
|
||||
|
||||
# 声明全局变量
|
||||
_bind_ip=
|
||||
_http_cmd=
|
||||
_peerid=
|
||||
_devicesign=
|
||||
_userid=
|
||||
_loginkey=
|
||||
_sessionid=
|
||||
_portal_down=
|
||||
_portal_up=
|
||||
_dial_account=
|
||||
access_url=
|
||||
http_args=
|
||||
user_agent=
|
||||
link_cn=
|
||||
lasterr=
|
||||
sequence_xl=1000000
|
||||
sequence_down=$(( $(date +%s) / 6 ))
|
||||
sequence_up=$sequence_down
|
||||
|
||||
# 包含用于解析 JSON 格式返回值的函数
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# 读取 UCI 设置相关函数
|
||||
uci_get_by_name(){
|
||||
local ret=$(uci -q get $NAME.$1.$2)
|
||||
echo -n ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_get_by_bool(){
|
||||
case $(uci_get_by_name "$1" "$2" "$3") in
|
||||
1|on|true|yes|enabled)echo -n 1;;
|
||||
*)echo -n 0;;
|
||||
esac
|
||||
}
|
||||
|
||||
# 日志和状态栏输出。1 日志文件, 2 系统日志, 4 详细模式, 8 下行状态栏, 16 上行状态栏, 32 失败状态
|
||||
_log(){
|
||||
local msg=$1 flag=$2 timestamp=$(date +'%Y/%m/%d %H:%M:%S')
|
||||
[ -z "$msg" ] && return
|
||||
[ -z "$flag" ] && flag=1
|
||||
|
||||
[ $logging = 0 -a $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 ))
|
||||
if [ $verbose = 0 -a $(( $flag & 4 )) -ne 0 ];then
|
||||
[ $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 ))
|
||||
[ $(( $flag & 2 )) -ne 0 ] && flag=$(( $flag ^ 2 ))
|
||||
fi
|
||||
if [ $down_acc = 0 -a $(( $flag & 8 )) -ne 0 ];then
|
||||
flag=$(( $flag ^ 8 ))
|
||||
[ $up_acc -ne 0 ] && flag=$(( $flag | 16 ))
|
||||
fi
|
||||
if [ $up_acc = 0 -a $(( $flag & 16 )) -ne 0 ];then
|
||||
flag=$(( $flag ^ 16 ))
|
||||
[ $down_acc -ne 0 ] && flag=$(( $flag | 8 ))
|
||||
fi
|
||||
|
||||
[ $(( $flag & 1 )) -ne 0 ] && echo "$timestamp $msg" >> $LOGFILE 2> /dev/null
|
||||
[ $(( $flag & 2 )) -ne 0 ] && logger -p "daemon.info" -t "$NAME" "$msg"
|
||||
|
||||
[ $(( $flag & 32 )) = 0 ] && local color="green" || local color="red"
|
||||
[ $(( $flag & 8 )) -ne 0 ] && echo -n "<font color=$color>$timestamp $msg</font>" > $down_state_file 2> /dev/null
|
||||
[ $(( $flag & 16 )) -ne 0 ] && echo -n "<font color=$color>$timestamp $msg</font>" > $up_state_file 2> /dev/null
|
||||
}
|
||||
|
||||
# 清理日志
|
||||
clean_log(){
|
||||
[ $logging = 1 -a -f "$LOGFILE" ] || return
|
||||
[ $(wc -l "$LOGFILE" | awk '{print $1}') -le 800 ] && return
|
||||
_log "清理日志文件"
|
||||
local logdata=$(tail -n 500 "$LOGFILE")
|
||||
echo "$logdata" > $LOGFILE 2> /dev/null
|
||||
unset logdata
|
||||
}
|
||||
|
||||
# 获取接口IP地址
|
||||
get_bind_ip(){
|
||||
network=$(uci get "xlnetacc.general.network" 2> /dev/null)
|
||||
json_cleanup;json_load "$(ubus call network.interface.$network status 2> /dev/null)" >/dev/null 2>&1
|
||||
json_select "ipv4-address" >/dev/null 2>&1;json_select 1 >/dev/null 2>&1
|
||||
json_get_var _bind_ip "address"
|
||||
if [ -z "$_bind_ip" -o "$_bind_ip" = "0.0.0.0" ];then
|
||||
_log "获取网络 $network IP地址失败"
|
||||
return 1
|
||||
else
|
||||
_log "绑定IP地址: $_bind_ip"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# 生成设备标识
|
||||
gen_device_sign(){
|
||||
local ifname macaddr
|
||||
while :;do
|
||||
ifname=$(uci get "network.$network.ifname" 2> /dev/null)
|
||||
[ "${ifname:0:1}" = @ ] && network="${ifname:1}" || break
|
||||
done
|
||||
[ -z "$ifname" ] && { _log "获取网络 $network 信息出错";return;}
|
||||
json_cleanup;json_load "$(ubus call network.device status {\"name\":\"$ifname\"} 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var macaddr "macaddr"
|
||||
[ -z "$macaddr" ] && { _log "获取网络 $network MAC地址出错";return;}
|
||||
macaddr=$(echo -n "$macaddr" | awk '{print toupper($0)}')
|
||||
|
||||
# 计算peerID
|
||||
local fake_peerid=$(awk -F- '{print toupper($5)}' '/proc/sys/kernel/random/uuid')
|
||||
readonly _peerid="${fake_peerid}004V"
|
||||
_log "_peerid is $_peerid" $(( 1 | 4 ))
|
||||
|
||||
# 计算devicesign
|
||||
# sign = div.10?.device_id + md5(sha1(packageName + businessType + md5(a protocolVersion specific GUID)))
|
||||
local fake_device_id=$(echo -n "${macaddr//:/}" | openssl dgst -md5 | awk '{print $2}')
|
||||
local fake_device_sign=$(echo -n "${fake_device_id}${packageName}${businessType}c7f21687eed3cdb400ca11fc2263c998" \
|
||||
| openssl dgst -sha1 | awk '{print $2}')
|
||||
readonly _devicesign="div101.${fake_device_id}"$(echo -n "$fake_device_sign" | openssl dgst -md5 | awk '{print $2}')
|
||||
_log "_devicesign is $_devicesign" $(( 1 | 4 ))
|
||||
}
|
||||
|
||||
# 快鸟帐号通用参数
|
||||
swjsq_json(){
|
||||
let sequence_xl++
|
||||
# 生成POST数据
|
||||
json_init
|
||||
json_add_string protocolVersion "$protocolVersion"
|
||||
json_add_string sequenceNo "$sequence_xl"
|
||||
json_add_string platformVersion '10'
|
||||
json_add_string isCompressed '0'
|
||||
json_add_string appid "$businessType"
|
||||
json_add_string clientVersion "$clientVersion"
|
||||
json_add_string peerID "$_peerid"
|
||||
json_add_string appName "ANDROID-$packageName"
|
||||
json_add_string sdkVersion "${sdkVersion##*.}"
|
||||
json_add_string devicesign "$_devicesign"
|
||||
json_add_string netWorkType 'WIFI'
|
||||
json_add_string providerName 'OTHER'
|
||||
json_add_string deviceModel 'MI'
|
||||
json_add_string deviceName 'Xiaomi Mi'
|
||||
json_add_string OSVersion "7.1.1"
|
||||
}
|
||||
|
||||
# 帐号登录
|
||||
swjsq_login(){
|
||||
swjsq_json
|
||||
if [ -z "$_userid" -o -z "$_loginkey" ];then
|
||||
access_url='https://mobile-login.xunlei.com/login'
|
||||
json_add_string userName "$username"
|
||||
json_add_string passWord "$password"
|
||||
json_add_string verifyKey
|
||||
json_add_string verifyCode
|
||||
json_add_string isMd5Pwd '0'
|
||||
else
|
||||
access_url='https://mobile-login.xunlei.com/loginkey'
|
||||
json_add_string userName "$_userid"
|
||||
json_add_string loginKey "$_loginkey"
|
||||
fi
|
||||
json_close_object
|
||||
|
||||
local ret=$($_http_cmd -A "$agent_xl" -d "$(json_dump)" "$access_url")
|
||||
case $? in
|
||||
0)_log "login is $ret" $(( 1 | 4 ));json_cleanup;json_load "$ret" >/dev/null 2>&1;json_get_var lasterr "errorCode";;
|
||||
2)lasterr=-2;;
|
||||
28)lasterr=-3;;
|
||||
*)lasterr=-1;;
|
||||
esac
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)json_get_var _userid "userID";json_get_var _loginkey "loginKey";json_get_var _sessionid "sessionID";_log "_sessionid is $_sessionid" $(( 1 | 4 ));local outmsg="帐号登录成功";_log "$outmsg" $(( 1 | 8 ));;
|
||||
15)_userid=;_loginkey=;;# 身份信息已失效
|
||||
-1)local outmsg="帐号登录失败。迅雷服务器未响应,请稍候";_log "$outmsg";;
|
||||
-2)local outmsg="cURL 参数解析错误,请更新 cURL";_log "$outmsg" $(( 1 | 8 | 32 ));;
|
||||
-3)local outmsg="cURL 网络通信失败,请稍候";_log "$outmsg";;
|
||||
*)local errorDesc;json_get_var errorDesc "errorDesc";local outmsg="帐号登录失败。错误代码: ${lasterr}";[ -n "$errorDesc" ] && outmsg="${outmsg},原因: $errorDesc";_log "$outmsg" $(( 1 | 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 帐号注销
|
||||
swjsq_logout(){
|
||||
swjsq_json
|
||||
json_add_string userID "$_userid"
|
||||
json_add_string sessionID "$_sessionid"
|
||||
json_close_object
|
||||
|
||||
local ret=$($_http_cmd -A "$agent_xl" -d "$(json_dump)" 'https://mobile-login.xunlei.com/logout')
|
||||
_log "logout is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errorCode"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)_sessionid=;local outmsg="帐号注销成功";_log "$outmsg" $(( 1 | 8 ));;
|
||||
-1)local outmsg="帐号注销失败。迅雷服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local errorDesc;json_get_var errorDesc "errorDesc";local outmsg="帐号注销失败。错误代码: ${lasterr}";[ -n "$errorDesc" ] && outmsg="${outmsg},原因: $errorDesc";_log "$outmsg" $(( 1 | 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 获取用户信息
|
||||
swjsq_getuserinfo(){
|
||||
local _vasid vasid_down=14 vasid_up=33 outmsg
|
||||
[ $down_acc -ne 0 ] && _vasid="${_vasid}${vasid_down},";[ $up_acc -ne 0 ] && _vasid="${_vasid}${vasid_up},"
|
||||
swjsq_json
|
||||
json_add_string userID "$_userid"
|
||||
json_add_string sessionID "$_sessionid"
|
||||
json_add_string vasid "$_vasid"
|
||||
json_close_object
|
||||
|
||||
local ret=$($_http_cmd -A "$agent_xl" -d "$(json_dump)" 'https://mobile-login.xunlei.com/getuserinfo')
|
||||
_log "getuserinfo is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errorCode"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local index=1 can_down=0 vasid isVip isYear expireDate;json_select "vipList" >/dev/null 2>&1
|
||||
while :;do
|
||||
json_select $index >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && break
|
||||
json_get_var vasid "vasid"
|
||||
json_get_var isVip "isVip"
|
||||
json_get_var isYear "isYear"
|
||||
json_get_var expireDate "expireDate"
|
||||
json_select ".." >/dev/null 2>&1
|
||||
let index++
|
||||
case ${vasid:-0} in
|
||||
2)[ $down_acc -ne 0 ] && outmsg="迅雷超级会员" || continue;;
|
||||
$vasid_down)outmsg="迅雷快鸟会员";;
|
||||
$vasid_up)outmsg="上行提速会员";;
|
||||
*)continue;;
|
||||
esac
|
||||
if [ ${isVip:-0} = 1 -o ${isYear:-0} = 1 ];then
|
||||
outmsg="${outmsg}有效。会员到期时间:${expireDate:0:4}-${expireDate:4:2}-${expireDate:6:2}"
|
||||
[ $vasid = $vasid_up ] && _log "$outmsg" $(( 1 | 16 )) || _log "$outmsg" $(( 1 | 8 ))
|
||||
[ $vasid -ne $vasid_up ] && can_down=$(( $can_down | 1 ))
|
||||
else
|
||||
if [ ${#expireDate} -ge 8 ];then
|
||||
outmsg="${outmsg}已到期。会员到期时间:${expireDate:0:4}-${expireDate:4:2}-${expireDate:6:2}"
|
||||
else
|
||||
outmsg="${outmsg}无效"
|
||||
fi
|
||||
[ $vasid = $vasid_up ] && _log "$outmsg" $(( 1 | 16 | 32 )) || _log "$outmsg" $(( 1 | 8 | 32 ))
|
||||
[ $vasid = $vasid_up ] && up_acc=0
|
||||
fi
|
||||
done
|
||||
[ $can_down = 0 ] && down_acc=0;;
|
||||
-1)outmsg="获取迅雷会员信息失败。迅雷服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local errorDesc;json_get_var errorDesc "errorDesc";outmsg="获取迅雷会员信息失败。错误代码: ${lasterr}";[ -n "$errorDesc" ] && outmsg="${outmsg},原因: $errorDesc";_log "$outmsg" $(( 1 | 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 登录时间更新
|
||||
swjsq_renewal(){
|
||||
xlnetacc_var 1
|
||||
local limitdate=$(date +%Y%m%d -d "1970.01.01-00:00:$(( $(date +%s) + 30 * 24 * 60 * 60 ))")
|
||||
|
||||
access_url='http://api.ext.swjsq.vip.xunlei.com'
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/renewal?${http_args%&dial_account=*}&limitdate=$limitdate")
|
||||
_log "renewal is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local outmsg="更新登录时间成功。帐号登录展期:${limitdate:0:4}-${limitdate:4:2}-${limitdate:6:2}";_log "$outmsg";;
|
||||
-1)local outmsg="更新登录时间失败。迅雷服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "richmessage";local outmsg="更新登录时间失败。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 获取提速入口
|
||||
swjsq_portal(){
|
||||
xlnetacc_var $1
|
||||
|
||||
[ $1 = 1 ] && access_url='http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal' || \
|
||||
access_url='http://api.upportal.swjsq.vip.xunlei.com/v2/queryportal'
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url")
|
||||
_log "portal $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local interface_ip interface_port province sp;json_get_var interface_ip "interface_ip";json_get_var interface_port "interface_port";json_get_var province "province_name";json_get_var sp "sp_name"
|
||||
if [ $1 = 1 ];then
|
||||
_portal_down="http://$interface_ip:$interface_port/v2"
|
||||
_log "_portal_down is $_portal_down" $(( 1 | 4 ))
|
||||
else
|
||||
_portal_up="http://$interface_ip:$interface_port/v2"
|
||||
_log "_portal_up is $_portal_up" $(( 1 | 4 ))
|
||||
fi
|
||||
local outmsg="获取${link_cn}提速入口成功";[ -n "$province" -a -n "$sp" ] && outmsg="${outmsg}。运营商:${province}${sp}";_log "$outmsg" $(( 1 | $1 * 8 ));;
|
||||
-1)local outmsg="获取${link_cn}提速入口失败。迅雷服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "message";local outmsg="获取${link_cn}提速入口失败。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 获取网络带宽信息
|
||||
isp_bandwidth(){
|
||||
xlnetacc_var $1
|
||||
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/bandwidth?${http_args%&dial_account=*}")
|
||||
_log "bandwidth $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
# 获取带宽数据
|
||||
0)local can_upgrade bind_dial_account dial_account stream cur_bandwidth max_bandwidth;[ $1 = 1 ] && stream="downstream" || stream="upstream";json_get_var can_upgrade "can_upgrade"
|
||||
json_get_var bind_dial_account "bind_dial_account";json_get_var dial_account "dial_account";json_select;json_select "bandwidth" >/dev/null 2>&1;json_get_var cur_bandwidth "$stream"
|
||||
json_select;json_select "max_bandwidth" >/dev/null 2>&1;json_get_var max_bandwidth "$stream";json_select;cur_bandwidth=$(( ${cur_bandwidth:-0} / 1024 ));max_bandwidth=$(( ${max_bandwidth:-0} / 1024 ))
|
||||
if [ -n "$bind_dial_account" -a "$bind_dial_account" != "$dial_account" ];then
|
||||
local outmsg="绑定宽带账号 $bind_dial_account 与当前宽带账号 $dial_account 不一致,请联系迅雷客服解绑(每月仅一次)";_log "$outmsg" $(( 1 | 8 | 32 ))
|
||||
down_acc=0;up_acc=0
|
||||
elif [ $can_upgrade = 0 ];then
|
||||
local message;json_get_var message "richmessage";[ -z "$message" ] && json_get_var message "message"
|
||||
local outmsg="${link_cn}无法提速";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ))
|
||||
[ $1 = 1 ] && down_acc=0 || up_acc=0
|
||||
elif [ $cur_bandwidth -ge $max_bandwidth ];then
|
||||
local outmsg="${link_cn}无需提速。当前带宽 ${cur_bandwidth}M,超过最大可提升带宽 ${max_bandwidth}M";_log "$outmsg" $(( 1 | $1 * 8 ))
|
||||
[ $1 = 1 ] && down_acc=0 || up_acc=0
|
||||
else
|
||||
if [ -z "$_dial_account" -a -n "$dial_account" ];then
|
||||
_dial_account=$dial_account
|
||||
_log "_dial_account is $_dial_account" $(( 1 | 4 ))
|
||||
fi
|
||||
local outmsg="${link_cn}可以提速。当前带宽 ${cur_bandwidth}M,可提升至 ${max_bandwidth}M";_log "$outmsg" $(( 1 | $1 * 8 ))
|
||||
fi;;
|
||||
# 724 账号存在异常
|
||||
724)lasterr=-2;local outmsg="获取${link_cn}网络带宽信息失败。原因: 您的账号存在异常,请联系迅雷客服反馈";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
# 3103 线路暂不支持
|
||||
3103)lasterr=0;local province sp;json_get_var province "province_name";json_get_var sp "sp_name";local outmsg="${link_cn}无法提速。原因: ${province}${sp}线路暂不支持";_log "$outmsg" $(( 1 | $1 * 8 | 32 ))
|
||||
[ $1 = 1 ] && down_acc=0 || up_acc=0;;
|
||||
-1)local outmsg="获取${link_cn}网络带宽信息失败。运营商服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "richmessage";[ -z "$message" ] && json_get_var message "message"
|
||||
local outmsg="获取${link_cn}网络带宽信息失败。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 发送带宽提速信号
|
||||
isp_upgrade(){
|
||||
xlnetacc_var $1
|
||||
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/upgrade?$http_args")
|
||||
_log "upgrade $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local bandwidth;json_select "bandwidth" >/dev/null 2>&1;json_get_var bandwidth "downstream";bandwidth=$(( ${bandwidth:-0} / 1024 ))
|
||||
local outmsg="${link_cn}提速成功,带宽已提升到 ${bandwidth}M";_log "$outmsg" $(( 1 | $1 * 8 ));[ $1 = 1 ] && down_acc=2 || up_acc=2;;
|
||||
# 812 已处于提速状态
|
||||
812)lasterr=0;local outmsg="${link_cn}提速成功,当前宽带已处于提速状态";_log "$outmsg" $(( 1 | $1 * 8 ));[ $1 = 1 ] && down_acc=2 || up_acc=2;;
|
||||
# 724 账号存在异常
|
||||
724)lasterr=-2;local outmsg="${link_cn}提速失败。原因: 您的账号存在异常,请联系迅雷客服反馈";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
-1)local outmsg="${link_cn}提速失败。运营商服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "richmessage";[ -z "$message" ] && json_get_var message "message"
|
||||
local outmsg="${link_cn}提速失败。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 发送提速心跳信号
|
||||
isp_keepalive(){
|
||||
xlnetacc_var $1
|
||||
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/keepalive?$http_args")
|
||||
_log "keepalive $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local outmsg="${link_cn}心跳信号返回正常";_log "$outmsg";;
|
||||
# 513 提速通道不存在
|
||||
513)lasterr=-2;local outmsg="${link_cn}提速超时,提速通道不存在";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
-1)local outmsg="${link_cn}心跳信号发送失败。运营商服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "richmessage";[ -z "$message" ] && json_get_var message "message"
|
||||
local outmsg="${link_cn}提速失效。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 发送带宽恢复信号
|
||||
isp_recover(){
|
||||
xlnetacc_var $1
|
||||
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/recover?$http_args")
|
||||
_log "recover $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
case ${lasterr:=-1} in
|
||||
0)local outmsg="${link_cn}带宽已恢复";_log "$outmsg" $(( 1 | $1 * 8 ));[ $1 = 1 ] && down_acc=1 || up_acc=1;;
|
||||
-1)local outmsg="${link_cn}带宽恢复失败。运营商服务器未响应,请稍候";_log "$outmsg";;
|
||||
*)local message;json_get_var message "richmessage";[ -z "$message" ] && json_get_var message "message"
|
||||
local outmsg="${link_cn}带宽恢复失败。错误代码: ${lasterr}";[ -n "$message" ] && outmsg="${outmsg},原因: $message";_log "$outmsg" $(( 1 | $1 * 8 | 32 ));;
|
||||
esac
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 查询提速信息,未使用
|
||||
isp_query(){
|
||||
xlnetacc_var $1
|
||||
|
||||
local ret=$($_http_cmd -A "$user_agent" "$access_url/query_try_info?$http_args")
|
||||
_log "query_try_info $1 is $ret" $(( 1 | 4 ))
|
||||
json_cleanup;json_load "$ret" >/dev/null 2>&1
|
||||
json_get_var lasterr "errno"
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 设置参数变量
|
||||
xlnetacc_var(){
|
||||
if [ $1 = 1 ];then
|
||||
let sequence_down++
|
||||
access_url=$_portal_down
|
||||
http_args="sequence=${sequence_down}&client_type=${client_type_down}-${clientVersion}&client_version=${client_type_down//-/}-${clientVersion}&chanel=umeng-10900011&time_and=$(date +%s)000"
|
||||
user_agent=$agent_down
|
||||
link_cn="下行"
|
||||
else
|
||||
let sequence_up++
|
||||
access_url=$_portal_up
|
||||
http_args="sequence=${sequence_up}&client_type=${client_type_up}-${clientVersion}&client_version=${client_type_up//-/}-${clientVersion}"
|
||||
user_agent=$agent_down
|
||||
link_cn="上行"
|
||||
fi
|
||||
http_args="${http_args}&peerid=${_peerid}&userid=${_userid}&sessionid=${_sessionid}&user_type=1&os=android-7.1.1"
|
||||
[ -n "$_dial_account" ] && http_args="${http_args}&dial_account=${_dial_account}"
|
||||
}
|
||||
|
||||
# 重试循环
|
||||
xlnetacc_retry(){
|
||||
if [ $# -ge 3 ];then
|
||||
if [ $3 -ne 0 ];then
|
||||
[ $2 = 1 -a $down_acc -ne $3 ] && return 0
|
||||
[ $2 = 2 -a $up_acc -ne $3 ] && return 0
|
||||
fi
|
||||
fi
|
||||
local retry=1
|
||||
while :;do
|
||||
lasterr=
|
||||
eval $1 $2 && break # 成功
|
||||
[ $# -ge 4 -a $retry -ge $4 ] && break || let retry++ # 重试超时
|
||||
case $lasterr in
|
||||
-1)sleep 5s;;# 服务器未响应
|
||||
-2)break;;# 严重错误
|
||||
*)sleep 3s;;# 其它错误
|
||||
esac
|
||||
done
|
||||
|
||||
[ ${lasterr:-0} = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 注销已登录帐号
|
||||
xlnetacc_logout(){
|
||||
[ -z "$_sessionid" ] && return 2
|
||||
[ $# -ge 1 ] && local retry=$1 || local retry=1
|
||||
|
||||
xlnetacc_retry 'isp_recover' 1 2 $retry
|
||||
xlnetacc_retry 'isp_recover' 2 2 $retry
|
||||
xlnetacc_retry 'swjsq_logout' 0 0 $retry
|
||||
[ $down_acc -ne 0 ] && down_acc=1;[ $up_acc -ne 0 ] && up_acc=1
|
||||
_sessionid=;_dial_account=
|
||||
|
||||
[ $lasterr = 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
# 中止信号处理
|
||||
sigterm(){
|
||||
_log "trap sigterm, exit" $(( 1 | 4 ))
|
||||
xlnetacc_logout
|
||||
rm -f "$down_state_file" "$up_state_file"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# 初始化
|
||||
xlnetacc_init(){
|
||||
[ "$1" != "--start" ] && return 1
|
||||
|
||||
# 防止重复启动
|
||||
[ -f /var/lock/xlnetacc.lock ] && return 1
|
||||
touch /var/lock/xlnetacc.lock
|
||||
|
||||
# 读取设置
|
||||
readonly NAME=xlnetacc
|
||||
readonly LOGFILE=/var/log/${NAME}.log
|
||||
readonly down_state_file=/var/state/${NAME}_down_state
|
||||
readonly up_state_file=/var/state/${NAME}_up_state
|
||||
down_acc=$(uci_get_by_bool "general" "down_acc" 0)
|
||||
up_acc=$(uci_get_by_bool "general" "up_acc" 0)
|
||||
readonly logging=$(uci_get_by_bool "general" "logging" 1)
|
||||
readonly verbose=$(uci_get_by_bool "general" "verbose" 0)
|
||||
network=$(uci_get_by_name "general" "network" "wan")
|
||||
keepalive=$(uci_get_by_name "general" "keepalive" 10)
|
||||
relogin=$(uci_get_by_name "general" "relogin" 0)
|
||||
readonly username=$(uci_get_by_name "general" "account")
|
||||
readonly password=$(uci_get_by_name "general" "password")
|
||||
local enabled=$(uci_get_by_bool "general" "enabled" 0)
|
||||
([ $enabled = 0 ] || [ $down_acc = 0 -a $up_acc = 0 ] || [ -z "$username" -o -z "$password" -o -z "$network" ]) && return 2
|
||||
([ -z "$keepalive" -o -n "${keepalive//[0-9]/}" ] || [ $keepalive -lt 5 -o $keepalive -gt 60 ]) && keepalive=10
|
||||
readonly keepalive=$(( $keepalive ))
|
||||
([ -z "$relogin" -o -n "${relogin//[0-9]/}" ] || [ $relogin -gt 48 ]) && relogin=0
|
||||
readonly relogin=$(( $relogin * 60 * 60 ))
|
||||
|
||||
[ $logging = 1 ] && [ ! -d /var/log ] && mkdir -p /var/log
|
||||
[ -f "$LOGFILE" ] && _log "------------------------------"
|
||||
_log "迅雷快鸟正在启动..."
|
||||
|
||||
# 检查外部调用工具
|
||||
command -v curl >/dev/null || { _log "cURL 未安装";return 3;}
|
||||
local opensslchk=$(echo -n 'openssl' | openssl dgst -sha1 | awk '{print $2}')
|
||||
[ "$opensslchk" != 'c898fa1e7226427010e329971e82c669f8d8abb4' ] && { _log "openssl-util 未安装或计算错误";return 3;}
|
||||
|
||||
# 捕获中止信号
|
||||
trap 'sigterm' INT # Ctrl-C
|
||||
trap 'sigterm' QUIT # Ctrl-\
|
||||
trap 'sigterm' TERM # kill
|
||||
|
||||
# 生成设备标识
|
||||
gen_device_sign
|
||||
[ ${#_peerid} -ne 16 -o ${#_devicesign} -ne 71 ] && return 4
|
||||
|
||||
clean_log
|
||||
[ -d /var/state ] || mkdir -p /var/state
|
||||
rm -f "$down_state_file" "$up_state_file"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 程序主体
|
||||
xlnetacc_main(){
|
||||
while :;do
|
||||
# 获取外网IP地址
|
||||
xlnetacc_retry 'get_bind_ip'
|
||||
_http_cmd="curl -Lfs -m 5 --interface $_bind_ip"
|
||||
|
||||
# 注销快鸟帐号
|
||||
xlnetacc_logout 3 && sleep 3s
|
||||
|
||||
# 登录快鸟帐号
|
||||
while :;do
|
||||
lasterr=
|
||||
swjsq_login
|
||||
case $lasterr in
|
||||
0)break;;# 登录成功
|
||||
-1)sleep 5s;;# 服务器未响应
|
||||
-2)return 7;;# cURL 参数解析错误
|
||||
-3)sleep 3s;;# cURL 网络通信失败
|
||||
6)sleep 130m;;# 需要输入验证码
|
||||
8)sleep 3m;;# 服务器系统维护
|
||||
15)sleep 1s;;# 身份信息已失效
|
||||
*)return 5;;# 登录失败
|
||||
esac
|
||||
done
|
||||
|
||||
# 获取用户信息
|
||||
xlnetacc_retry 'swjsq_getuserinfo'
|
||||
[ $down_acc = 0 -a $up_acc = 0 ] && break
|
||||
# 登录时间更新
|
||||
xlnetacc_retry 'swjsq_renewal'
|
||||
# 获取提速入口
|
||||
xlnetacc_retry 'swjsq_portal' 1 1
|
||||
xlnetacc_retry 'swjsq_portal' 2 1
|
||||
# 获取带宽信息
|
||||
xlnetacc_retry 'isp_bandwidth' 1 1 10 || { sleep 3m;continue;}
|
||||
xlnetacc_retry 'isp_bandwidth' 2 1 10 || { sleep 3m;continue;}
|
||||
[ $down_acc = 0 -a $up_acc = 0 ] && break
|
||||
# 带宽提速
|
||||
xlnetacc_retry 'isp_upgrade' 1 1 10 || { sleep 3m;continue;}
|
||||
xlnetacc_retry 'isp_upgrade' 2 1 10 || { sleep 3m;continue;}
|
||||
|
||||
# 心跳保持
|
||||
local timer=$(date +%s)
|
||||
while :;do
|
||||
clean_log # 清理日志
|
||||
sleep ${keepalive}m
|
||||
[ $relogin -ne 0 -a $(( $(date +%s) - $timer )) -ge $relogin ] && break # 登录超时
|
||||
xlnetacc_retry 'isp_keepalive' 1 2 5 || break
|
||||
xlnetacc_retry 'isp_keepalive' 2 2 5 || break
|
||||
done
|
||||
done
|
||||
xlnetacc_logout
|
||||
_log "无法提速,迅雷快鸟已停止。"
|
||||
return 6
|
||||
}
|
||||
|
||||
# 程序入口
|
||||
xlnetacc_init "$@" && xlnetacc_main
|
||||
exit $?
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-xlnetacc": {
|
||||
"description": "Grant UCI access for luci-app-xlnetacc",
|
||||
"read": {
|
||||
"uci": [ "xlnetacc" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "xlnetacc" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"config": "xlnetacc",
|
||||
"init": "xlnetacc"
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nps
|
||||
PKG_VERSION:=0.26.18
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/yisier/nps/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=29da044262071a1fa53ce7169c6427ee4f12fc0ada60ef7fb52fabfd165afe91
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINTER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=ehang.io/nps
|
||||
GO_PKG_BUILD_PKG:=ehang.io/nps/cmd/...
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/nps/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A intranet penetration proxy server ($(1))
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
URL:=https://ehang-io.github.io/nps
|
||||
endef
|
||||
|
||||
Package/npc = $(call Package/nps/template,client)
|
||||
Package/nps = $(call Package/nps/template,server)
|
||||
|
||||
define Package/nps/description/template
|
||||
NPS is a lightweight, high-performance, powerful intranet penetration proxy server,
|
||||
with a powerful web management terminal.
|
||||
endef
|
||||
|
||||
Package/npc/description = $(Package/nps/description/template)
|
||||
Package/nps/description = $(Package/nps/description/template)
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Compile)
|
||||
endef
|
||||
|
||||
define Package/nps/install/template
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/$(2)
|
||||
endef
|
||||
|
||||
Package/npc/install = $(call Package/nps/install/template,$(1),npc)
|
||||
Package/nps/install = $(call Package/nps/install/template,$(1),nps)
|
||||
|
||||
$(eval $(call GoBinPackage,npc))
|
||||
$(eval $(call GoBinPackage,nps))
|
||||
$(eval $(call BuildPackage,npc))
|
||||
$(eval $(call BuildPackage,nps))
|
||||
@@ -1,4 +0,0 @@
|
||||
diff --git a/cmd/npc/sdk.go b/cmd/npc/sdk.go.bak
|
||||
similarity index 100%
|
||||
rename from cmd/npc/sdk.go
|
||||
rename to cmd/npc/sdk.go.bak
|
||||
@@ -1,95 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017-2020
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qbittorrent
|
||||
PKG_VERSION:=4.4.5
|
||||
PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE:=qBittorrent-release-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/qbittorrent/qBittorrent/tar.gz/release-$(PKG_VERSION)?
|
||||
PKG_HASH:=70c2128b44fe4df4dfc8afc765a304d70cf1b042b5214bcc855d8b3bbc9ccf36
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-release-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:qbittorrent:qbittorrent
|
||||
|
||||
PKG_BUILD_DEPENDS:=qttools
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/qbittorrent
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=BitTorrent
|
||||
DEPENDS:=+libgcc +libstdcpp \
|
||||
+rblibtorrent \
|
||||
+libopenssl \
|
||||
+qt5-core \
|
||||
+qt5-network \
|
||||
+qt5-sql \
|
||||
+qt5-xml \
|
||||
+zlib
|
||||
TITLE:=bittorrent client programmed in C++ / Qt
|
||||
URL:=https://www.qbittorrent.org/
|
||||
PROVIDES:=qBittorrent
|
||||
endef
|
||||
|
||||
define Package/qbittorrent/description
|
||||
qBittorrent is a bittorrent client programmed in C++ / Qt that uses
|
||||
libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg.
|
||||
It aims to be a good alternative to all other bittorrent clients out
|
||||
there. qBittorrent is fast, stable and provides unicode support as
|
||||
well as many features.
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DQT6=OFF \
|
||||
-DSTACKTRACE=OFF \
|
||||
-DWEBUI=ON \
|
||||
-DGUI=OFF \
|
||||
-DVERBOSE_CONFIGURE=ON
|
||||
|
||||
# The pcre2 is compiled with support for mips16
|
||||
ifdef CONFIG_USE_MIPS16
|
||||
TARGET_CFLAGS += -minterlink-mips16
|
||||
endif
|
||||
|
||||
# Support the glibc
|
||||
ifdef CONFIG_USE_GLIBC
|
||||
TARGET_LDFLAGS += -ldl -lrt -lpthread
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -std=c++17 -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -flto
|
||||
|
||||
# The pentium-mmx with lto will build failed on qt6
|
||||
ifeq ($(ARCH),i386)
|
||||
ifneq ($(findstring pentium-mmx,$(CONFIG_CPU_TYPE)),)
|
||||
TARGET_CFLAGS := $(filter-out -flto,$(TARGET_CFLAGS))
|
||||
TARGET_LDFLAGS := $(filter-out -flto,$(TARGET_LDFLAGS))
|
||||
endif
|
||||
endif
|
||||
|
||||
define Package/qbittorrent/conffiles
|
||||
/etc/config/qbittorrent
|
||||
endef
|
||||
|
||||
define Package/qbittorrent/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qbittorrent-nox $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qbittorrent))
|
||||
@@ -1,200 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qtbase
|
||||
PKG_BASE:=5.15
|
||||
PKG_BUGFIX:=8
|
||||
PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-everywhere-opensource-src-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:= \
|
||||
http://master.qt.io/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \
|
||||
http://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \
|
||||
http://qt.mirror.constant.com/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules
|
||||
PKG_HASH:=bfb11126c7f3abc3fdf86425ce912988b864a7e79a606d77325cffdbacb4be9c
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-everywhere-src-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_CPE_ID:=cpe:/a:qt:qt
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/qtbase/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=Qt5
|
||||
TITLE:=qtbase
|
||||
URL:=http://qt-project.org
|
||||
DEPENDS:=+libgcc +libstdcpp @!LINUX_2_6_36
|
||||
endef
|
||||
|
||||
define Package/qtbase/description
|
||||
This package provides the Qt5 libraries.
|
||||
|
||||
Qt is a cross-platform application development framework for desktop, embedded and mobile.
|
||||
Supported Platforms include Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry,
|
||||
Sailfish OS and others.
|
||||
|
||||
Qt is not a programming language on its own. It is a framework written in C++.
|
||||
|
||||
This package provides the following run-time libraries:
|
||||
- core
|
||||
- network
|
||||
- xml
|
||||
endef
|
||||
|
||||
define Package/qtbase
|
||||
$(call Package/qtbase/Default)
|
||||
TITLE+=all libs
|
||||
DEPENDS+=$(QTBASE_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/qtbase/install
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/qtbase/config
|
||||
config QT5_INCLUDE_ATOMIC
|
||||
bool "Depends on libatomic"
|
||||
default y if !(arm_v7 || ARCH_64BIT || TARGET_x86)
|
||||
default n
|
||||
help
|
||||
Check this options to add the libatomic to the dependences.
|
||||
- You'd better to confirm whether your compiler need the external libatomic.
|
||||
Otherwise, it is not recommended to modify this option mannually.
|
||||
|
||||
menu "Select Qtbase Libraries"
|
||||
comment "Qtbase Libraries"
|
||||
|
||||
$(foreach lib,$(QTBASE_LIBS),
|
||||
config PACKAGE_qt5-$(lib)
|
||||
prompt "Qtbase $(lib) library."
|
||||
default m if ALL
|
||||
)
|
||||
endmenu
|
||||
endef
|
||||
|
||||
PKG_CONFIG_DEPENDS = CONFIG_QT5_INCLUDE_ATOMIC
|
||||
|
||||
EXTRA_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
|
||||
EXTRA_LDFLAGS += -Wl,--gc-sections,--as-needed
|
||||
|
||||
CONFIGURE_ARGS = \
|
||||
-sysroot $(STAGING_DIR) \
|
||||
-hostprefix $(STAGING_DIR_HOSTPKG) \
|
||||
-extprefix $(STAGING_DIR)/usr \
|
||||
-prefix /usr \
|
||||
-archdatadir /usr/share/Qt \
|
||||
-datadir /usr/share/Qt \
|
||||
-device linux-generic-g++ \
|
||||
-device-option CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
-device-option COMPILER_FLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
|
||||
-device-option LINKER_FLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
|
||||
-confirm-license \
|
||||
-opensource \
|
||||
-release \
|
||||
-shared \
|
||||
-strip \
|
||||
-no-rpath \
|
||||
-no-use-gold-linker \
|
||||
-ltcg \
|
||||
-mimetype-database \
|
||||
-openssl-linked \
|
||||
-qt-doubleconversion \
|
||||
-system-pcre \
|
||||
-system-zlib \
|
||||
$(if $(findstring i386,$(ARCH)),-no-sse2 -no-sse4.1) \
|
||||
-no-angle \
|
||||
-no-cups \
|
||||
-no-dbus \
|
||||
-no-directfb \
|
||||
-no-dtls\
|
||||
-no-egl \
|
||||
-no-eglfs \
|
||||
-no-freetype \
|
||||
-no-gbm \
|
||||
-no-glib \
|
||||
-no-gtk \
|
||||
-no-gui \
|
||||
-no-harfbuzz \
|
||||
-no-iconv \
|
||||
-no-icu \
|
||||
-no-kms \
|
||||
-no-libjpeg \
|
||||
-no-libmd4c \
|
||||
-no-libpng \
|
||||
-no-libudev \
|
||||
-no-mtdev \
|
||||
-no-opengl \
|
||||
-no-opengles3 \
|
||||
-no-openvg \
|
||||
-no-pch \
|
||||
-no-slog2 \
|
||||
-sql-sqlite \
|
||||
-no-trace \
|
||||
-no-tslib \
|
||||
-no-vulkan \
|
||||
-no-widgets \
|
||||
-no-xcb \
|
||||
-no-xkbcommon \
|
||||
-no-zstd \
|
||||
-no-compile-examples \
|
||||
-no-feature-concurrent \
|
||||
-no-feature-gssapi \
|
||||
-no-feature-testlib \
|
||||
-make libs \
|
||||
-nomake examples \
|
||||
-nomake tests \
|
||||
-nomake tools \
|
||||
-v
|
||||
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
define Package/qtbase/Default/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libQt5$(shell echo $(2) | sed -e 's/\b[[:alpha:]]/\u&/g').so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define DefineQtbaseLibrary
|
||||
QTBASE_DEPENDS+=+qt5-$(1)
|
||||
|
||||
QTBASE_LIBS+=$(1)
|
||||
|
||||
define Package/qt5-$(1)
|
||||
$(call Package/qtbase/Default)
|
||||
TITLE+=$(1)
|
||||
DEPENDS+=$(foreach lib,$(2),+qt5-$(lib)) $(3)
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Package/qt5-$(1)/description
|
||||
This package contains the qt5 $(1) library.
|
||||
endef
|
||||
|
||||
define Package/qt5-$(1)/install
|
||||
$(call Package/qtbase/Default/install,$$(1),$(1))
|
||||
endef
|
||||
endef
|
||||
|
||||
$(eval $(call DefineQtbaseLibrary,core,,+QT5_INCLUDE_ATOMIC:libatomic +libpcre2-16 +zlib))
|
||||
$(eval $(call DefineQtbaseLibrary,network,core,+libopenssl +zlib))
|
||||
$(eval $(call DefineQtbaseLibrary,xml,core,))
|
||||
$(eval $(call DefineQtbaseLibrary,sql,core))
|
||||
|
||||
$(foreach lib,$(QTBASE_LIBS),$(eval $(call BuildPackage,qt5-$(lib))))
|
||||
$(eval $(call BuildPackage,qtbase))
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --color -uNr a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
|
||||
--- a/src/corelib/text/qbytearraymatcher.h 2020-10-27 16:02:11.000000000 +0800
|
||||
+++ b/src/corelib/text/qbytearraymatcher.h 2021-07-19 06:22:30.139372013 +0800
|
||||
@@ -41,7 +41,7 @@
|
||||
#define QBYTEARRAYMATCHER_H
|
||||
|
||||
#include <QtCore/qbytearray.h>
|
||||
-
|
||||
+#include <limits>
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qttools
|
||||
PKG_BASE:=5.15
|
||||
PKG_BUGFIX:=8
|
||||
PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-everywhere-opensource-src-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:= \
|
||||
http://master.qt.io/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \
|
||||
http://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \
|
||||
http://qt.mirror.constant.com/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules
|
||||
PKG_HASH:=a3bef8de13032dae17450f5df35e8abbb4f41f71e3b628871d3da5633577e9c4
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-everywhere-src-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=qtbase
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/qttools
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=Qt5
|
||||
TITLE:=qttools
|
||||
URL:=http://qt-project.org
|
||||
BUILDONLY:=1
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
cd $(PKG_BUILD_DIR) && qmake -o Makefile qttools.pro
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qttools))
|
||||
@@ -1,62 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rblibtorrent
|
||||
PKG_VERSION:=1.2.18
|
||||
PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=855c44be6370dc90ec1f3dff4223770dd47a5208
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=da0626afc80287c8ee6825bfed2d52fe24e8fd9abff9952034292bdc00a2dac1
|
||||
|
||||
PKG_LICENSE:=BSD
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/rblibtorrent
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Rasterbar BitTorrent library
|
||||
URL:=https://www.libtorrent.org/
|
||||
DEPENDS:=+libgcc +libstdcpp +libopenssl +boost +boost-system +boost-chrono +boost-random +libatomic
|
||||
MAINTAINER:=Arvid Norberg <arvid@libtorrent.org>
|
||||
endef
|
||||
|
||||
define Package/rblibtorrent/description
|
||||
Rasterbar libtorrent is a C++ library that aims to be a good alternative to
|
||||
all the other bittorrent implementations around. It is a library and not a
|
||||
full featured client, although it comes with a working example client.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
|
||||
EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++17)
|
||||
TARGET_LDFLAGS += -lstdc++ -Wl,--gc-sections,--as-needed -flto
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-Ddeprecated-functions=ON \
|
||||
-Dencryption=ON \
|
||||
-Diconv=ON \
|
||||
-Dstatic_runtime=ON \
|
||||
-Dlogging=OFF
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)
|
||||
endef
|
||||
|
||||
define Package/rblibtorrent/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,rblibtorrent))
|
||||
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=parted
|
||||
PKG_VERSION:=3.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/parted-$(PKG_VERSION)
|
||||
PKG_SOURCE:=parted-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/parted
|
||||
PKG_MD5SUM:=090655d05f3c471aa8e15a27536889ec
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
define Package/parted
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Disc
|
||||
TITLE:=parted Partition editor
|
||||
URL:=http://www.gnu.org/software/parted/index.shtml
|
||||
DEPENDS:= +libuuid +libreadline +libncurses +libblkid
|
||||
endef
|
||||
|
||||
define Package/parted/description
|
||||
parted Partition editor
|
||||
http://www.gnu.org/software/parted/index.shtml
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default, \
|
||||
--without-readline \
|
||||
--disable-device-mapper \
|
||||
--disable-nls \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/parted/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libparted/.libs/*.so* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libparted/fs/.libs/*.so* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/parted/.libs/parted $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/partprobe/.libs/partprobe $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,parted))
|
||||
Reference in new issue
Block a user