您的位置:首页 > 其它

常见的PKMS问题分析

2016-06-02 16:41 363 查看
1.Steps to reproduce the problem:

Device updates from an earlier version to any version of Android 6.0.

Symptom of the problem:

Preloaded apps (e.g. Google Play services or Google Play Store) crash repeatedly, leaving the device in an

unusable state.

Preconditions of when the problem would be reproduced:

If an app is removed from the system image or its package name is renamed during the OTA update

process.

frameworks/base / services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
private boolean isSysComponentOrPersistentPlatformSignedPrivAppLPr(PackageParser.Package pkg) {
if (UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID) {
return true;
}
if (!pkg.isPrivilegedApp()) {
return false;
}
PackageSetting sysPkg = mService.mSettings.getDisabledSystemPkgLPr(pkg.packageName);
-       if (sysPkg != null ) {
+       if (sysPkg != null && sysPkg.pkg != null) {
if ((sysPkg.pkg.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) {
return false;
}
} else if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) {
return false;
}
return PackageManagerService.compareSignatures(mService.mPlatformPackage.mSignatures,
pkg.mSignatures) == PackageManager.SIGNATURE_MATCH;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: