This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1248289414
committed
Mar 6, 2016
0 parents
commit ae9e725
Showing
27 changed files
with
5,363 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=adbyby | ||
PKG_VERSION:=2.7 | ||
PKG_RELEASE:=7.0 | ||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/adbyby | ||
SECTION:=utils | ||
CATEGORY:=Utilities | ||
TITLE:=adbyby 2.7 | ||
#PKGARCH:=x86 | ||
#PKGARCH:=ralink | ||
#PKGARCH:=ar71xx | ||
#PKGARCH:=ramips_24kec | ||
#PKGARCH:=all | ||
endef | ||
|
||
define Package/adbyby/description | ||
adkiller | ||
endef | ||
|
||
define Build/Prepare | ||
rm -rf $(PKG_INSTALL_DIR) | ||
mkdir $(PKG_INSTALL_DIR) | ||
#upx --best ./adbyby -o $(PKG_INSTALL_DIR)/adbyby-mini | ||
cp ./adbyby $(PKG_INSTALL_DIR)/adbyby-mini | ||
endef | ||
|
||
define Build/Compile | ||
endef | ||
|
||
define Package/adbyby/install | ||
$(INSTALL_DIR) $(1)/usr/share/adbyby/ | ||
$(INSTALL_DIR) $(1)/etc/config/ | ||
$(INSTALL_DIR) $(1)/etc/init.d/ | ||
$(CP) ./luci/* $(1) | ||
$(CP) ./data $(1)/usr/share/adbyby/ | ||
$(CP) ./doc $(1)/usr/share/adbyby/ | ||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/adbyby-mini $(1)/usr/share/adbyby/adbyby | ||
$(INSTALL_BIN) ./bin/* $(1)/usr/share/adbyby/ | ||
$(INSTALL_DATA) ./adbyby.config $(1)/etc/config/adbyby | ||
$(INSTALL_BIN) ./adbyby.init $(1)/etc/init.d/adbyby | ||
$(INSTALL_BIN) ./firewall.include $(1)/usr/share/adbyby/ | ||
endef | ||
|
||
define Package/adbyby/postinst | ||
#!/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=/usr/share/adbyby/firewall.include | ||
set firewall.adbyby.reload=1 | ||
commit firewall | ||
EOF | ||
rm -f /tmp/luci-indexcache | ||
/etc/init.d/adbyby enable && echo "设置开机自启动成功" | ||
/etc/init.d/adbyby start && echo "ADBYBY启动成功" | ||
echo "==============================================" | ||
echo "==============================================" | ||
echo | ||
echo "ADBYBY安装成功!" | ||
echo | ||
echo | ||
echo "享受无广告的网络体验吧!" | ||
echo | ||
echo "==============================================" | ||
echo "==============================================" | ||
[ -n "$(pgrep /usr/share/adbyby/adbyby)" ] && echo "ADBYBY已启动" | ||
exit 0 | ||
endef | ||
|
||
define Package/adbyby/postrm | ||
endef | ||
|
||
$(eval $(call BuildPackage,adbyby)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
config adbyby | ||
option adbyby_mode '0' | ||
option port '80' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/bin/sh /etc/rc.common | ||
#by 1248289414 | ||
|
||
START=99 | ||
STOP=01 | ||
|
||
SERVICE_DAEMONIZE=1 | ||
|
||
rule() | ||
{ | ||
rule_add(){ | ||
local value="$1" | ||
echo >> /tmp/adbyby_user.txt | ||
wget -O- $value >> /tmp/adbyby_user.txt -t 5 --quiet --no-check-certificate | ||
sleep 1 | ||
} | ||
[ ! -h /usr/share/adbyby/data/user.txt ] && ln -s /tmp/adbyby_user.txt /usr/share/adbyby/data/user.txt | ||
rm -f /usr/share/adbyby/data/user.bin | ||
cat /usr/share/adbyby/user.txt > /tmp/adbyby_user.txt | ||
config_list_foreach $1 address rule_add | ||
} | ||
|
||
clean_rules() | ||
{ | ||
until [ -z "$(iptables-save -t nat | grep "zone_lan_prerouting" | grep "ADBYBY_RULE")" ] | ||
do | ||
iptables -t nat -D $(iptables-save -t nat | grep "zone_lan_prerouting" | grep "ADBYBY_RULE" | sed 's/^-A //g') | ||
sleep 1 | ||
done | ||
iptables -t nat -F ADBYBY_RULE 2>/dev/null | ||
iptables -t nat -X ADBYBY_RULE 2>/dev/null | ||
} | ||
|
||
add_rules() | ||
{ | ||
add_exdomain(){ | ||
local value="$1" | ||
iptables -t nat -A ADBYBY_RULE -d $value -j RETURN | ||
} | ||
white_rule(){ | ||
local value="$1" | ||
iptables -t nat -A ADBYBY_RULE -s $value -p tcp -j REDIRECT --to-ports 8118 | ||
} | ||
black_rule(){ | ||
local value="$1" | ||
iptables -t nat -A ADBYBY_RULE -s $value -j RETURN | ||
} | ||
ban_host(){ | ||
local value="$1" | ||
iptables -t nat -A ADBYBY_RULE -s $value -p tcp -j REDIRECT --to-ports 8118 | ||
} | ||
clean_rules | ||
config_get adbyby_mode $1 adbyby_mode 0 | ||
[ $adbyby_mode = 4 ] && return 0 | ||
iptables -t nat -N ADBYBY_RULE | ||
iptables -t nat -A ADBYBY_RULE -d 0.0.0.0/8 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 10.0.0.0/8 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 127.0.0.0/8 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 169.254.0.0/16 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 172.16.0.0/12 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 192.168.0.0/16 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 224.0.0.0/4 -j RETURN | ||
iptables -t nat -A ADBYBY_RULE -d 240.0.0.0/4 -j RETURN | ||
config_list_foreach $1 exdomain add_exdomain | ||
config_get port $1 port 80 | ||
case $adbyby_mode in | ||
0) | ||
iptables -t nat -A ADBYBY_RULE -p tcp -j REDIRECT --to-ports 8118 | ||
;; | ||
1) | ||
config_list_foreach $1 adbyby_list white_rule | ||
iptables -t nat -A ADBYBY_RULE -j RETURN | ||
;; | ||
2) | ||
config_list_foreach $1 adbyby_list black_rule | ||
iptables -t nat -A ADBYBY_RULE -p tcp -j REDIRECT --to-ports 8118 | ||
;; | ||
3) | ||
config_list_foreach $1 host_list ban_host | ||
iptables -t nat -A ADBYBY_RULE -j RETURN | ||
;; | ||
esac | ||
[ -n "$(pgrep /usr/share/adbyby/adbyby)" ] && iptables -t nat -I zone_lan_prerouting -p tcp -m multiport --dport $port -j ADBYBY_RULE | ||
} | ||
|
||
boot() | ||
{ | ||
until iptables-save -t nat | grep -q "^:zone_lan_prerouting"; do | ||
sleep 1 | ||
done | ||
start | ||
} | ||
|
||
start() | ||
{ | ||
config_load adbyby | ||
config_foreach rule adbyby | ||
service_start /usr/share/adbyby/adbyby | ||
until pgrep /usr/share/adbyby/adbyby >>/dev/null ; do | ||
sleep 1 | ||
done | ||
config_foreach add_rules adbyby | ||
} | ||
|
||
stop() | ||
{ | ||
clean_rules | ||
service_stop /usr/share/adbyby/adbyby | ||
} | ||
|
||
reload() | ||
{ | ||
restart | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
echo "hehe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
echo "hehe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[info] | ||
id=ar71xx | ||
[update] | ||
rule=video,lazya | ||
|
||
[cfg] | ||
listen-address=0.0.0.0:8118 | ||
buffer-limit=1024 | ||
keep-alive-timeout=30 | ||
socket-timeout=60 | ||
max_client_connections=0 | ||
stack_size=200 | ||
auto_restart=0 | ||
debug=0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
ipset -N adbyby_list hash:ip | ||
iptables -t nat -A PREROUTING -p tcp -m set --match-set adbyby_list dst -j REDIRECT --to-port 8118 | ||
|
||
sed -e '/.*adbyby_host.conf/d' -i /etc/dnsmasq.conf | ||
echo "conf-file=/tmp/adbyby_host.conf" >> "/etc/dnsmasq.conf" | ||
|
||
#/etc/storage/dnsmasq/dnsmasq.conf | ||
restart_dhcpd | ||
/etc/init.d/dnsmasq restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
./adbyby& | ||
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
killall adbyby | ||
iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
;���¹���url,dir,size,reverse,reverse | ||
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 236367 4 0 | ||
http://update.adbyby.com/rule3/video.jpg \data\video.txt 3174 4 0 | ||
http://update.adbyby.com/rule3/user.action \user.action 666 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 | ||
!���³���url,dir,size,reverse,reverse | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{+fast-redirects{s@&plid=\d+&uid=@&plid=7038006&uid=@} } | ||
hot.vrs.sohu.com/vrs_flash.action\?vid= | ||
{+fast-redirects{s@/Main.swf\?(?!plid)@/Main.swf?plid=7038006&@} } | ||
tv.sohu.com/upload/swf/201.*?/Main.swf\? | ||
{+fast-redirects{s@http://tv.sohu.com/upload/swf/.*?/PlayerShell.swf@http://update.adbyby.com/swf/sohu_livezb.swf@} } | ||
tv.sohu.com/upload/swf/.*?/PlayerShell.swf\? | ||
{+fast-redirects{s@pl.youku.com/playlist/m3u8\?keyframe=0&.*@update.adbyby.com/youku.m3u8@} } | ||
pl.youku.com/playlist/m3u8\?keyframe=0& | ||
{+fast-redirects{s@www.iqiyi.com/common/flashplayer/201.*?/MainPlayer_5_.*?.swf@update.adbyby.com/swf/iqiyi5.swf@} } | ||
www.iqiyi.com/common/flashplayer/201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!------------------------------自定义规则列表--------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//youku | ||
-y%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
//youku win7 | ||
-y%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
//chrome YOUKU | ||
-y%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
//360 youku | ||
-y%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
//sougou youku | ||
-y%appdata%\SogouExplorer\Webkit\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
|
||
-y%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
-y%userprofile%\Local Settings\Application Data\UCBrowser\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
-y%userprofile%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol | ||
|
||
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\*.* | ||
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\GDT_0\*.* | ||
|
||
//letv | ||
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol | ||
|
||
//letv1 | ||
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\com.letv.sol | ||
|
||
//iqiyi | ||
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol | ||
|
||
//iqiyi1 | ||
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol | ||
|
||
|
||
//chrome LeTv | ||
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol | ||
|
||
//chrome iqiyi | ||
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol | ||
|
||
//360 letv | ||
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol | ||
|
||
//360 iqiyi | ||
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol |
Oops, something went wrong.