From f20cd5a04072640d542df585c330eae7a5b0ea08 Mon Sep 17 00:00:00 2001 From: Derry Date: Fri, 22 Jan 2021 06:32:59 -0800 Subject: [PATCH] OpenAppFilter: bump to latest git HEAD Signed-off-by: CN_SZTL --- package/ctcgfw/luci-app-appfilter/Makefile | 6 +- .../luasrc/model/cbi/appfilter/appfilter.lua | 29 +- package/ctcgfw/oaf/Makefile | 51 ---- package/ctcgfw/open-app-filter/Makefile | 79 ++++-- .../open-app-filter/files/appfilter.config | 3 - .../open-app-filter/files/appfilter.init | 14 - .../open-app-filter/files/appfilter.lua | 262 ------------------ .../ctcgfw/open-app-filter/files/appfilter.sh | 88 ------ .../ctcgfw/open-app-filter/files/feature.cfg | 175 ------------ .../ctcgfw/open-app-filter/files/gen_class.sh | 30 -- 10 files changed, 80 insertions(+), 657 deletions(-) delete mode 100644 package/ctcgfw/oaf/Makefile mode change 100755 => 100644 package/ctcgfw/open-app-filter/Makefile delete mode 100755 package/ctcgfw/open-app-filter/files/appfilter.config delete mode 100755 package/ctcgfw/open-app-filter/files/appfilter.init delete mode 100644 package/ctcgfw/open-app-filter/files/appfilter.lua delete mode 100755 package/ctcgfw/open-app-filter/files/appfilter.sh delete mode 100644 package/ctcgfw/open-app-filter/files/feature.cfg delete mode 100755 package/ctcgfw/open-app-filter/files/gen_class.sh diff --git a/package/ctcgfw/luci-app-appfilter/Makefile b/package/ctcgfw/luci-app-appfilter/Makefile index f92bca510d..907282c366 100644 --- a/package/ctcgfw/luci-app-appfilter/Makefile +++ b/package/ctcgfw/luci-app-appfilter/Makefile @@ -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 diff --git a/package/ctcgfw/luci-app-appfilter/luasrc/model/cbi/appfilter/appfilter.lua b/package/ctcgfw/luci-app-appfilter/luasrc/model/cbi/appfilter/appfilter.lua index 5a7c328159..9bc0e706cc 100644 --- a/package/ctcgfw/luci-app-appfilter/luasrc/model/cbi/appfilter/appfilter.lua +++ b/package/ctcgfw/luci-app-appfilter/luasrc/model/cbi/appfilter/appfilter.lua @@ -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" diff --git a/package/ctcgfw/oaf/Makefile b/package/ctcgfw/oaf/Makefile deleted file mode 100644 index 883dd1735a..0000000000 --- a/package/ctcgfw/oaf/Makefile +++ /dev/null @@ -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)) diff --git a/package/ctcgfw/open-app-filter/Makefile b/package/ctcgfw/open-app-filter/Makefile old mode 100755 new mode 100644 index 7da4cad0f0..aa7ff239ae --- a/package/ctcgfw/open-app-filter/Makefile +++ b/package/ctcgfw/open-app-filter/Makefile @@ -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)) - diff --git a/package/ctcgfw/open-app-filter/files/appfilter.config b/package/ctcgfw/open-app-filter/files/appfilter.config deleted file mode 100755 index a63a65c78c..0000000000 --- a/package/ctcgfw/open-app-filter/files/appfilter.config +++ /dev/null @@ -1,3 +0,0 @@ -config global global - -config appfilter appfilter diff --git a/package/ctcgfw/open-app-filter/files/appfilter.init b/package/ctcgfw/open-app-filter/files/appfilter.init deleted file mode 100755 index 089e72ec9a..0000000000 --- a/package/ctcgfw/open-app-filter/files/appfilter.init +++ /dev/null @@ -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 -} diff --git a/package/ctcgfw/open-app-filter/files/appfilter.lua b/package/ctcgfw/open-app-filter/files/appfilter.lua deleted file mode 100644 index 8cea8966f0..0000000000 --- a/package/ctcgfw/open-app-filter/files/appfilter.lua +++ /dev/null @@ -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() \ No newline at end of file diff --git a/package/ctcgfw/open-app-filter/files/appfilter.sh b/package/ctcgfw/open-app-filter/files/appfilter.sh deleted file mode 100755 index b096c9f104..0000000000 --- a/package/ctcgfw/open-app-filter/files/appfilter.sh +++ /dev/null @@ -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 diff --git a/package/ctcgfw/open-app-filter/files/feature.cfg b/package/ctcgfw/open-app-filter/files/feature.cfg deleted file mode 100644 index 65dec5a9ca..0000000000 --- a/package/ctcgfw/open-app-filter/files/feature.cfg +++ /dev/null @@ -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;;] - diff --git a/package/ctcgfw/open-app-filter/files/gen_class.sh b/package/ctcgfw/open-app-filter/files/gen_class.sh deleted file mode 100755 index 80350ca0e0..0000000000 --- a/package/ctcgfw/open-app-filter/files/gen_class.sh +++ /dev/null @@ -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" -