mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
fix
This commit is contained in:
parent
03e1981fe0
commit
f7f6b7495d
50 changed files with 0 additions and 1397 deletions
|
@ -1,76 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adbyby
|
||||
PKG_VERSION:=2.7
|
||||
PKG_RELEASE:=20200315
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Powerful adblock module to block ad.
|
||||
DEPENDS:=@(i386||x86_64||arm||mipsel||mips||aarch64)
|
||||
URL:=http://www.adbyby.com/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Adbyby is a powerful adblock module to block ad,just like adblock.
|
||||
endef
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
ADBYBY_DIR:=amd64
|
||||
endif
|
||||
ifeq ($(ARCH),mipsel)
|
||||
ADBYBY_DIR:=mipsle
|
||||
endif
|
||||
ifeq ($(ARCH),mips)
|
||||
ADBYBY_DIR:=mips
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
ADBYBY_DIR:=x86
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
ADBYBY_DIR:=armv7
|
||||
ifeq ($(BOARD),bcm53xx)
|
||||
ADBYBY_DIR:=arm
|
||||
endif
|
||||
ifeq ($(BOARD),kirkwood)
|
||||
ADBYBY_DIR:=arm
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
ADBYBY_DIR:=armv7
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby
|
||||
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
|
||||
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
|
||||
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
|
||||
|
||||
$(INSTALL_BIN) ./files/$(ADBYBY_DIR)/adbyby $(1)/usr/share/adbyby/adbyby
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
PROG_PATH=/usr/share/adbyby
|
||||
err=0
|
||||
until [ $err -ge 5 ]; do
|
||||
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
|
||||
iptables-save | grep ADBYBY >/dev/null || \
|
||||
/etc/init.d/adbyby add_rule
|
||||
sleep 10
|
||||
err=0
|
||||
else
|
||||
$PROG_PATH/adbyby --no-daemon &>/dev/null &
|
||||
sleep 1
|
||||
err=$((err+1))
|
||||
fi
|
||||
done
|
||||
/etc/init.d/adbyby del_rule
|
|
@ -1,14 +0,0 @@
|
|||
[cfg]
|
||||
### 2.1 ###
|
||||
listen-address=0.0.0.0:8118
|
||||
buffer-limit=1024
|
||||
keep-alive-timeout=30
|
||||
socket-timeout=60
|
||||
### 2.5 ###
|
||||
max_client_connections=0
|
||||
### 2.6 ###
|
||||
stack_size=200
|
||||
auto_restart=0
|
||||
### 2.7 ###
|
||||
debug=0
|
||||
ipset=0
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,25 +0,0 @@
|
|||
! -----¸üÐÂʱ¼ä: 2018-10-08 23:07:52 by:xwhyc-----
|
||||
.php?ad=
|
||||
/99rejs/js
|
||||
/agetsou.js^
|
||||
/c@*!25.js|$script
|
||||
/cococ-66/$script
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&end=*&ver=4
|
||||
/gg_js/
|
||||
/imgs.js?t=
|
||||
/js/adtop.js|
|
||||
/js/guanggao_gg.js?d=
|
||||
/js/sss/ad.js
|
||||
/static/js/aall.js
|
||||
/unionjs/$script
|
||||
/variety.tc.qq.com/*.mp4^*fmt=hd
|
||||
/variety.tc.qq.com/*.mp4^*fmt=shd
|
||||
/video.dispatch.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/view/image/QT_HY.jpg?t=
|
||||
/view/js/slade.js|$script
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=hd
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=shd
|
||||
/vmind.qqvideo.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/vmindhls.tc.qq.com/*ugc=0&ga=0&gv=0&start=
|
||||
/zzhzgg.js
|
|
@ -1,15 +0,0 @@
|
|||
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
|
||||
! -------------- 规则基于abp规则,并进行了字符替换部分的扩展-----------------------------
|
||||
! ABP规则请参考https://adblockplus.org/zh_CN/filters,下面为大致摘要
|
||||
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
|
||||
! "*" 为字符通配符,能够匹配0长度或任意长度的字符串,该通配符不能与正则语法混用。
|
||||
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
|
||||
! "|" 为管线符号,来表示地址的最前端或最末端
|
||||
! "||" 为子域通配符,方便匹配主域名下的所有子域。
|
||||
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
|
||||
! "##" 为元素选择器标识符,后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
|
||||
!! 元素隐藏暂不支持全局规则和排除规则
|
||||
!! 字符替换扩展
|
||||
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
|
||||
! 支持通配符*和?
|
||||
! -------------------------------------------------------------------------------------------
|
|
@ -1,30 +0,0 @@
|
|||
! -----更新时间: 2018-10-08 23:06:11 by:xwhyc-----------------------------------------------
|
||||
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满),470705224(满),534897434,438394572--------------
|
||||
|
||||
|
||||
!-------------------------------------------
|
||||
/showadv/
|
||||
3199.cn###ad640,[id^="ad0"]
|
||||
76fengyun.com###down_box{display:block!important;}.gggg,.ggao
|
||||
9553.com##[class="zm"]
|
||||
962.net##.show_ad,.g-962-ad
|
||||
amazon.cn##.adv-float-div
|
||||
downsx.rocks##.adbox,.Left-ad3_fixed,.google-ad2_fixed
|
||||
edu-acc.cn###doyoo_monitor
|
||||
fx678.com##[class^="adv-"]
|
||||
||76fengyun.com/body22233.js
|
||||
||76fengyun.com/file/$s@onclick="window.open('*');startWait();"@onclick="window.open(document.getElementById('downpage_link').href);startWait();"@
|
||||
||atanx.alicdn.com/t/tanxssp.js?_v=
|
||||
||biquguan.com/guan/$script
|
||||
||djv99sxoqpv11.cloudfront.net
|
||||
||jmxlaser.com
|
||||
||jump2.bdimg.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||nxkycx.com
|
||||
||res.jklan.cn/wp-content/themes/tt/js/system.js?ver=$s@function goto()@function xxx()@
|
||||
||tieba.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||ychap.com
|
||||
!-----------------------
|
||||
/qkostn.js|
|
||||
|http://mark.l.qq.com/fcgi-bin/get_video_mark_all*&strAdParam=
|
||||
!---------adbyby---------
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
@ -1,10 +0,0 @@
|
|||
;¸üйæÔòurl,dir,size,reverse,reverse
|
||||
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
|
||||
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
|
||||
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
|
||||
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
|
||||
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
|
||||
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0
|
||||
|
Binary file not shown.
|
@ -1,17 +0,0 @@
|
|||
# Copyright (C) 2020 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for Adbyby
|
||||
LUCI_DEPENDS:=+adbyby +uclient-fetch +ipset +dnsmasq-full
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-adbyby-plus
|
||||
PKG_VERSION:=2.0
|
||||
PKG_RELEASE:=75
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
|
@ -1,86 +0,0 @@
|
|||
|
||||
module("luci.controller.adbyby", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/adbyby") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "adbyby"}, alias("admin", "services", "adbyby", "base"), _("ADBYBY Plus +"), 9).dependent = true
|
||||
|
||||
entry({"admin", "services", "adbyby", "base"}, cbi("adbyby/base"), _("Base Setting"), 10).leaf = true
|
||||
entry({"admin", "services", "adbyby", "advanced"}, cbi("adbyby/advanced"), _("Advance Setting"), 20).leaf = true
|
||||
entry({"admin", "services", "adbyby", "help"}, form("adbyby/help"), _("Plus+ Domain List"), 30).leaf = true
|
||||
entry({"admin", "services", "adbyby", "esc"}, form("adbyby/esc"), _("Bypass Domain List"), 40).leaf = true
|
||||
entry({"admin", "services", "adbyby", "black"}, form("adbyby/black"), _("Block Domain List"), 50).leaf = true
|
||||
entry({"admin", "services", "adbyby", "block"}, form("adbyby/block"), _("Block IP List"), 60).leaf = true
|
||||
entry({"admin", "services", "adbyby", "user"}, form("adbyby/user"), _("User-defined Rule"), 70).leaf = true
|
||||
|
||||
entry({"admin", "services", "adbyby", "refresh"}, call("refresh_data"))
|
||||
entry({"admin", "services", "adbyby", "run"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep adbyby >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
|
||||
function refresh_data()
|
||||
local set = luci.http.formvalue("set")
|
||||
local icount = 0
|
||||
|
||||
if set == "rule_data" then
|
||||
luci.sys.exec("/usr/share/adbyby/rule-update")
|
||||
icount = luci.sys.exec("/usr/share/adbyby/rule-count '/tmp/rules/'")
|
||||
|
||||
if tonumber(icount)>0 then
|
||||
if nixio.fs.access("/usr/share/adbyby/rules/") then
|
||||
oldcount = luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
|
||||
else
|
||||
oldcount=0
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/* && cp -a /tmp/rules /usr/share/adbyby/")
|
||||
luci.sys.exec("/etc/init.d/adbyby restart &")
|
||||
retstring=tostring(math.ceil(tonumber(icount)))
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
refresh_cmd = "uclient-fetch -q --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf"
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
luci.sys.call("/usr/share/adbyby/ad-update")
|
||||
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
|
||||
if tonumber(icount)>0 then
|
||||
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
|
||||
oldcount = luci.sys.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
|
||||
else
|
||||
oldcount=0
|
||||
end
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/ad.conf /usr/share/adbyby/dnsmasq.adblock")
|
||||
luci.sys.exec("cp -f /tmp/ad.conf /tmp/etc/dnsmasq-adbyby.d/adblock")
|
||||
luci.sys.exec("/etc/init.d/adbyby restart &")
|
||||
retstring=tostring(math.ceil(tonumber(icount)))
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/ad.conf")
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret=retstring ,retcount=icount})
|
||||
end
|
|
@ -1,57 +0,0 @@
|
|||
|
||||
local SYS = require "luci.sys"
|
||||
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
|
||||
|
||||
local ad_count=0
|
||||
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
|
||||
ad_count=tonumber(SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l"))
|
||||
end
|
||||
|
||||
local rule_count=0
|
||||
if nixio.fs.access("/usr/share/adbyby/rules/") then
|
||||
rule_count=tonumber(SYS.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'"))
|
||||
end
|
||||
|
||||
m = Map("adbyby")
|
||||
|
||||
s = m:section(TypedSection, "adbyby")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "block_ios")
|
||||
o.title = translate("Block Apple iOS OTA update")
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "block_cnshort")
|
||||
o.title = translate("Block CNshort APP and Website")
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "cron_mode")
|
||||
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o=s:option(DummyValue,"ad_data",translate("Adblock Plus Data"))
|
||||
o.rawhtml = true
|
||||
o.template = "adbyby/refresh"
|
||||
o.value =ad_count .. " " .. translate("Records")
|
||||
|
||||
o=s:option(DummyValue,"rule_data",translate("Subscribe 3rd Rules Data"))
|
||||
o.rawhtml = true
|
||||
o.template = "adbyby/refresh"
|
||||
o.value =rule_count .. " " .. translate("Records")
|
||||
o.description = translate("AdGuardHome / Host / DNSMASQ rules auto-convert")
|
||||
|
||||
o = s:option(Button,"delete",translate("Delete All Subscribe Rules"))
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
SYS.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/*")
|
||||
SYS.exec("/etc/init.d/adbyby restart 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adbyby", "advanced"))
|
||||
end
|
||||
|
||||
o = s:option(DynamicList, "subscribe_url", translate("Anti-AD Rules Subscribe"))
|
||||
o.rmempty = true
|
||||
|
||||
return m
|
|
@ -1,66 +0,0 @@
|
|||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
|
||||
local DL = SYS.exec("head -1 /tmp/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'") or ""
|
||||
local DV = SYS.exec("head -1 /tmp/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'") or ""
|
||||
local NR = SYS.exec("grep -v '^!' /usr/share/adbyby/data/rules.txt | wc -l")
|
||||
local NU = SYS.exec("cat /usr/share/adbyby/data/user.txt | wc -l")
|
||||
local UD = NXFS.readfile("/tmp/adbyby.updated") or "1970-01-01 00:00:00"
|
||||
|
||||
m = Map("adbyby")
|
||||
m.title = translate("Adbyby Plus + Settings")
|
||||
m.description = translate("Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Host,filtering ads without losing bandwidth</font>")
|
||||
|
||||
m:section(SimpleSection).template = "adbyby/adbyby_status"
|
||||
|
||||
s = m:section(TypedSection, "adbyby")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enable", translate("Enable"))
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "wan_mode", translate("Running Mode"))
|
||||
o:value("0", translate("Global Mode (The slowest and the best effects)"))
|
||||
o:value("1", translate("Plus + Mode (Filter domain name list and blacklist website.Recommended)"))
|
||||
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
|
||||
o.default = 1
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Button, "restart", translate("Adbyby and Rule state"))
|
||||
o.inputtitle = translate("Update Adbyby Rules Manually")
|
||||
o.description = string.format("<strong>"..translate("Last Update Checked")..":</strong> %s<br /><strong>"..translate("Lazy Rule")..":</strong>%s <br /><strong>"..translate("Video Rule")..":</strong>%s", UD, DL, DV)
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
SYS.call("rm -rf /tmp/adbyby.updated /tmp/adbyby/admd5.json && /usr/share/adbyby/adbybyupdate.sh > /tmp/adupdate.log 2>&1 &")
|
||||
SYS.call("sleep 5")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
|
||||
end
|
||||
|
||||
t = m:section(TypedSection, "acl_rule", translate("<strong>Client Filter Mode Settings</strong>"))
|
||||
t.description = translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default.")
|
||||
t.template = "cbi/tblsection"
|
||||
t.sortable = true
|
||||
t.anonymous = true
|
||||
t.addremove = true
|
||||
|
||||
e = t:option(Value, "ipaddr", translate("IP Address"))
|
||||
e.width = "40%"
|
||||
e.datatype = "ip4addr"
|
||||
e.placeholder = "0.0.0.0/0"
|
||||
luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
if entry.reachable then
|
||||
e:value(entry.dest:string())
|
||||
end
|
||||
end)
|
||||
|
||||
e = t:option(ListValue, "filter_mode", translate("Filter Mode"))
|
||||
e.width = "40%"
|
||||
e.default = "disable"
|
||||
e.rmempty = false
|
||||
e:value("disable", translate("No filter"))
|
||||
e:value("global", translate("Global filter"))
|
||||
|
||||
return m
|
|
@ -1,23 +0,0 @@
|
|||
local fs = require "nixio.fs"
|
||||
local conffile = "/usr/share/adbyby/adblack.conf"
|
||||
|
||||
f = SimpleForm("custom")
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/adbyby restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
|
@ -1,23 +0,0 @@
|
|||
local fs = require "nixio.fs"
|
||||
local conffile = "/usr/share/adbyby/blockip.conf"
|
||||
|
||||
f = SimpleForm("custom")
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/adbyby restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
|
@ -1,23 +0,0 @@
|
|||
local fs = require "nixio.fs"
|
||||
local conffile = "/usr/share/adbyby/adesc.conf"
|
||||
|
||||
f = SimpleForm("custom")
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/adbyby restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
|
@ -1,23 +0,0 @@
|
|||
local fs = require "nixio.fs"
|
||||
local conffile = "/usr/share/adbyby/adhost.conf"
|
||||
|
||||
f = SimpleForm("custom")
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/adbyby restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
|
@ -1,23 +0,0 @@
|
|||
local fs = require "nixio.fs"
|
||||
local conffile = "/usr/share/adbyby/rules.txt"
|
||||
|
||||
f = SimpleForm("custom")
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/adbyby restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
|
@ -1,22 +0,0 @@
|
|||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[adbyby]], [[run]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('adbyby_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>Adbyby Plus+ <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>Adbyby Plus+ <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="adbyby_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
|
@ -1,35 +0,0 @@
|
|||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function refresh_data(btn,dataname)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Refresh...%> ';
|
||||
murl=dataname;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "adbyby","refresh")%>',
|
||||
{ set:murl },
|
||||
function(x,rv)
|
||||
{
|
||||
var s = document.getElementById(dataname+'-status');
|
||||
if (s)
|
||||
{
|
||||
if (rv.ret=="0")
|
||||
s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
|
||||
else if(rv.ret=="-1")
|
||||
{
|
||||
s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.ret+"</font>";
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Refresh Data %>';
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
<input type="button" class="cbi-button cbi-input-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
|
||||
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
|
||||
<%+cbi/valuefooter%>
|
|
@ -1,198 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: dingpengyu <dingpengyu06@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
|
||||
msgid "ADBYBY Plus +"
|
||||
msgstr "广告屏蔽大师 Plus+"
|
||||
|
||||
msgid "<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>"
|
||||
msgstr "<strong><font color=\"green\">广告屏蔽大师 Plus + 正在运行</font></strong>"
|
||||
|
||||
msgid "<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>"
|
||||
msgstr "<strong><font color=\"red\">广告屏蔽大师 Plus + 没有运行</font></strong>"
|
||||
|
||||
msgid "Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Host,filtering ads without losing bandwidth</font>"
|
||||
msgstr "广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私窃取及各种恶意网站<br /><font color=\"red\">Plus + 版本可以和 Adblock Plus Host 结合方式运行,过滤广告不损失带宽</font>"
|
||||
|
||||
msgid "Adbyby Plus +"
|
||||
msgstr "广告屏蔽大师 Plus+"
|
||||
|
||||
msgid "Adbyby Plus + Settings"
|
||||
msgstr "广告屏蔽大师 Plus+(支持 AdGuardHome /Host / DNSMASQ 规则)"
|
||||
|
||||
msgid "Base Setting"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Running Mode"
|
||||
msgstr "运行模式"
|
||||
|
||||
msgid "Global Mode (The slowest and the best effects)"
|
||||
msgstr "全局模式(最慢, 效果最好)"
|
||||
|
||||
msgid "Plus + Mode (Filter domain name list and blacklist website.Recommended)"
|
||||
msgstr "Plus + 模式(只过滤列表内域名结合ABP名单。推荐!)"
|
||||
|
||||
msgid "No filter Mode (Must set in Client Filter Mode Settings manually)"
|
||||
msgstr "手动代理模式(必须手动设置浏览器代理,或者客户端过滤模式设置)"
|
||||
|
||||
msgid "Transparent proxy"
|
||||
msgstr "透明代理"
|
||||
|
||||
msgid "Click to disable"
|
||||
msgstr "点击关闭"
|
||||
|
||||
msgid "Click to enable"
|
||||
msgstr "点击开启"
|
||||
|
||||
msgid "Adbyby and Rule state"
|
||||
msgstr "规则状态"
|
||||
|
||||
msgid "Restart Adbyby"
|
||||
msgstr "重启Adbyby"
|
||||
|
||||
msgid "Plus+ Domain List"
|
||||
msgstr "Plus+ 模式过滤的域名"
|
||||
|
||||
msgid "Bypass Domain List"
|
||||
msgstr "域名白名单"
|
||||
|
||||
msgid "Black Domain List"
|
||||
msgstr "域名黑名单"
|
||||
|
||||
msgid "Black IP List"
|
||||
msgstr "IP黑名单"
|
||||
|
||||
msgid "Advance Setting"
|
||||
msgstr "高级设置"
|
||||
|
||||
msgid "Update the rule at 6 a.m. every morning and restart adbyby"
|
||||
msgstr "每天凌晨6点更新规则并重启"
|
||||
|
||||
msgid "ADP Host List"
|
||||
msgstr "Adblock Plus Hosts 记录数"
|
||||
|
||||
msgid "Adblock Plus Data"
|
||||
msgstr "Adblock Plus 规则数据库"
|
||||
|
||||
msgid "Subscribe 3rd Rules Data"
|
||||
msgstr "订阅第三方去广告规则"
|
||||
|
||||
msgid "Records"
|
||||
msgstr "条记录"
|
||||
|
||||
msgid "Refresh Data"
|
||||
msgstr "更新数据库"
|
||||
|
||||
msgid "Refresh..."
|
||||
msgstr "正在更新,请稍候.."
|
||||
|
||||
msgid "Refresh OK!"
|
||||
msgstr "更新成功!"
|
||||
|
||||
msgid "Refresh Error!"
|
||||
msgstr "更新失败!"
|
||||
|
||||
msgid "No new data!"
|
||||
msgstr "你已经是最新数据,无需更新!"
|
||||
|
||||
msgid "Total Records:"
|
||||
msgstr "新的总纪录数:"
|
||||
|
||||
msgid "Delete All Subscribe Rules"
|
||||
msgstr "清空所有订阅的规则库"
|
||||
|
||||
msgid "Anti-AD Rules Subscribe"
|
||||
msgstr "广告过滤规则订阅URL"
|
||||
|
||||
msgid "AdGuardHome / Host / DNSMASQ rules auto-convert"
|
||||
msgstr "AdGuardHome / Host / DNSMASQ 规则自动识别"
|
||||
|
||||
msgid "Manually force update<br />Adblock Plus Host List"
|
||||
msgstr "手动强制更新<br />Adblock Plus Host List"
|
||||
|
||||
msgid "Update Adbyby Rules Manually"
|
||||
msgstr "手动更新规则"
|
||||
|
||||
msgid "Block Apple iOS OTA update"
|
||||
msgstr "拦截 Apple iOS 的OTA更新"
|
||||
|
||||
msgid "Block CNshort APP and Website"
|
||||
msgstr "拦截 短视频 APP 和网站"
|
||||
|
||||
msgid "RAM Running Mode"
|
||||
msgstr "内存运行模式"
|
||||
|
||||
msgid "Running Adbyby in RAM.More speed,less disk consumption"
|
||||
msgstr "在内存中运行Adbyby。更快的速度,更少的存储空间损耗"
|
||||
|
||||
msgid "User-defined Rule"
|
||||
msgstr "用户自定义规则"
|
||||
|
||||
msgid "<strong>Client Filter Mode Settings</strong>"
|
||||
msgstr "<strong>客户端过滤模式设置</strong>"
|
||||
|
||||
msgid "Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."
|
||||
msgstr "可以为局域网客户端分别设置不同的过滤模式 ( <font color=blue> 不过滤 , 全局过滤 </font> ) 。默认无需设置。"
|
||||
|
||||
msgid "IP Address"
|
||||
msgstr "IP地址"
|
||||
|
||||
msgid "Filter Mode"
|
||||
msgstr "过滤模式"
|
||||
|
||||
msgid "(!)Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each"
|
||||
msgstr "这些域名在 Plus 模式中会被过滤。你需要要填写域名即可,例如 http://www.baidu.com,你写 baidu.com 即可。每行一个域名"
|
||||
|
||||
msgid "(!)Will Never filter these Domain"
|
||||
msgstr "永不过滤白名单内的域名(所有模式中生效)"
|
||||
|
||||
msgid "(!)Will Always block these Domain"
|
||||
msgstr "拦截黑名单内的域名(所有模式中生效)"
|
||||
|
||||
msgid "(!)Will Always block these IP"
|
||||
msgstr "拦截黑名单内的IP地址(所有模式中生效)"
|
||||
|
||||
msgid "Each line of the beginning exclamation mark is considered an annotation."
|
||||
msgstr "每行一条规则,感叹号开头的被认为是注释。"
|
||||
|
||||
msgid "<strong><font color=blue>Adblock Plus Host List:</font></strong>"
|
||||
msgstr "<strong><font color=blue>Adblock Plus Host 列表:</font></strong>"
|
||||
|
||||
msgid "Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"
|
||||
msgstr "注意:需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新,请不要重复点击!"
|
||||
|
||||
msgid "No filter"
|
||||
msgstr "不过滤"
|
||||
|
||||
msgid "Global filter"
|
||||
msgstr "全局过滤"
|
||||
|
||||
msgid "Update adbyby rules form official website first"
|
||||
msgstr "优先从官方网站更新规则"
|
||||
|
||||
msgid "Last Update Checked"
|
||||
msgstr "上一次检查规则更新"
|
||||
|
||||
msgid "Lazy Rule"
|
||||
msgstr "正式版规则"
|
||||
|
||||
msgid "Video Rule"
|
||||
msgstr "测试版规则"
|
||||
|
||||
msgid "Adblock Plus Host List"
|
||||
msgstr "广告屏蔽大师 Plus 规则列表"
|
||||
|
||||
msgid "Block Domain List"
|
||||
msgstr "域名黑名单"
|
||||
|
||||
msgid "Block IP List"
|
||||
msgstr "IP黑名单"
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
config adbyby
|
||||
option daemon '2'
|
||||
option lan_mode '0'
|
||||
option cron_mode '1'
|
||||
option block_ios '0'
|
||||
option enable '0'
|
||||
option wan_mode '1'
|
||||
option mem_mode '1'
|
||||
option update_source '1'
|
||||
|
|
@ -1,254 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=10
|
||||
|
||||
|
||||
EXTRA_COMMANDS="add_rule del_rule reload_rule"
|
||||
PROG_PATH=/usr/share/adbyby
|
||||
DATA_PATH=$PROG_PATH/data
|
||||
WAN_FILE=/var/etc/dnsmasq-adbyby.d/03-adbyby-ipset.conf
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
CONFIG=adbyby
|
||||
ipt_n="iptables -t nat"
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $CONFIG.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local index=0
|
||||
if [ -n $4 ]; then
|
||||
|
||||
index=$4
|
||||
fi
|
||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
get_config()
|
||||
{
|
||||
config_get_bool enable $1 enable 0
|
||||
config_get_bool cron_mode $1 cron_mode 1
|
||||
config_get wan_mode $1 wan_mode 1
|
||||
config_get_bool block_ios $1 block_ios 0
|
||||
config_get_bool mem_mode $1 mem_mode 1
|
||||
config_get_bool block_cnshort $1 block_cnshort 0
|
||||
}
|
||||
|
||||
add_rules()
|
||||
{
|
||||
rm -f $DATA_PATH/user.bin
|
||||
grep -v ^! $PROG_PATH/rules.txt > $DATA_PATH/user.txt
|
||||
cp $PROG_PATH/rules.txt $DATA_PATH/rules.txt
|
||||
}
|
||||
|
||||
|
||||
add_cron()
|
||||
{
|
||||
if [ $cron_mode -eq 1 ]; then
|
||||
sed -i '/adblock.sh/d' $CRON_FILE
|
||||
echo '0 6 * * * /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1' >> $CRON_FILE
|
||||
crontab $CRON_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
del_cron()
|
||||
{
|
||||
sed -i '/adblock.sh/d' $CRON_FILE
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
ip_rule()
|
||||
{
|
||||
|
||||
ipset -N adbyby_esc hash:ip
|
||||
$ipt_n -A ADBYBY -m set --match-set adbyby_esc dst -j RETURN
|
||||
|
||||
local icount=$(uci show adbyby | grep 'filter_mode' | wc -l)
|
||||
let icount=icount-1
|
||||
for i in $(seq 0 $icount)
|
||||
do
|
||||
local ip=$(uci_get_by_type acl_rule ipaddr '' $i)
|
||||
local mode=$(uci_get_by_type acl_rule filter_mode '' $i)
|
||||
case "$mode" in
|
||||
disable)
|
||||
$ipt_n -A ADBYBY -s $ip -j RETURN
|
||||
;;
|
||||
global)
|
||||
$ipt_n -A ADBYBY -s $ip -p tcp -j REDIRECT --to-ports 8118
|
||||
$ipt_n -A ADBYBY -s $ip -j RETURN
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
case $wan_mode in
|
||||
0)
|
||||
;;
|
||||
1)
|
||||
ipset -N adbyby_wan hash:ip
|
||||
$ipt_n -A ADBYBY -m set ! --match-set adbyby_wan dst -j RETURN
|
||||
;;
|
||||
2)
|
||||
$ipt_n -A ADBYBY -j RETURN
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "create blockip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/blockip.ipset
|
||||
awk '!/^$/&&!/^#/{printf("add blockip %s'" "'\n",$0)}' /usr/share/adbyby/blockip.conf >> /tmp/blockip.ipset
|
||||
ipset -! restore < /tmp/blockip.ipset 2>/dev/null
|
||||
iptables -I FORWARD -m set --match-set blockip dst -j DROP
|
||||
iptables -I OUTPUT -m set --match-set blockip dst -j DROP
|
||||
}
|
||||
|
||||
add_dns()
|
||||
{
|
||||
mkdir -p /var/etc/dnsmasq-adbyby.d
|
||||
mkdir -p /tmp/dnsmasq.d
|
||||
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_esc"'\n",$0)}' $PROG_PATH/adesc.conf > /var/etc/dnsmasq-adbyby.d/06-dnsmasq.esc
|
||||
awk '!/^$/&&!/^#/{printf("address=/%s/'"0.0.0.0"'\n",$0)}' $PROG_PATH/adblack.conf > /var/etc/dnsmasq-adbyby.d/07-dnsmasq.black
|
||||
|
||||
echo 'conf-dir=/var/etc/dnsmasq-adbyby.d' > /tmp/dnsmasq.d/dnsmasq-adbyby.conf
|
||||
|
||||
local var=1
|
||||
if [ $wan_mode -eq 1 ]; then
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_wan"'\n",$0)}' $PROG_PATH/adhost.conf > $WAN_FILE
|
||||
if ls /var/etc/dnsmasq-adbyby.d/* >/dev/null 2>&1; then
|
||||
mkdir -p /tmp/dnsmasq.d
|
||||
cp /usr/share/adbyby/dnsmasq.adblock /var/etc/dnsmasq-adbyby.d/04-dnsmasq.adblock
|
||||
cp /usr/share/adbyby/dnsmasq.ads /var/etc/dnsmasq-adbyby.d/05-dnsmasq.ads
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/adbyby/rules/data /tmp/adbyby/rules/host
|
||||
rm -f /tmp/adbyby/rules/data/* /tmp/adbyby/rules/host/*
|
||||
cp -a /usr/share/adbyby/rules/data/* /tmp/adbyby/rules/data 2>/dev/null
|
||||
cp -a /usr/share/adbyby/rules/host/* /tmp/adbyby/rules/host 2>/dev/null
|
||||
echo 'addn-hosts=/tmp/adbyby/rules/host/' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
|
||||
echo 'conf-dir=/tmp/adbyby/rules/data' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
|
||||
|
||||
[ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
|
||||
if [ $block_cnshort -eq 1 ]; then
|
||||
cat <<-EOF >/tmp/etc/dnsmasq-adbyby.d/08-dnsmasq.cnshort
|
||||
address=/api.amemv.com/0.0.0.0
|
||||
address=/.amemv.com/0.0.0.0
|
||||
address=/.tiktokv.com/0.0.0.0
|
||||
address=/.snssdk.com/0.0.0.0
|
||||
address=/.douyin.com/0.0.0.0
|
||||
address=/.ixigua.com/0.0.0.0
|
||||
address=/.pstatp.com/0.0.0.0
|
||||
address=/.ixiguavideo.com/0.0.0.0
|
||||
address=/.v.kandian.qq.com/0.0.0.0
|
||||
address=/.yximgs.com/0.0.0.0
|
||||
address=/.gifshow.com/0.0.0.0
|
||||
address=/.ksapisrv.com/0.0.0.0
|
||||
address=/.kuaishoupay.com/0.0.0.0
|
||||
address=/.ksyun.com/0.0.0.0
|
||||
address=/.live.xycdn.com/0.0.0.0
|
||||
address=/.danuoyi.alicdn.com/0.0.0.0
|
||||
address=/.v.weishi.qq.com/0.0.0.0
|
||||
address=/.pearvideo.com/0.0.0.0
|
||||
address=/.miaopai.com/0.0.0.0
|
||||
address=/.kuaishou.com/0.0.0.0
|
||||
address=/.qupai.me/0.0.0.0
|
||||
address=/.meipai.com/0.0.0.0
|
||||
address=/.huoshan.com/0.0.0.0
|
||||
address=/.ergengtv.com/0.0.0.0
|
||||
address=/.baijiahao.baidu.com/0.0.0.0
|
||||
address=/.xiongzhang.baidu.com/0.0.0.0
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
del_dns()
|
||||
{
|
||||
rm -f /tmp/dnsmasq.d/dnsmasq-adbyby.conf
|
||||
rm -f /var/etc/dnsmasq-adbyby.d/*
|
||||
rm -f /tmp/adbyby_host.conf
|
||||
}
|
||||
|
||||
|
||||
add_rule()
|
||||
{
|
||||
$ipt_n -N ADBYBY
|
||||
$ipt_n -A ADBYBY -d 0.0.0.0/8 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 10.0.0.0/8 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 127.0.0.0/8 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 169.254.0.0/16 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 172.16.0.0/12 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 192.168.0.0/16 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 224.0.0.0/4 -j RETURN
|
||||
$ipt_n -A ADBYBY -d 240.0.0.0/4 -j RETURN
|
||||
ip_rule
|
||||
if [ $(ipset list music -name -quiet | grep music) ]; then
|
||||
$ipt_n -A ADBYBY -m set --match-set music dst -j RETURN 2>/dev/null
|
||||
fi
|
||||
$ipt_n -A ADBYBY -p tcp -j REDIRECT --to-ports 8118 2>/dev/null
|
||||
$ipt_n -I PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
|
||||
|
||||
mkdir -p /var/etc
|
||||
echo -e "/etc/init.d/adbyby restart" > "/var/etc/adbyby.include"
|
||||
}
|
||||
|
||||
del_rule()
|
||||
{
|
||||
$ipt_n -D PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
|
||||
$ipt_n -F ADBYBY 2>/dev/null
|
||||
$ipt_n -X ADBYBY 2>/dev/null
|
||||
iptables -D FORWARD -m set --match-set blockip dst -j DROP 2>/dev/null
|
||||
iptables -D OUTPUT -m set --match-set blockip dst -j DROP 2>/dev/null
|
||||
ipset -F adbyby_esc 2>/dev/null
|
||||
ipset -X adbyby_esc 2>/dev/null
|
||||
ipset -F adbyby_wan 2>/dev/null
|
||||
ipset -X adbyby_wan 2>/dev/null
|
||||
ipset -F blockip 2>/dev/null
|
||||
ipset -X blockip 2>/dev/null
|
||||
}
|
||||
|
||||
reload_rule()
|
||||
{
|
||||
config_load adbyby
|
||||
config_foreach get_config adbyby
|
||||
del_rule
|
||||
[ $enable -eq 0 ] && exit 0
|
||||
add_rule
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load adbyby
|
||||
config_foreach get_config adbyby
|
||||
|
||||
if [ $enable -ne 0 ]; then
|
||||
add_cron
|
||||
[ ! -d "/tmp/adbyby/data" ] && cp -a /usr/share/adbyby /tmp/ && rm -f /tmp/adbyby.updated
|
||||
add_rules
|
||||
|
||||
/tmp/adbyby/adbyby >/dev/null 2>&1 &
|
||||
|
||||
add_dns
|
||||
add_rule
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
kill -9 $(busybox ps -w | grep "/tmp/adbyby/adbyby" | grep -v grep | grep -v update| grep -v adblock | awk '{print $1}') >/dev/null 2>&1
|
||||
config_load adbyby
|
||||
config_foreach get_config adbyby
|
||||
del_rule
|
||||
del_cron
|
||||
del_dns
|
||||
/etc/init.d/dnsmasq restart
|
||||
}
|
||||
|
||||
boot()
|
||||
{
|
||||
mkdir -p /tmp/adbyby && cp -a /usr/share/adbyby /tmp/
|
||||
start
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@adbyby[-1]
|
||||
add ucitrack adbyby
|
||||
set ucitrack.@adbyby[-1].init=adbyby
|
||||
commit ucitrack
|
||||
delete firewall.adbyby
|
||||
set firewall.adbyby=include
|
||||
set firewall.adbyby.type=script
|
||||
set firewall.adbyby.path=/var/etc/adbyby.include
|
||||
set firewall.adbyby.reload=1
|
||||
delete firewall.adblock
|
||||
add firewall rule
|
||||
rename firewall.@rule[-1]="adblock"
|
||||
set firewall.@rule[-1].name="adblock"
|
||||
set firewall.@rule[-1].target="DROP"
|
||||
set firewall.@rule[-1].src="wan"
|
||||
set firewall.@rule[-1].proto="tcp"
|
||||
set firewall.@rule[-1].dest_port="8118"
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
mkdir -p /etc/dnsmasq.d
|
||||
|
||||
/etc/init.d/adbyby stop
|
||||
/etc/init.d/adbyby enable
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
|
@ -1,6 +0,0 @@
|
|||
/usr/share/adbyby/adhost.conf
|
||||
/usr/share/adbyby/adblack.conf
|
||||
/usr/share/adbyby/blockip.conf
|
||||
/usr/share/adbyby/adesc.conf
|
||||
/usr/share/adbyby/rules.txt
|
||||
/usr/share/adbyby/dnsmasq.adblock
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
if [ -f /tmp/adnew.conf ]; then
|
||||
if (grep -wq "address=" /tmp/adnew.conf) ; then
|
||||
cp /tmp/adnew.conf /tmp/ad.conf
|
||||
elif (grep -wq "0.0.0.0" /tmp/adnew.conf) ; then
|
||||
cp /tmp/adnew.conf /tmp/ad.conf
|
||||
else
|
||||
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/ad.conf
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/adnew.conf
|
|
@ -1,14 +0,0 @@
|
|||
gvod.aiseejapp.atianqi.com
|
||||
stat.pandora.xiaomi.com
|
||||
upgrade.mishop.pandora.xiaomi.com
|
||||
logonext.tv.kuyun.com
|
||||
config.kuyun.com
|
||||
mishop.pandora.xiaomi.com
|
||||
dvb.pandora.xiaomi.com
|
||||
api.ad.xiaomi.com
|
||||
de.pandora.xiaomi.com
|
||||
data.mistat.xiaomi.com
|
||||
jellyfish.pandora.xiaomi.com
|
||||
gallery.pandora.xiaomi.com
|
||||
o2o.api.xiaomi.com
|
||||
bss.pandora.xiaomi.com
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
uclient-fetch --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf
|
||||
if [ -s "/tmp/adnew.conf" ];then
|
||||
/usr/share/adbyby/ad-update
|
||||
fi
|
||||
|
||||
rm -f /tmp/adbyby.updated
|
||||
sleep 10
|
||||
/etc/init.d/adbyby restart
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PROG_PATH=$(pwd)
|
||||
$PROG_PATH/adbybyupdate.sh
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -f "/tmp/adbyby.updated" ];then
|
||||
wget_ok="0"
|
||||
while [ "$wget_ok" = "0" ]
|
||||
do
|
||||
uclient-fetch --spider --quiet --timeout=3 http://www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
wget_ok="1"
|
||||
|
||||
touch /tmp/md5.json && uclient-fetch --no-check-certificate -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
adm5=$(md5sum /tmp/md5.json | awk -F' ' '{print $1}')
|
||||
touch /tmp/adbyby/admd5.json && bmd5=$(md5sum /tmp/adbyby/admd5.json | awk -F' ' '{print $1}')
|
||||
if [ "$adm5" == "$bmd5" ];then
|
||||
echo "Rules MD5 are the same!"
|
||||
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
exit 0
|
||||
elif [ -s /tmp/md5.json ];then
|
||||
|
||||
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
|
||||
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
|
||||
|
||||
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
|
||||
echo "adbyby rules MD5 OK!"
|
||||
mv /tmp/lazy.txt /tmp/adbyby/data/lazy.txt
|
||||
mv /tmp/video.txt /tmp/adbyby/data/video.txt
|
||||
mv /tmp/md5.json /tmp/adbyby/admd5.json
|
||||
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
fi
|
||||
fi
|
||||
else
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f /tmp/adbyby/data/*.bak
|
||||
|
||||
kill -9 $(busybox ps -w | grep "/tmp/adbyby/adbyby" | grep -v grep | grep -v update| grep -v adblock | awk '{print $1}') >/dev/null 2>&1
|
||||
/tmp/adbyby/adbyby >/dev/null 2>&1 &
|
||||
fi
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
weixin.qq.com
|
||||
qpic.cn
|
||||
imtt.qq.com
|
|
@ -1,68 +0,0 @@
|
|||
cbjs.baidu.com
|
||||
list.video.baidu.com
|
||||
nsclick.baidu.com
|
||||
play.baidu.com
|
||||
sclick.baidu.com
|
||||
tieba.baidu.com
|
||||
baidustatic.com
|
||||
bdimg.com
|
||||
bdstatic.com
|
||||
share.baidu.com
|
||||
hm.baidu.com
|
||||
v.baidu.com
|
||||
cpro.baidu.com
|
||||
1000fr.net
|
||||
atianqi.com
|
||||
56.com
|
||||
v-56.com
|
||||
acfun.com
|
||||
acfun.tv
|
||||
baofeng.com
|
||||
baofeng.net
|
||||
cntv.cn
|
||||
hoopchina.com.cn
|
||||
funshion.com
|
||||
fun.tv
|
||||
hitvs.cn
|
||||
hljtv.com
|
||||
iqiyi.com
|
||||
qiyi.com
|
||||
agn.aty.sohu.com
|
||||
itc.cn
|
||||
kankan.com
|
||||
ku6.com
|
||||
letv.com
|
||||
letvcloud.com
|
||||
letvimg.com
|
||||
pplive.cn
|
||||
pps.tv
|
||||
ppsimg.com
|
||||
pptv.com
|
||||
www.qq.com
|
||||
l.qq.com
|
||||
v.qq.com
|
||||
video.sina.com.cn
|
||||
tudou.com
|
||||
wasu.cn
|
||||
analytics-union.xunlei.com
|
||||
kankan.xunlei.com
|
||||
youku.com
|
||||
hunantv.com
|
||||
ifeng.com
|
||||
renren.com
|
||||
mediav.com
|
||||
cnbeta.com
|
||||
mydrivers.com
|
||||
168f.info
|
||||
doubleclick.net
|
||||
126.net
|
||||
sohu.com
|
||||
right.com.cn
|
||||
50bang.org
|
||||
you85.cn
|
||||
jiuzhilan.com
|
||||
googles.com
|
||||
cnbetacdn.com
|
||||
ptqy.gitv.tv
|
||||
admaster.com.cn
|
||||
serving-sys.com
|
|
@ -1,46 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -f "/tmp/adbyby.updated" ];then
|
||||
touch /tmp/adbyby.mem
|
||||
wget_ok="0"
|
||||
while [ "$wget_ok" = "0" ]
|
||||
do
|
||||
uclient-fetch --spider --quiet --tries=1 --timeout=3 www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
wget_ok="1"
|
||||
|
||||
touch /tmp/md5.json && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
adm5=$(md5sum /tmp/md5.json | awk -F' ' '{print $1}')
|
||||
touch /tmp/adbyby/admd5.json && bmd5=$(md5sum /tmp/adbyby/admd5.json | awk -F' ' '{print $1}')
|
||||
if [ "$adm5" == "$bmd5" ];then
|
||||
echo "Rules MD5 are the same!"
|
||||
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
exit 0
|
||||
else
|
||||
|
||||
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && uclient-fetch --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
|
||||
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
|
||||
|
||||
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
|
||||
echo "adbyby rules MD5 OK!"
|
||||
mv /tmp/lazy.txt /tmp/adbyby/data/lazy.txt
|
||||
mv /tmp/video.txt /tmp/adbyby/data/video.txt
|
||||
mv /tmp/md5.json /tmp/adbyby/admd5.json
|
||||
echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
fi
|
||||
fi
|
||||
else
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 10 && /etc/init.d/adbyby restart
|
||||
fi
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -f /usr/share/adbyby/data/*.bak
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /usr/share/adbyby/data/lazy.txt /usr/share/adbyby/data/video.txt > /tmp/local-md5.json
|
||||
touch /tmp/md5.json && uclient-fetch --no-check-certificate -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
|
||||
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
|
||||
|
||||
if [ "$lazy_online"x != "$lazy_local"x -o "$video_online"x != "$video_local"x ]; then
|
||||
echo "MD5 not match! Need update!"
|
||||
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
|
||||
echo "New rules MD5 match!"
|
||||
mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
|
||||
mv /tmp/video.txt /usr/share/adbyby/data/video.txt
|
||||
echo $(date +"%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
fi
|
||||
else
|
||||
echo "MD5 match! No need to update!"
|
||||
fi
|
||||
|
||||
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/local-md5.json /tmp/md5.json
|
|
@ -1 +0,0 @@
|
|||
2.2.2.2
|
|
@ -1,4 +0,0 @@
|
|||
address=/p.tanx.com/0.0.0.0
|
||||
address=/googlesyndication.com/0.0.0.0
|
||||
address=/linkvans.com/0.0.0.0
|
||||
server=/valf.atm.youku.com/114.114.114.114
|
|
@ -1,3 +0,0 @@
|
|||
ipset=/weixin.qq.com/adbyby_wan
|
||||
ipset=/qpic.cn/adbyby_wan
|
||||
ipset=/imtt.qq.com/adbyby_wan
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -f /tmp/blockip.ipset ];then
|
||||
|
||||
adbyby_enable=$(uci get adbyby.@adbyby[0].enable)
|
||||
|
||||
if [ $adbyby_enable -eq 1 ]; then
|
||||
if pidof adbyby>/dev/null; then
|
||||
/etc/init.d/adbyby reload_rule
|
||||
else
|
||||
/etc/init.d/adbyby restart
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
find $1 -type f -exec cat {} \; | wc -l
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
url_md5() {
|
||||
echo -n $1|md5sum|cut -d ' ' -f1
|
||||
}
|
||||
|
||||
convert_rules() {
|
||||
mkdir -p /tmp/rules/data
|
||||
mkdir -p /tmp/rules/host
|
||||
|
||||
uclient-fetch -q --no-check-certificate $1 -O /tmp/adnew.conf
|
||||
|
||||
rulename=$(url_md5 $1)
|
||||
|
||||
if [ -f /tmp/adnew.conf ]; then
|
||||
if (grep -wq "address=" /tmp/adnew.conf) ; then
|
||||
cp /tmp/adnew.conf /tmp/rules/data/$rulename.conf
|
||||
elif (grep -wq -e"0.0.0.0" -e"127.0.0.1" /tmp/adnew.conf) ; then
|
||||
cp /tmp/adnew.conf /tmp/rules/host/$rulename.txt
|
||||
else
|
||||
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/rules/data/$rulename.conf
|
||||
fi
|
||||
fi
|
||||
rm -rf /tmp/adnew.conf
|
||||
}
|
||||
|
||||
ARRAY=$(uci get adbyby.@adbyby[0].subscribe_url 2> /dev/null)
|
||||
|
||||
rm -rf /tmp/rules
|
||||
|
||||
i=1
|
||||
for j in $ARRAY
|
||||
do
|
||||
convert_rules $j
|
||||
i=`expr $i + 1`
|
||||
done
|
|
@ -1,15 +0,0 @@
|
|||
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
|
||||
! -------------- 规则基于abp规则,并进行了字符替换部分的扩展-----------------------------
|
||||
! ABP规则请参考https://adblockplus.org/zh_CN/filters,下面为大致摘要
|
||||
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
|
||||
! "*" 为字符通配符,能够匹配0长度或任意长度的字符串,该通配符不能与正则语法混用。
|
||||
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
|
||||
! "|" 为管线符号,来表示地址的最前端或最末端
|
||||
! "||" 为子域通配符,方便匹配主域名下的所有子域。
|
||||
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
|
||||
! "##" 为元素选择器标识符,后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
|
||||
!! 元素隐藏暂不支持全局规则和排除规则
|
||||
!! 字符替换扩展
|
||||
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
|
||||
! 支持通配符*和?
|
||||
! -------------------------------------------------------------------------------------------
|
Loading…
Add table
Add a link
Reference in a new issue