diff --git a/README.md b/README.md index 1a919a3..57bb341 100644 --- a/README.md +++ b/README.md @@ -24,23 +24,7 @@ Anywhere停止链接 anywhere://share/J2VP8X5qVhbI2sRvhZ2hdp4467QzpcHDlkAQil7Mg6oDOLdzYgAJO+9fKKenP2M28XWZ71jveGDq1E/sCmMAhBqd5N04LZkJp0EYtrFp7Vw9xPsYBhlmwlaKWljr9iIAMGWOulpW7Zzhm/tpfaDIKjweOGfIsONgcoWq89Idmb215WTrhfju+OeoNqDicBqrOLI5iyI8fTCQifRm7m7hq53WMgN/BoYbWnyE34AeVO2hq5btVggCTBGunrftXnlweSY4ngaN8CmhTlDWQeyjMJRZMooTPHwcQm3fisvBY6McMaVV5lSLHBe+MNaK1EwnzQ0RjNJh/3eoVGQJgUUyN8swAmtakrwaNA== ``` -# 原理 -本插件实现方法非常简单,利用了iptables进行流量转发,将53端口的流量转发到5591也就是本插件设置的AdGuardHome端口 - -- apply_iptables.sh 片段 -```sh -# 返回所有 AdGuardHome 的请求 -iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_admin -j RETURN -# 将 53 端口所有 udp tcp 流量转发到 adguard home -iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591 -iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591 -``` -- service.sh 片段 -```sh -setuidgid root:net_admin "$ADG_DIR/AdGuardHome" & -``` - -其将AdGuardHome程序的用户设置为net_admin,然后在规则排除掉net_admin的请求(否则会导致网络回环) # 鸣谢 - [AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk) -- [akashaProxy](https://github.com/ModuleList/akashaProxy) \ No newline at end of file +- [akashaProxy](https://github.com/ModuleList/akashaProxy) +- [box_for_magisk](https://github.com/taamarin/box_for_magisk) \ No newline at end of file diff --git a/apply_iptables.sh b/apply_iptables.sh index 4c1b3d9..53ec820 100644 --- a/apply_iptables.sh +++ b/apply_iptables.sh @@ -2,6 +2,8 @@ iptables -t nat -N ADGUARD # 返回所有 AdGuardHome 的请求 iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_admin -j RETURN # 将 53 端口所有 udp tcp 流量转发到 adguard home +# iptables -t nat -A ADGUARD -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:5591 +# iptables -t nat -A ADGUARD -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:5591 iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591 iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591 # 将 ADGUARD 规则添加到 OUTPUT diff --git a/bin/AdGuardHome b/bin/AdGuardHome index 772620c..7014351 100644 Binary files a/bin/AdGuardHome and b/bin/AdGuardHome differ diff --git a/bin/AdGuardHome.yaml b/bin/AdGuardHome.yaml index cad5b3f..a106ad0 100644 --- a/bin/AdGuardHome.yaml +++ b/bin/AdGuardHome.yaml @@ -23,16 +23,16 @@ dns: ratelimit_whitelist: [] refuse_any: true upstream_dns: - - '#https://1.12.12.12/dns-query' - - '#https://120.53.53.53/dns-query' - - '#https://223.5.5.5/dns-query' - - '#https://223.6.6.6/dns-query' - - 223.5.5.5 + - https://1.12.12.12/dns-query + - https://120.53.53.53/dns-query + - https://223.5.5.5/dns-query + - https://223.6.6.6/dns-query upstream_dns_file: "" bootstrap_dns: - - 0.0.0.0 + - 1.1.1.1 + - 8.8.8.8 fallback_dns: - - '#https://1.1.1.1/dns-query' + - https://1.1.1.1/dns-query upstream_mode: load_balance fastest_timeout: 1s allowed_clients: [] @@ -69,7 +69,6 @@ dns: serve_http3: false use_http3_upstreams: false serve_plain_dns: true - hostsfile_enabled: true tls: enabled: false server_name: "" @@ -86,14 +85,12 @@ tls: private_key_path: "" strict_sni_check: false querylog: - dir_path: "" ignored: [] interval: 6h size_memory: 1000 enabled: true file_enabled: true statistics: - dir_path: "" ignored: [] interval: 24h enabled: true @@ -137,7 +134,7 @@ filtering: pixabay: true yandex: true youtube: true - blocking_mode: default + blocking_mode: null_ip parental_block_host: family-block.dns.adguard.com safebrowsing_block_host: standard-block.dns.adguard.com rewrites: [] @@ -145,7 +142,7 @@ filtering: safesearch_cache_size: 1048576 parental_cache_size: 1048576 cache_time: 30 - filters_update_interval: 72 + filters_update_interval: 168 blocked_response_ttl: 30 filtering_enabled: true parental_enabled: false @@ -171,4 +168,4 @@ os: group: "" user: "" rlimit_nofile: 0 -schema_version: 28 +schema_version: 27 diff --git a/bin/data/filters/10086.txt b/bin/data/filters/10086.txt new file mode 100644 index 0000000..1cd76ca --- /dev/null +++ b/bin/data/filters/10086.txt @@ -0,0 +1,580 @@ +||1010pic.com^ +||123.56.23.22^ +||182.254.116.116^ +||203.205.137.89^ +||8le8le.com^ +||a0.app.xiaomi.com^ +||aaid.umeng.com^ +||ad-scope.com^ +||ad-scope.com.cn^ +||ad-sdk.huxiu.com^ +||ad.12306.cn^ +||ad.51wnl.com^ +||ad.bwton.com^ +||ad.cyapi.cn^ +||ad.flurry.com^ +||ad.partner.gifshow.com^ +||ad.qingting.fm^ +||ad.qq.com^ +||ad.richmob.cn^ +||ad.tencentmusic.com^ +||ad.toutiao.com^ +||ad.winrar.com.cn^ +||ad.xelements.cn^ +||ad.xiaomi.com^ +||ad.ximalaya.com^ +||ad.zijieapi.com^ +||adapi.izuiyou.com^ +||adapi.yynetwk.com^ +||adashbc.ut.taobao.com^ +||adc.hpplay.cn^ +||adcdn.hpplay.cn^ +||adcdn.tencentmusic.com^ +||adclick.tencentmusic.com^ +||adcolony.com^ +||adeng.hpplay.cn^ +||adexpo.tencentmusic.com^ +||adfilter.imtt.qq.com^ +||adjust.cn^ +||adkwai.com^ +||adlink-api.huan.tv^ +||adlog.flurry.com^ +||ads-api-o.api.leiniao.com^ +||ads-api.tiktok.com^ +||ads-api.twitter.com^ +||ads-img-qc.xhscdn.com^ +||ads-video-al.xhscdn.com^ +||ads-video-qc.xhscdn.com^ +||ads.95516.com^ +||ads.flurry.com^ +||ads.google.cn^ +||ads.heytapmobi.com^ +||ads.huan.tv^ +||ads.huantest.com^ +||ads.icloseli.cn^ +||ads.music.126.net^ +||ads.oppomobile.com^ +||ads.service.kugou.com^ +||ads.service.kugou.com^ +||ads3-normal.zijieapi.com^ +||ads3-normal-hl.zijieapi.com^ +||ads3-normal-lq.zijieapi.com^ +||ads5-normal-hl.zijieapi.com^ +||ads5-normal-lf.zijieapi.com^ +||ads5-normal-lq.zijieapi.com^ +||ads5-normal.zijieapi.com^ +||adsense.google.cn^ +||adservice.google.cn^ +||adservice.google.com^ +||adserviceretry.kugou.com^ +||adsfile.bssdlbig.kugou.com^ +||adsfile.bssdlbig.kugou.com^ +||adsfilebssdlbig.ali.kugou.com^ +||adsfileretry.service.kugou.com^ +||adsfs-sdkconfig.heytapimage.com^ +||adsfs.oppomobile.com^ +||adsmart.konka.com^ +||adsmind.gdtimg.com^ +||adsmind.ugdtimg.com^ +||adsp.xunlei.com^ +||adstats.tencentmusic.com^ +||adtago.s3.amazonaws.com^ +||adtech.yahooinc.com^ +||adtrack.quark.cn^ +||adukwai.com^ +||adv.sec.intl.miui.com^ +||adv.sec.miui.com^ +||advertiseonbing.azureedge.net^ +||advertising-api-eu.amazon.com^ +||advertising.apple.com^ +||advertising.yahoo.com^ +||advertising.yandex.ru^ +||advice-ads.s3.amazonaws.com^ +||adview.cn^ +||adx-ad.smart-tv.cn^ +||adx-cn.anythinktech.com^ +||adx-drcn.op.dbankcloud.cn^ +||adx.ads.heytapmobi.com^ +||adx.ads.oppomobile.com^ +||adxlog-adnet.vivo.com.cn^ +||adxlog-adnet.vivo.com.cn.dsa.dnsv1.com.cn^ +||afs.googlesyndication.com^ +||ali-ad.a.yximgs.com^ +||amdcopen.m.taobao.com^ +||an.facebook.com^ +||analysis.yozocloud.cn^ +||analytics-api.samsunghealthcn.com^ +||analytics.126.net^ +||analytics.95516.com^ +||analytics.google.com^ +||analytics.pinterest.com^ +||analytics.rayjump.com^ +||analytics.tiktok.com^ +||analytics.woozooo.com^ +||analyze.lemurbrowser.com^ +||api-access.pangolin-sdk-toutiao.com^ +||api-access.pangolin-sdk-toutiao1.com^ +||api-access.pangolin-sdk-toutiao2.com^ +||api-access.pangolin-sdk-toutiao3.com^ +||api-access.pangolin-sdk-toutiao4.com^ +||api-access.pangolin-sdk-toutiao5.com^ +||api-ad-product.huxiu.com^ +||api-adservices.apple.com^ +||api-htp.beizi.biz^ +||api.ad.xiaomi.com^ +||api.htp.hubcloud.com.cn^ +||api.hzsanjiaomao.com^ +||api.installer.xiaomi.com^ +||api.kingdata.ksyun.com^ +||api.statsig.com^ +||api5-normal-quic-lf.ixigua.com^ +||apiyd.my91app.com^ +||apks.webxiaobai.top^ +||app-measurement.com^ +||appcloud2.in.zhihu.com^ +||applog.lc.quark.cn^ +||applog.uc.cn^ +||applog.zijieapi.com^ +||ata-sdk-uuid-report.dreport.meituan.net^ +||audid-api.taobao.com^ +||audid.umeng.com^ +||authenticate.chiq-cloud.com^ +||azr.footprintdns.com^ +||b1-data.ads.heytapmobi.com^ +||bdapi-ads.realmemobile.com^ +||bdapi-in-ads.realmemobile.com^ +||bdapi.ads.oppomobile.com^ +||beacon-api.aliyuncs.com^ +||beacon.qq.com^ +||beacons.gvt2.com^ +||beizi.biz^ +||bingads.microsoft.com^ +||bj.ad.track.66mobi.com^ +||books-analytics-events.apple.com^ +||bugly.qq.com^ +||business-api.tiktok.com^ +||c.evidon.com^ +||c.gj.qq.com^ +||c.kuaiduizuoye.com^ +||c.sayhi.360.cn^ +||c2.gdt.qq.com^ +||catalog.fjwhcbsh.com^ +||ccs.umeng.com^ +||cdn-ads.oss-cn-shanghai.aliyuncs.com^ +||cdn.ad.xiaomi.com^ +||cdn.ynuf.aliapp.org^ +||cfg.imtt.qq.com^ +||chat1.jd.com^ +||ck.ads.oppomobile.com^ +||clog.miguvideo.com^ +||cm.bilibili.com^ +||cnzz.com^ +||collect.kugou.com^ +||commdata.v.qq.com^ +||config.chsmarttv.com^ +||crashlytics.com^ +||crashlyticsreports-pa.googleapis.com^ +||csjplatform.com^ +||data.ads.oppomobile.com^ +||data.chsmarttv.com^ +||data.mistat.india.xiaomi.com^ +||data.mistat.rus.xiaomi.com^ +||data.mistat.xiaomi.com^ +||dataflow.biliapi.com^ +||diagnosis.ad.xiaomi.com^ +||dig.bdurl.net^ +||dl.zuimeitianqi.com^ +||dlogs.bwton.com^ +||dm.toutiao.com^ +||domain.aishengji.com^ +||doubleclick-cn.net^ +||doubleclick.net^ +||download.changhong.upgrade2.huan.tv^ +||downloadxml.changhong.upgrade2.huan.tv^ +||drcn-weather.cloud.huawei.com^ +||dsp-x.jd.com^ +||dsp.fcbox.com^ +||dualstack-logs.amap.com^ +||dutils.com^ +||dxp.baidu.com^ +||e.ad.xiaomi.com^ +||eclick.baidu.com^ +||ef-dongfeng.tanx.com^ +||entry.baidu.com^ +||errlog.umeng.com^ +||errnewlog.umeng.com^ +||event.tradplusad.com^ +||events-drcn.op.dbankcloud.cn^ +||firebaselogging-pa.googleapis.com^ +||flurry.com^ +||g-staic.ganjingworld.com^ +||g-staic.ganjingworld.com^ +||g2.ganjing.world^ +||game.loveota.com^ +||gdfp.gifshow.com^ +||gemini.yahoo.com^ +||globalapi.ad.xiaomi.com^ +||google-analytics.com^ +||googleadservices-cn.com^ +||googleadservices.com^ +||googletagservices-cn.com^ +||googletagservices.com^ +||gromore.pangolin-sdk-toutiao.com^ +||grs.dbankcloud.com^ +||grs.hicloud.com^ +||grs.platform.dbankcloud.ru^ +||h-adashx.ut.taobao.com^ +||h.trace.qq.com^ +||henzanapp.com^ +||hexagon-analytics.com^ +||hiboard-drcn.ai.dbankcloud.cn^ +||hm.baidu.com^ +||hmma.baidu.com^ +||httpdns.bcelive.com^ +||httpdns.huaweicloud.com^ +||httpdns.ocloud.oppomobile.com^ +||httpdns.push.oppomobile.com^ +||hugelog.fcbox.com^ +||hw-ot-ad.a.yximgs.com^ +||hw.zuimeitianqi.com^ +||hwpub-s01-drcn.cloud.dbankcloud.cn^ +||hya.comp.360os.com^ +||hye.comp.360os.com^ +||hyt.comp.360os.com^ +||i.snssdk.com^ +||iad.apple.com^ +||iadctest.qwapi.com^ +||iadsdk.apple.com^ +||iadworkbench.apple.com^ +||ifs.tanx.com^ +||image-ad.sm.cn^ +||imageplus.baidu.com^ +||images.pinduoduo.com^ +||img-c.heytapimage.com^ +||img.adnyg.com^ +||img.adnyg.com.w.kunlungr.com^ +||imtmp.net^ +||irc.qubiankeji.com^ +||is.snssdk.com^ +||ixav-cse.avlyun.com^ +||iyfbodn.com^ +||janapi.jd.com^ +||jfapi.chiq-cloud.com^ +||jiguang.cn^ +||jpush.cn^ +||jpush.html5.qq.com^ +||jpush.io^ +||jswebcollects.kugou.com^ +||kepler.jd.com^ +||kl.67it.com^ +||knicks.jd.com^ +||ks.pull.yximgs.com^ +||launcher.smart-tv.cn^ +||launcherimg.smart-tv.cn^ +||lf1-cdn-tos.bytegoofy.com^ +||lf3-ad-union-sdk.pglstatp-toutiao.com^ +||liveats-vod.video.ptqy.gitv.tv^ +||livemonitor.huan.tv^ +||lm10111.jtrincc.cn^ +||log-api-mn.huxiu.com^ +||log-api.huxiu.com^ +||log-api.pangolin-sdk-toutiao-b.com^ +||log-api.pangolin-sdk-toutiao.com^ +||log-report.com^ +||log-sdk.gifshow.com^ +||log-upload-os.hoyoverse.com^ +||log-upload.mihoyo.com^ +||log.ad.xiaomi.com^ +||log.aispeech.com^ +||log.appstore3.huan.tv^ +||log.avlyun.com^ +||log.avlyun.sec.intl.miui.com^ +||log.byteoversea.com^ +||log.fc.yahoo.com^ +||log.kuwo.cn^ +||log.snssdk.com^ +||log.stat.kugou.com^ +||log.stat.kugou.com^ +||log.tagtic.cn^ +||log.tbs.qq.com^ +||log.vcgame.cn^ +||log.web.kugou.com^ +||log.web.kugou.com^ +||log.zijieapi.com^ +||log1.cmpassport.com^ +||logbak.hicloud.com^ +||logs.amap.com^ +||logservice.hicloud.com^ +||logservice1.hicloud.com^ +||logtj.kugou.com^ +||logupdate.avlyun.sec.miui.com^ +||m.kubiqq.com^ +||m1.ad.10010.com^ +||mapi.m.jd.com^ +||masdkv6.3g.qq.com^ +||mazu.m.qq.com^ +||mdp-usertrace-cn.heytapmobi.com^ +||metok.sys.miui.com^ +||metrics.apple.com^ +||metrics.data.hicloud.com^ +||metrics.icloud.com^ +||metrics.mzstatic.com^ +||metrics2.data.hicloud.com^ +||mi.gdt.qq.com^ +||miav-cse.avlyun.com^ +||mine.baidu.com^ +||mission-pub.smart-tv.cn^ +||miui-fxcse.avlyun.com^ +||mnqlog.ldmnq.com^ +||mobads-logs.baidu.com^ +||mobads-pre-config.cdn.bcebos.com^ +||mobads.baidu.com^ +||mobilelog.upqzfile.com^ +||mobileservice.cn^ +||mon.zijieapi.com^ +||monitor-ads-test.huan.tv^ +||monitor.music.qq.com^ +||monitor.uu.qq.com^ +||monsetting.toutiao.com^ +||mssdk.volces.com^ +||mssdk.zijieapi.com^ +||mtj.baidu.com^ +||newvoice.chiq5.smart-tv.cn^ +||nmetrics.samsung.com^ +||notes-analytics-events.apple.com^ +||nsclick.baidu.com^ +||o2o.api.xiaomi.com^ +||oauth-login-drcn.platform.dbankcloud.com^ +||offerwall.yandex.net^ +||open.e.kuaishou.cn^ +||open.e.kuaishou.com^ +||open.kuaishouzt.com^ +||open.kwaishouzt.com^ +||open.kwaizt.com^ +||optimus-ads.amap.com^ +||orbit.jd.com^ +||oth.eve.mdt.qq.com^ +||oth.str.mdt.qq.com^ +||p.l.qq.com^ +||p.s.360.cn^ +||p1-be-pack-sign.pglstatp-toutiao.com^ +||p1-lm.adkwai.com^ +||p2-be-pack-sign.pglstatp-toutiao.com^ +||p2-lm.adkwai.com^ +||p3-be-pack-sign.pglstatp-toutiao.com^ +||p3-lm.adkwai.com^ +||p3-tt.byteimg.com^ +||p4-be-pack-sign.pglstatp-toutiao.com^ +||p5-be-pack-sign.pglstatp-toutiao.com^ +||p6-be-pack-sign.pglstatp-toutiao.com^ +||pagead2.googleadservices.com^ +||pagead2.googlesyndication.com^ +||panglelog.gz.bcebos.com^ +||pangolin-sdk-toutiao-b.com^ +||pgdt.ugdtimg.com^ +||pglstatp-toutiao.com^ +||pig.pupuapi.com^ +||pixon.ads-pixiv.net^ +||policy.video.ptqy.gitv.tv^ +||proxy.advp.apple.com^ +||public.gdtimg.com^ +||q.i.gdt.qq.com^ +||qqdata.ab.qq.com^ +||qwapi.apple.com^ +||qzs.gdtimg.com^ +||recommend-drcn.hms.dbankcloud.cn^ +||res.hubcloud.com.cn^ +||res1.hubcloud.com.cn^ +||res2.hubcloud.com.cn^ +||res3.hubcloud.com.cn^ +||review.gdtimg.com^ +||rms-drcn.platform.dbankcloud.cn^ +||roi.soulapp.cn^ +||rpt.gdt.qq.com^ +||rtb.voiceads.cn^ +||s1.qq.com^ +||s2.qq.com^ +||s3.qq.com^ +||samsung-com.112.2o7.net^ +||samsungads.com^ +||sanme2.taisantech.com^ +||saveu5-normal-lq.zijieapi.com^ +||scdown.qq.com^ +||sdk-ab-config.qquanquan.com^ +||sdk-cache.video.ptqy.gitv.tv^ +||sdk.beizi.biz^ +||sdk.e.qq.com^ +||sdk.hzsanjiaomao.com^ +||sdk.mobads.adwangmai.com^ +||sdkconf.avlyun.com^ +||sdkconfig.ad.intl.xiaomi.com^ +||sdkconfig.ad.xiaomi.com^ +||sdkconfig.video.qq.com^ +||sdkoptedge.chinanetcenter.com^ +||sdktmp.hubcloud.com.cn^ +||sdownload.stargame.com^ +||search.ixigua.com^ +||search3-search.ixigua.com^ +||search5-search-hl.ixigua.com^ +||search5-search.ixigua.com^ +||securemetrics.apple.com^ +||sensors-log.dongqiudi.com^ +||service.changhong.upgrade2.huan.tv^ +||service.vmos.cn^ +||sf16-static.i18n-pglstatp.com^ +||sf3-fe-tos.pglstatp-toutiao.com^ +||shouji.sogou.com^ +||sigmob.com^ +||sigmob.cn^ +||skdisplay.jd.com^ +||slb-p2p.vcloud.ks-live.com^ +||smartad.10010.com^ +||smetrics.samsung.com^ +||sms.ads.oppomobile.com^ +||sngmta.qq.com^ +||stat.y.qq.com^ +||static.ads-twitter.com^ +||statics.woozooo.com^ +||staticsns.cdn.bcebos.com^ +||stats.qiumibao.com^ +||statsigapi.net^ +||stg-data.ads.heytapmobi.com^ +||storage.moegirl.org.cn^ +||success.ctobsnssdk.com^ +||syh-imp.cdnjtzy.com^ +||t-dsp.pinduoduo.com^ +||t.l.qq.com^ +||t.track.ad.xiaomi.com^ +||t1.a.market.xiaomi.com^ +||t2.a.market.xiaomi.com^ +||t3.a.market.xiaomi.com^ +||tangram.e.qq.com^ +||tdc.qq.com^ +||tdid.m.qq.com^ +||tdsdk.cpatrk.net^ +||tdsdk.xdrig.com^ +||terms-drcn.platform.dbankcloud.cn^ +||test.ad.xiaomi.com^ +||test.e.ad.xiaomi.com^ +||tj.b.qq.com^ +||tj.video.qq.com^ +||tmead.y.qq.com^ +||tmfmazu-wangka.m.qq.com^ +||tmfmazu.m.qq.com^ +||tmfsdk.m.qq.com^ +||tmfsdktcpv4.m.qq.com^ +||tnc3-aliec1.toutiaoapi.com^ +||tnc3-aliec2.bytedance.com^ +||tnc3-aliec2.toutiaoapi.com^ +||tnc3-alisc1.bytedance.com^ +||tnc3-alisc1.zijieapi.com^ +||tnc3-alisc2.zijieapi.com^ +||tnc3-bjlgy.bytedance.com^ +||tnc3-bjlgy.toutiaoapi.com^ +||tnc3-bjlgy.zijieapi.com^ +||toblog.ctobsnssdk.com^ +||trace.qq.com^ +||tracelog-debug.qquanquan.com^ +||track.lc.quark.cn^ +||track.uc.cn^ +||tracker.ai.xiaomi.com^ +||tracker.gitee.com^ +||tracking.miui.com^ +||tracking.rus.miui.com^ +||tvuser-ch.cedock.com^ +||tx-ad.a.yximgs.com^ +||tx-kmpaudio.pull.yximgs.com^ +||tz.sec.xiaomi.com^ +||uapi.ads.heytapmobi.com^ +||uapi.chiq-cloud.com^ +||ucstat.baidu.com^ +||ulog-sdk.gifshow.com^ +||ulogjs.gifshow.com^ +||ulogs.umeng.com^ +||ulogs.umengcloud.com^ +||umengacs.m.taobao.com^ +||umengjmacs.m.taobao.com^ +||umsns.com^ +||union.baidu.com^ +||update.avlyun.sec.miui.com^ +||update.lejiao.tv^ +||us.l.qq.com^ +||v.adintl.cn^ +||v.adx.hubcloud.com.cn^ +||v1-ad.video.yximgs.com^ +||v2-ad.video.yximgs.com^ +||v2.gdt.qq.com^ +||v3-ad.video.yximgs.com^ +||video-dsp.pddpic.com^ +||vlive.qqvideo.tc.qq.com^ +||vungle.com^ +||w.l.qq.com^ +||w1.askwai.com^ +||w1.bskwai.com^ +||w1.cskwai.com^ +||w1.dskwai.com^ +||w1.eskwai.com^ +||w1.fskwai.com^ +||w1.gskwai.com^ +||w1.hskwai.com^ +||w1.iskwai.com^ +||w1.jskwai.com^ +||w1.kskwai.com^ +||w1.lskwai.com^ +||w1.mskwai.com^ +||w1.nskwai.com^ +||w1.oskwai.com^ +||w1.pskwai.com^ +||w1.qskwai.com^ +||w1.rskwai.com^ +||w1.sskwai.com^ +||w1.tskwai.com^ +||w1.uskwai.com^ +||w1.vskwai.com^ +||w1.wskwai.com^ +||w1.xskwai.com^ +||w1.yskwai.com^ +||w1.zskwai.com^ +||weather-analytics-events.apple.com^ +||weather-community-drcn.weather.dbankcloud.cn^ +||weather-drcn.music.dbankcloud.cn^ +||webstat.qiumibao.com^ +||win.gdt.qq.com^ +||wn.x.jd.com^ +||ws-keyboard.shouji.sogou.com^ +||ws.sj.qq.com^ +||www42.zskwai.com^ +||wxa.wxs.qq.com^ +||wxsnsdy.wxs.qq.com^ +||wxsnsdythumb.wxs.qq.com^ +||xc.gdt.qq.com^ +||xlivrdr.com^ +||xlmzc.cnjp-exp.com^ +||xlog.jd.com^ +||xlviiirdr.com^ +||xlviirdr.com^ +||youxi.kugou.com^ +||zeus.ad.xiaomi.com^ +/*-ad-*.byteimg.com/ +/*-ad-sign.byteimg.com/ +/*-ad.sm.cn/ +/*-ad.video.yximgs.com/ +/*-ad.video.yximgs.com/ +/*-ad.wtzw.com/ +/*-be-pack-sign.pglstatp-toutiao.com/ +/*-be-pack-sign.pglstatp-toutiao.com/ +/*-lm.adkwai.com/ +/*-normal-lq.zijieapi.com/ +/*.*.shouji.sogou.com/ +/*.*skwai.com/ +/*.*skwai.com/ +/*.a.market.xiaomi.com/ +/*.data.hicloud.com/ +/*.log.aliyuncs.com/ +/*.shouji.sogou.com/ +/*.zskwai.com/ +/ads*-normal.zijieapi.com/ +/ads*-normal-*.zijieapi.com/ +/cloud-inject-global.oss-cn-hongkong.aliyuncs.com/ +/cloudinject*-dev.*.*-*-*.amazonaws.com/ +/cloudinject*-dev.s3.ap-northoreast-1.amazonaws.com/ diff --git a/module.prop b/module.prop index 99f6ac4..110f599 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=AdGuardHome name=AdGuardHome for Magisk -version=20240407 +version=20240417 versionCode=11 author=twoone3 description=Filter ads at the DNS level \ No newline at end of file diff --git a/service.sh b/service.sh index 6f6fcd1..4e6a57f 100644 --- a/service.sh +++ b/service.sh @@ -1,6 +1,38 @@ MODDIR="${0%/*}" ADG_DIR="$MODDIR/bin" -setuidgid root:net_admin "$ADG_DIR/AdGuardHome""$ADG_DIR/AdGuardHome.log" >> 2>&1 & +pref=100 + +disable_ipv6() { + sysctl -w net.ipv4.ip_forward=1 + sysctl -w net.ipv6.conf.all.forwarding=0 + + sysctl -w net.ipv6.conf.all.accept_ra=0 + sysctl -w net.ipv6.conf.wlan0.accept_ra=0 + sysctl -w net.ipv6.conf.all.disable_ipv6=1 + sysctl -w net.ipv6.conf.default.disable_ipv6=1 + sysctl -w net.ipv6.conf.wlan0.disable_ipv6=1 + + ip -6 rule add unreachable pref "${pref}" + +} >> /dev/null 2>&1 + +ipv6_enable() { + sysctl -w net.ipv4.ip_forward=1 + sysctl -w net.ipv6.conf.all.forwarding=1 + + sysctl -w net.ipv6.conf.all.accept_ra=1 + sysctl -w net.ipv6.conf.wlan0.accept_ra=1 + sysctl -w net.ipv6.conf.all.disable_ipv6=0 + sysctl -w net.ipv6.conf.default.disable_ipv6=0 + sysctl -w net.ipv6.conf.wlan0.disable_ipv6=0 + + ip -6 rule del unreachable pref "${pref}" + +} >> /dev/null 2>&1 + +chown root:net_admin "$ADG_DIR/AdGuardHome" +setuidgid root:net_admin "$ADG_DIR/AdGuardHome" >>"$ADG_DIR/AdGuardHome.log" 2>&1 & "$MODDIR/apply_iptables.sh" +disable_ipv6 diff --git a/zip.bat b/zip.bat new file mode 100644 index 0000000..616738d --- /dev/null +++ b/zip.bat @@ -0,0 +1,20 @@ +@echo off +set SOURCE_DIR=. +set DESTINATION_FILE=AdGuardHomeForMagisk.zip + +if not exist "%DESTINATION_FILE%" ( + echo Creating archive... +) else ( + del "%DESTINATION_FILE%" + echo Archive already exists. Overwriting... +) + +set path="C:\Program Files\7-Zip";%path% + +7z a -tzip "%DESTINATION_FILE%" "%SOURCE_DIR%\*" -x!*.git -x!.gitignore -x!*.bat + +if %ERRORLEVEL% equ 0 ( + echo Archive created successfully. +) else ( + echo Failed to create archive. +) \ No newline at end of file