Skip to content

Commit f74f321

Browse files
committed
opt: simplify method to get xposed list
since legacy xposed modules have xposed_init and new xposed modules have module.prop in assets/xposed, using unzip -l is more accurate and significatly faster
1 parent 26e152e commit f74f321

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

module/common/get_extra.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ download() {
2929
get_xposed() {
3030
mkdir -p "$MODPATH/tmp"
3131
touch "$XPOSED" "$SKIPLIST"
32-
pm list packages -3 | cut -d':' -f2 | grep -vxF -f "$SKIPLIST" | grep -vxF -f "$XPOSED" | while read -r PACKAGE; do
32+
pm list packages -3 | cut -d':' -f2 | grep -vxF -f "$SKIPLIST" | grep -vxF -f "$XPOSED" | busybox xargs -P $(busybox nproc) -n 1 sh -c '
33+
XPOSED=$1; SKIPLIST=$2; PACKAGE=$3
3334
APK_PATH=$(pm path "$PACKAGE" 2>/dev/null | head -n1 | cut -d: -f2)
34-
[ -z "$APK_PATH" ] && continue
35-
if unzip -p $APK_PATH AndroidManifest.xml | tr -d '\0' | grep -q "xposedmodule"; then
35+
[ -z "$APK_PATH" ] && exit
36+
if unzip -l "$APK_PATH" | grep -q "xposed"; then
3637
echo "$PACKAGE" >> "$XPOSED"
3738
else
3839
echo "$PACKAGE" >> "$SKIPLIST"
3940
fi
40-
done
41+
' sh "$XPOSED" "$SKIPLIST"
4142
cat "$XPOSED"
4243
}
4344

0 commit comments

Comments
 (0)