-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
much things for new version 20241012
- Loading branch information
Showing
17 changed files
with
192 additions
and
134 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 |
---|---|---|
@@ -1 +1 @@ | ||
*.zip | ||
cache/ |
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
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
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 |
---|---|---|
@@ -1,17 +1,25 @@ | ||
#!/system/bin/sh | ||
|
||
AGH_DIR="/data/adb/agh" | ||
SCRIPT_DIR="$AGH_DIR/scripts" | ||
MOD_PATH="/data/adb/modules/AdGuardHome" | ||
|
||
( | ||
exec >$AGH_DIR/agh.log 2>&1 | ||
while [ "$(getprop init.svc.bootanim)" != "stopped" ]; do | ||
echo "Waiting for system to finish booting..." >>/data/adb/agh/agh.log | ||
sleep 8 | ||
done | ||
AGH_DIR="/data/adb/agh" | ||
SCRIPT_DIR="$AGH_DIR/scripts" | ||
|
||
if [ ! -f "/data/adb/modules/AdGuardHome/disable" ]; then | ||
$SCRIPT_DIR/service.sh start >>$AGH_DIR/agh.log 2>&1 && | ||
$SCRIPT_DIR/iptables.sh enable >>$AGH_DIR/agh.log 2>&1 | ||
if [ ! -f "$MOD_PATH/disable" ]; then | ||
$SCRIPT_DIR/service.sh start | ||
if [ ! -f "$MOD_PATH/disable_iptable" ]; then | ||
$SCRIPT_DIR/iptables.sh enable | ||
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running and 🔗iptables is enabled\]/" "$MOD_PATH/module.prop" | ||
else | ||
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running but ⛓️💥iptables is disabled\]/" "$MOD_PATH/module.prop" | ||
fi | ||
fi | ||
|
||
inotifyd $SCRIPT_DIR/inotify.sh /data/adb/modules/AdGuardHome:d,n >/dev/null 2>&1 & | ||
inotifyd $SCRIPT_DIR/inotify.sh $MOD_PATH:d,n >/dev/null 2>&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
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
# ChangeLog | ||
- 修复manual选项不生效的问题 | ||
- fix manual option not work | ||
- 更改了模块更新安装时的备份方式 | ||
- change the backup method when updating the module | ||
- 更新了 README.md | ||
- update README.md | ||
- 更改了默认DNS查询方式为parallel,提高了查询速度 | ||
- change the default DNS query method to parallel, improve the query speed | ||
- 新增模块描述动态显示模块状态功能 | ||
- 新增 [Wiki](https://github.com/twoone-3/AdGuardHomeForMagisk/wiki) 页面 | ||
- 更新 `AdGuardHome` 到 v0.107.53 | ||
- 更新 `AdGuardHome.yaml` 版本 | ||
- 删除 `config.sh` 中的 manual 配置项,转而改用创建 `disable_iptable` 文件 |
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
id=AdGuardHome | ||
name=AdGuardHome for Magisk | ||
version=20241007 | ||
versionCode=22 | ||
version=20241012 | ||
versionCode=23 | ||
author=twoone3 | ||
description=Filter ads at the DNS level | ||
description=[😐AdGuardHome is stopped and ⛓️💥iptables is disabled] Filter ads at the DNS level | ||
updateJson=https://raw.githubusercontent.com/twoone-3/AdGuardHomeForMagisk/main/version.json |
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,91 @@ | ||
# 定义下载 URL 和路径变量 | ||
$CacheDir = "$PSScriptRoot\cache" | ||
$UrlWitchCachePath = @{ | ||
"https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_arm64.tar.gz" = "$CacheDir\AdGuardHome_linux_arm64.tar.gz" | ||
"https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_armv7.tar.gz" = "$CacheDir\AdGuardHome_linux_armv7.tar.gz" | ||
} | ||
|
||
# 创建缓存目录 | ||
if (-Not (Test-Path -Path $CacheDir)) { | ||
Write-Host "Creating cache directory..." | ||
New-Item -Path $CacheDir -ItemType Directory | ||
} | ||
|
||
# 下载文件,有缓存时不再下载 | ||
Write-Host "Downloading AdGuardHome..." | ||
foreach ($url in $UrlWitchCachePath.Keys) { | ||
$CachePath = $UrlWitchCachePath[$url] | ||
if (-Not (Test-Path -Path $CachePath)) { | ||
Write-Host "Downloading $url..." | ||
Invoke-WebRequest -Uri $url -OutFile $CachePath | ||
if ($?) { | ||
Write-Host "Download completed successfully." | ||
} | ||
else { | ||
Write-Host "Download failed. Exiting..." | ||
exit 1 | ||
} | ||
} | ||
else { | ||
Write-Host "File already exists in cache. Skipping download." | ||
} | ||
} | ||
|
||
# 使用 tar 解压文件 | ||
Write-Host "Extracting AdGuardHome..." | ||
foreach ($url in $UrlWitchCachePath.Keys) { | ||
$CachePath = $UrlWitchCachePath[$url] | ||
if ($CachePath -match 'AdGuardHome_linux_(arm64|armv7)\.tar\.gz$') { | ||
$ExtractDir = "./cache/" + $matches[1] | ||
} | ||
else { | ||
throw "Invalid file path: $CachePath" | ||
} | ||
if (-Not (Test-Path -Path $ExtractDir)) { | ||
New-Item -Path $ExtractDir -ItemType Directory | ||
Write-Host "Extracting $CachePath..." | ||
tar -xzf $CachePath -C $ExtractDir | ||
if ($?) { | ||
Write-Host "Extraction completed successfully." | ||
} | ||
else { | ||
Write-Host "Extraction failed" | ||
exit 1 | ||
} | ||
} | ||
} | ||
|
||
# 给项目打包,使用 7-Zip 压缩 zip | ||
Write-Host "Packing AdGuardHome..." | ||
$7z = "C:\Program Files\7-Zip\7z.exe" | ||
$OutputPathArm64 = "$CacheDir\AdGuardHomeForMagisk_arm64.zip" | ||
$OutputPathArmv7 = "$CacheDir\AdGuardHomeForMagisk_armv7.zip" | ||
if (Test-Path -Path $OutputPathArm64) { | ||
Remove-Item -Path $OutputPathArm64 | ||
} | ||
if (Test-Path -Path $OutputPathArmv7) { | ||
Remove-Item -Path $OutputPathArmv7 | ||
} | ||
# pack arm64 | ||
& $7z a -tzip $OutputPathArm64 ".\*.sh" | ||
& $7z a -tzip $OutputPathArm64 ".\module.prop" | ||
& $7z a -tzip $OutputPathArm64 ".\META-INF" | ||
& $7z a -tzip $OutputPathArm64 ".\scripts" | ||
& $7z a -tzip $OutputPathArm64 ".\bin\data" | ||
& $7z rn $OutputPathArm64 "data" "bin\data" | ||
& $7z a -tzip $OutputPathArm64 ".\bin\AdGuardHome.yaml" | ||
& $7z rn $OutputPathArm64 "AdGuardHome.yaml" "bin\AdGuardHome.yaml" | ||
& $7z a -tzip $OutputPathArm64 ".\cache\arm64\AdGuardHome\AdGuardHome" | ||
& $7z rn $OutputPathArm64 "AdGuardHome" "bin\AdGuardHome" | ||
# pack armv7 | ||
& $7z a -tzip $OutputPathArmv7 ".\*.sh" | ||
& $7z a -tzip $OutputPathArmv7 ".\module.prop" | ||
& $7z a -tzip $OutputPathArmv7 ".\META-INF" | ||
& $7z a -tzip $OutputPathArmv7 ".\scripts" | ||
& $7z a -tzip $OutputPathArmv7 ".\bin\data" | ||
& $7z rn $OutputPathArmv7 "data" "bin\data" | ||
& $7z a -tzip $OutputPathArmv7 ".\bin\AdGuardHome.yaml" | ||
& $7z rn $OutputPathArmv7 "AdGuardHome.yaml" "bin\AdGuardHome.yaml" | ||
& $7z a -tzip $OutputPathArmv7 ".\cache\armv7\AdGuardHome\AdGuardHome" | ||
& $7z rn $OutputPathArmv7 "AdGuardHome" "bin\AdGuardHome" | ||
Write-Host "Packing completed successfully." |
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
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
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
Oops, something went wrong.