@
echo off
setlocal enabledelayedexpansion
REM Get list of package names
for /f "tokens=2 delims==," %%a in ('adb shell pm list packages -f') do (
set "pkg_name=%%a"
echo package:!pkg_name!
REM Get userId for each package
for /f "tokens=1,2 delims== " %%b in ('adb shell dumpsys package !pkg_name! ^| findstr /R "userId"') do (
if "%%b"=="userId" (
set /a raw_userid=%%c
if !raw_userid! LSS 10000 (
echo userId=!raw_userid!
) else (
set /a adjusted_userid=%%c - 10000
echo userId=u0_a!adjusted_userid!
)
)
)
echo.
)
endlocal
用这个脚本看下有没有 u0_a235 这个用户的应用