Fix package management and user targeting on HSUM

- Use --user current for pm install, adb install, and appops set across
  install_script, adb_pm_install, and test/setup scripts.
- Skip headless user 0 in get_users() on HSUM devices.
- Use --user current in app_notify for non-app UIDs instead of calling
  content call against all users.
- Clear path buffer on each iteration in setup_magisk_env.
- Use --user current for am instrument in app migration tests.

Assisted-by: Gemini 4 Argon
This commit is contained in:
topjohnwu
2026-10-22 14:06:48 -07:00
committed by John Wu
parent c275a4ea30
commit ea16c8141e
9 changed files with 30 additions and 25 deletions
+3 -3
View File
@@ -44,7 +44,7 @@ ensure_android_cli() {
# $2 = component
am_instrument() {
set +x
local out=$(adb shell am instrument -w --user 0 -e class "$1" "$2")
local out=$(adb shell am instrument -w --user current -e class "$1" "$2")
echo "$out"
if grep -q 'OK (' <<< "$out"; then
set -x
@@ -60,10 +60,10 @@ run_setup() {
adb shell 'PATH=$PATH:/debug_ramdisk magisk -v'
# Install the Magisk app
adb install -r -g $apk
adb install --user current -r -g $apk
# Install the test app
adb install -r -g out/test.apk
adb install --user current -r -g out/test.apk
local app='com.topjohnwu.magisk.test/com.topjohnwu.magisk.test.AppTestRunner'