Skip to content

Commit c060c76

Browse files
committed
common update
1 parent ec98313 commit c060c76

File tree

8 files changed

+42
-23
lines changed

8 files changed

+42
-23
lines changed

agh_service.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,34 @@ AGH_DIR="/data/adb/agh"
44
SCRIPT_DIR="$AGH_DIR/scripts"
55
MOD_PATH="/data/adb/modules/AdGuardHome"
66

7+
update_description() {
8+
sed -i "s/description=\[.*\]/description=\[$1\]/" "$MOD_PATH/module.prop"
9+
}
10+
11+
exec >$AGH_DIR/agh.log 2>&1
12+
713
(
8-
exec >$AGH_DIR/agh.log 2>&1
14+
wait_time=0
915
while [ "$(getprop init.svc.bootanim)" != "stopped" ]; do
10-
echo "Waiting for system to finish booting..."
11-
sleep 8
16+
echo "Waiting for system to finish booting... ($wait_time)"
17+
sleep 3
18+
wait_time=$((wait_time + 3))
1219
done
1320

1421
if [ ! -f "$MOD_PATH/disable" ]; then
22+
echo "start normally"
1523
$SCRIPT_DIR/service.sh start
1624
if [ ! -f "$MOD_PATH/disable_iptable" ]; then
25+
echo "enabling iptables"
1726
$SCRIPT_DIR/iptables.sh enable
18-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running and 🔗iptables is enabled\]/" "$MOD_PATH/module.prop"
27+
update_description "🟢AdGuardHome is running | iptables is enabled"
1928
else
20-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running but ⛓️‍💥iptables is disabled\]/" "$MOD_PATH/module.prop"
29+
echo "don't enable iptables"
30+
update_description "🟢AdGuardHome is running | iptables is disabled"
2131
fi
32+
else
33+
echo "don't start"
34+
update_description "🔴AdGuardHome is stopped"
2235
fi
2336

2437
inotifyd $SCRIPT_DIR/inotify.sh $MOD_PATH:d,n >/dev/null 2>&1 &

bin/AdGuardHome.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dns:
5959
bootstrap_prefer_ipv6: false
6060
upstream_timeout: 10s
6161
private_networks: []
62-
use_private_ptr_resolvers: false
62+
use_private_ptr_resolvers: true
6363
local_ptr_upstreams: []
6464
use_dns64: false
6565
dns64_prefixes: []
@@ -135,7 +135,7 @@ filtering:
135135
pixabay: true
136136
yandex: true
137137
youtube: true
138-
blocking_mode: default
138+
blocking_mode: null_ip
139139
parental_block_host: family-block.dns.adguard.com
140140
safebrowsing_block_host: standard-block.dns.adguard.com
141141
rewrites: []
@@ -144,7 +144,7 @@ filtering:
144144
safesearch_cache_size: 1048576
145145
parental_cache_size: 1048576
146146
cache_time: 30
147-
filters_update_interval: 168
147+
filters_update_interval: 72
148148
blocked_response_ttl: 10
149149
filtering_enabled: true
150150
parental_enabled: false

