更新时间:2023-11-14 10:51:58
嗯,这是我认为一个草率的解决方案(如果的 /数据/应用程序的是不是所有设备上的应用程序目录? ),但仔细搜索后,这是我想出了:
Well, it's a sloppy solution in my opinion (what if /data/app isn't the apps directory on all devices?), but after a thorough search, this is what I have come up with:
for (ApplicationInfo ai : appInfo) {
if (ai.sourceDir.startsWith("/data/app/")) {
//Non-system app
}
else {
//System app
}
}