Test su request via instrumentation

This commit is contained in:
topjohnwu
2024-12-24 23:11:53 -08:00
committed by John Wu
parent 2baedf74d1
commit 08ea937f7c
3 changed files with 80 additions and 37 deletions

View File

@ -67,11 +67,6 @@ run_tests() {
# Run app tests
am_instrument '.MagiskAppTest,.AdditionalTest'
# Test shell su request
am_instrument '.Environment#setupShellGrantTest'
adb shell /system/xbin/su 2000 su -c id | tee /dev/fd/2 | grep -q 'uid=0'
adb shell am force-stop com.topjohnwu.magisk
# Test app hiding
am_instrument '.Environment#setupAppHide'
wait_for_pm com.topjohnwu.magisk
@ -79,11 +74,6 @@ run_tests() {
# Make sure it still works
am_instrument '.MagiskAppTest' true
# Test shell su request
am_instrument '.Environment#setupShellGrantTest' true
adb shell /system/xbin/su 2000 su -c id | tee /dev/fd/2 | grep -q 'uid=0'
adb shell am force-stop repackaged.com.topjohnwu.magisk
# Test app restore
am_instrument '.Environment#setupAppRestore' true
wait_for_pm repackaged.com.topjohnwu.magisk