Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Commit 83c5286

Browse files
committed
ignoring STDERR on "pm list packages" (issue #4)
- due to some Xposed alterations, some libs throw warnings there, resulting in those being treated as apps
1 parent 27a5d88 commit 83c5286

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adebar-cli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,17 @@ initAppLists() {
283283
doProgress "Gathering lists of installed apps"
284284

285285
doProgress "- userApps" 2
286-
for app in $(adb ${ADBOPTS} shell pm list packages -3); do
286+
for app in $(adb ${ADBOPTS} shell pm list packages -3 2>/dev/null); do
287287
app=${app//[$'\t\r\n']} # remove trailing CR (^M)
288288
userApps+=(${app##*:})
289289
done
290290
doProgress "- systemApps" 2
291-
for app in $(adb ${ADBOPTS} shell pm list packages -s); do
291+
for app in $(adb ${ADBOPTS} shell pm list packages -s 2>/dev/null); do
292292
app=${app//[$'\t\r\n']}
293293
sysApps+=(${app##*:})
294294
done
295295
doProgress "- checking for uninstalled apps remembered by the system" 2
296-
for app in $(adb ${ADBOPTS} shell pm list packages -u); do
296+
for app in $(adb ${ADBOPTS} shell pm list packages -u 2>/dev/null); do
297297
app=${app//[$'\t\r\n']}
298298
in_array "${app##*:}" ${sysApps[@]} && continue
299299
in_array "${app##*:}" ${userApps[@]} && continue

lib/scriptgen.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ getDisabled() {
2121
echo "# Disabled apps for ${DEVICE_NAME} as of $(date '+%Y-%m-%d %H:%M')" >> "${scriptname}"
2222
echo >> "${scriptname}"
2323

24-
for app in $(adb ${ADBOPTS} shell "pm list packages -d"); do
24+
for app in $(adb ${ADBOPTS} shell "pm list packages -d 2>/dev/null"); do
2525
app=${app//[$'\t\r\n']}
2626
echo "adb ${ADBOPTS} shell \"pm disable ${app##*:}\"" >> "${scriptname}"
2727
done

0 commit comments

Comments
 (0)