Skip to content

Commit fc519f4

Browse files
committed
修改
1 parent 4c8f191 commit fc519f4

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Termux/install-NH

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function check_dependencies() {
164164
log "INFO" "更新包索引..."
165165
apt update -y &>/dev/null || apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade -y &>/dev/null
166166

167-
local required_packages=("proot" "tar" "aria2" "wget" "pv")
167+
local required_packages=("proot" "tar" "wget" "xz")
168168
local missing_packages=()
169169

170170
# 检查缺失的包
@@ -175,7 +175,12 @@ function check_dependencies() {
175175
log "INFO" "$package 已就绪"
176176
fi
177177
done
178-
178+
# 单独检查 aria2
179+
if ! command_exists "aria2c"; then
180+
missing_packages+=("aria2")
181+
else
182+
log "INFO" "aria2 已就绪"
183+
fi
179184
# 安装缺失的包
180185
if [ ${#missing_packages[@]} -gt 0 ]; then
181186
log "INFO" "安装缺失的包: ${missing_packages[*]}"
@@ -275,14 +280,13 @@ function verify_sha() {
275280
function extract_rootfs() {
276281
if [ -z "$KEEP_CHROOT" ]; then
277282
log "INFO" "开始解压 rootfs..."
278-
279-
# 显示解压进度
280-
pv "$IMAGE_NAME" | proot --link2symlink tar -xJf - \
283+
284+
# 使用 xz 解压并显示进度,替代 pv
285+
xz -dc --verbose "$IMAGE_NAME" | proot --link2symlink tar -xf - \
281286
--no-same-owner --no-same-permissions --exclude='dev/*' || {
282287
error_exit "解压失败,请检查镜像文件是否完整"
283288
}
284289

285-
286290
log "SUCCESS" "rootfs 解压完成"
287291
else
288292
log "INFO" "使用现有的 rootfs 目录"
@@ -529,7 +533,7 @@ function print_banner() {
529533
printf "${blue}## ##${reset}\n"
530534
printf "${blue}#### ############# NetHunter ####################${reset}\n"
531535
printf "${blue}#### ############ (网络猎人) ####################${reset}\n"
532-
printf "${blue}脚本优化: 东经雨 5.9${reset}\n"
536+
printf "${blue}脚本优化: 东经雨 6.0${reset}\n"
533537
printf "${yellow}技术支持: ChatGPT, Claude, DeepSeek${reset}\n"
534538
printf "使用则代表同意协议:\n"
535539
printf "作者已经脚本参与者不承担因脚本引发的任何法律问题,均由使用者自行承担\n\n"

0 commit comments

Comments
 (0)