Files
cool/apk-untrusted-toggle.sh
2026-06-07 21:32:54 +08:00

19 lines
616 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
FILE="/usr/libexec/package-manager-call"
MARKER="# === AUTO ALLOW UNTRUSTED ==="
if grep -q "$MARKER" "$FILE" 2>/dev/null; then
sed -i "/$MARKER/,+3d" "$FILE"
echo "✅ 已关闭LuCI 恢复需要签名检查。"
else
sed -i '/action="del"/a\
# '"$MARKER"'\
if [ "$action" = "add" ]; then\
cmd="$cmd --allow-untrusted"\
fi' "$FILE"
echo "✅ 已开启!现在 LuCI 可直接装第三方 apk。"
fi
echo "当前状态:"
grep -A 8 "$MARKER" "$FILE" 2>/dev/null || echo "未开启"