am 6e52b5d7: 2568467 System crash when installing corrupt APK

Merge commit '6e52b5d76850ee60bbef2f3d8a2e47bd589e28e8' into froyo-plus-aosp

* commit '6e52b5d76850ee60bbef2f3d8a2e47bd589e28e8':
  2568467 System crash when installing corrupt APK
This commit is contained in:
Dianne Hackborn
2010-04-05 18:45:50 -07:00
committed by Android Git Automerger
2 changed files with 6 additions and 0 deletions

View File

@@ -343,6 +343,9 @@ public class PackageParser {
} catch (IOException e) { } catch (IOException e) {
Log.w(TAG, "Exception reading " + je.getName() + " in " Log.w(TAG, "Exception reading " + je.getName() + " in "
+ jarFile.getName(), e); + jarFile.getName(), e);
} catch (RuntimeException e) {
Log.w(TAG, "Exception reading " + je.getName() + " in "
+ jarFile.getName(), e);
} }
return null; return null;
} }

View File

@@ -4006,6 +4006,9 @@ class PackageManagerService extends IPackageManager.Stub {
if (bp.protectionLevel == PermissionInfo.PROTECTION_NORMAL if (bp.protectionLevel == PermissionInfo.PROTECTION_NORMAL
|| bp.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS) { || bp.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS) {
allowed = true; allowed = true;
} else if (bp.packageSetting == null) {
// This permission is invalid; skip it.
allowed = false;
} else if (bp.protectionLevel == PermissionInfo.PROTECTION_SIGNATURE } else if (bp.protectionLevel == PermissionInfo.PROTECTION_SIGNATURE
|| bp.protectionLevel == PermissionInfo.PROTECTION_SIGNATURE_OR_SYSTEM) { || bp.protectionLevel == PermissionInfo.PROTECTION_SIGNATURE_OR_SYSTEM) {
allowed = (checkSignaturesLP(bp.packageSetting.signatures.mSignatures, pkg.mSignatures) allowed = (checkSignaturesLP(bp.packageSetting.signatures.mSignatures, pkg.mSignatures)