diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index eaffe02..d75be53 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -41,11 +41,12 @@ get_unnecessary() { } get_xposed() { - pm list packages -3 | awk -F: '{print $2}' | while read -r PACKAGE; do - if ! grep -Fq "$PACKAGE" "$SKIPLIST" && ! grep -Fq "$PACKAGE" "$OUTPUT"; then - pm path "$PACKAGE" | grep "base.apk" | awk -F: '{print $2}' | tr -d '\r' | while read -r APK_PATH; do - aapt dump xmltree "$APK_PATH" AndroidManifest.xml 2>/dev/null | grep -qE "xposed.category|xposeddescription" && echo "$PACKAGE" >> "$OUTPUT" - done + pm list packages -3 | cut -d':' -f2 | grep -vxF -f "$SKIPLIST" | grep -vxF -f "$OUTPUT" | while read -r PACKAGE; do + APK_PATH=$(pm path "$PACKAGE" | grep "base.apk" | cut -d':' -f2 | tr -d '\r') + if [[ -n "$APK_PATH" ]]; then + if aapt dump xmltree "$APK_PATH" AndroidManifest.xml 2>/dev/null | grep -qE "xposed.category|xposeddescription"; then + echo "$PACKAGE" >> "$OUTPUT" + fi fi done } @@ -67,4 +68,4 @@ case "$1" in --unnecessary) get_unnecessary; exit ;; --xposed) get_xposed; exit ;; --update) check_update; exit ;; -esac +esac \ No newline at end of file diff --git a/module/webui/index.js b/module/webui/index.js index 5f8b854..19c07aa 100644 --- a/module/webui/index.js +++ b/module/webui/index.js @@ -392,6 +392,7 @@ async function deselectUnnecessaryApps() { }, 0); console.log("Exclude list found. Running xposed script."); } + await new Promise(resolve => setTimeout(resolve, 100)); const result = await execCommand(`cat ${basePath}common/tmp/exclude-list`); const UnnecessaryApps = result.split("\n").map(app => app.trim()).filter(Boolean); const apps = document.querySelectorAll(".card");