changelog.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# ChangeLog
2-
- 新增模块描述动态显示模块状态功能
3-
- 新增 [Wiki](https://github.com/twoone-3/AdGuardHomeForMagisk/wiki) 页面
4-
- 更新 `AdGuardHome` 到 v0.107.53
5-
- 更新 `AdGuardHome.yaml` 版本
6-
- 删除 `config.sh` 中的 manual 配置项,转而改用创建 `disable_iptable` 文件
2+
- 修复在模块禁用时,开机模块状态显示错误
3+
- 优化了模块状态显示emoji
4+
- 优化了默认模块配置

module.prop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id=AdGuardHome
22
name=AdGuardHome for Magisk
3-
version=20241012
4-
versionCode=23
3+
version=20241030
4+
versionCode=24
55
author=twoone3
6-
description=[😐AdGuardHome is stopped and ⛓️‍💥iptables is disabled] Filter ads at the DNS level
6+
description=[state] Filter ads at the DNS level
77
updateJson=https://raw.githubusercontent.com/twoone-3/AdGuardHomeForMagisk/main/version.json

scripts/inotify.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,38 @@ MOD_PATH="/data/adb/modules/AdGuardHome"
88

99
exec >>$AGH_DIR/agh.log 2>&1
1010

11+
update_description () {
12+
sed -i "s/description=\[.*\]/description=\[$1\]/" "$MOD_PATH/module.prop"
13+
}
14+
1115
if [ "${monitor_file}" = "disable" ]; then
1216
if [ "${events}" = "d" ]; then
1317
$SCRIPT_DIR/service.sh start
1418
if [ ! -f "/data/adb/modules/AdGuardHome/disable_iptable" ]; then
1519
$SCRIPT_DIR/iptables.sh enable
16-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running and 🔗iptables is enabled\]/" "$MOD_PATH/module.prop"
20+
update_description "🟢AdGuardHome is running | iptables is enabled"
1721
else
18-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running but ⛓️‍💥iptables is disabled\]/" "$MOD_PATH/module.prop"
22+
update_description "🟢AdGuardHome is running | iptables is disabled"
1923
fi
2024
elif [ "${events}" = "n" ]; then
2125
if [ ! -f "/data/adb/modules/AdGuardHome/disable_iptable" ]; then
2226
$SCRIPT_DIR/iptables.sh disable
2327
fi
2428
$SCRIPT_DIR/service.sh stop
25-
sed -i "s/description=\[.*\]/description=\[😐AdGuardHome is stopped and ⛓️‍💥iptables is disabled\]/" "$MOD_PATH/module.prop"
29+
update_description "🔴AdGuardHome is stopped"
2630
fi
2731
fi
2832

2933
if [ "${monitor_file}" = "disable_iptable" ]; then
3034
if [ "${events}" = "d" ]; then
3135
if [ ! -f "/data/adb/modules/AdGuardHome/disable" ]; then
3236
$SCRIPT_DIR/iptables.sh enable
33-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running and 🔗iptables is enabled\]/" "$MOD_PATH/module.prop"
37+
update_description "🟢AdGuardHome is running | iptables is enabled"
3438
fi
3539
elif [ "${events}" = "n" ]; then
3640
if [ ! -f "/data/adb/modules/AdGuardHome/disable" ]; then
3741
$SCRIPT_DIR/iptables.sh disable
38-
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running but ⛓️‍💥iptables is disabled\]/" "$MOD_PATH/module.prop"
42+
update_description "🟢AdGuardHome is running | iptables is disabled"
3943
fi
4044
fi
4145
fi

scripts/iptables.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
AGH_DIR="/data/adb/agh"
44
source "$AGH_DIR/scripts/config.sh"
55

6+
exec >>$AGH_DIR/agh.log 2>&1
7+
68
find_packages_uid() {
79
uid_list=()
810
for package in "${packages_list[@]}"; do

scripts/service.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ BIN_DIR="$AGH_DIR/bin"
55
SCRIPT_DIR="$AGH_DIR/scripts"
66
source "$AGH_DIR/scripts/config.sh"
77

8+
exec >>$AGH_DIR/agh.log 2>&1
9+
810
start_bin() {
911
# to fix https://github.com/AdguardTeam/AdGuardHome/issues/7002
1012
export SSL_CERT_DIR="/system/etc/security/cacerts/"

version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"versionCode": 23,
3-
"version": "20241012",
2+
"versionCode": 24,
3+
"version": "20241030",
44
"zipUrl": "https://github.com/twoone-3/AdGuardHomeForMagisk/releases/latest/download/AdGuardHomeForMagisk_arm64.zip",
55
"changelog": "https://raw.githubusercontent.com/twoone-3/AdGuardHomeForMagisk/main/changelog.md"
66
}

0 commit comments

Comments
 (0)