1.命令
adb shell dumpsys package
2.获取的信息样式如下
Packages:
Package [com.miui.screenrecorder] (752e1b3):
userId=1000
sharedUser=SharedUserSetting{e540b41 android.uid.system/1000}
pkg=Package{a7cc8e6 com.miui.screenrecorder}
codePath=/system/app/MiuiScreenRecorder
resourcePath=/system/app/MiuiScreenRecorder
legacyNativeLibraryDir=/system/app/MiuiScreenRecorder/lib
primaryCpuAbi=null
secondaryCpuAbi=null
versionCode=59 minSdk=21 targetSdk=26
versionName=1.5.9
splits=[base]
apkSigningVersion=2
applicationInfo=ApplicationInfo{43bce27 com.miui.screenrecorder}
flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE ]
dataDir=/data/user/0/com.miui.screenrecorder
supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
usesLibraries:
org.apache.http.legacy
usesLibraryFiles:
/system/framework/org.apache.http.legacy.boot.jar
timeStamp=2009-01-01 00:00:00
firstInstallTime=2009-01-01 00:00:00
lastUpdateTime=2009-01-01 00:00:00
signatures=PackageSignatures{f70d8d4 version:2, signatures:[6c02dd51], past signatures:[]}
installPermissionsFixed=true
pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
User 0: ceDataInode=1310867 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
Package [com.android.cts.priv.ctsshim] (d151a7d):
userId=10048
pkg=Package{9bc8d72 com.android.cts.priv.ctsshim}
codePath=/system/priv-app/CtsShimPrivPrebuilt
resourcePath=/system/priv-app/CtsShimPrivPrebuilt
legacyNativeLibraryDir=/system/priv-app/CtsShimPrivPrebuilt/lib
primaryCpuAbi=arm64-v8a
secondaryCpuAbi=armeabi-v7a
versionCode=27 minSdk=24 targetSdk=24
versionName=8.1.0-4396705
splits=[base]
apkSigningVersion=1
applicationInfo=ApplicationInfo{8d25c3 com.android.cts.priv.ctsshim}
flags=[ SYSTEM ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION PRIVILEGED ]
dataDir=/data/user/0/com.android.cts.priv.ctsshim
.....
3. 从上述信息可以看出各个包的信息
例如从:
User 0: ceDataInode=1310867 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
hidden=false可以看出该包,未被隐藏;若为true则为被隐藏.