OSDN Git Service

Ignore signature stripping protection for preinstalled APKs.
authorAlex Klyubin <klyubin@google.com>
Thu, 24 Mar 2016 19:02:20 +0000 (12:02 -0700)
committerAlex Klyubin <klyubin@google.com>
Thu, 24 Mar 2016 19:02:20 +0000 (12:02 -0700)
commit9b59bc459b4cb5415909641bd1e981100bfafb2b
treea0255421d8305b265b36e4049f9e9d6edfe4a60b
parent1334376d1d110a5d50d5a4814ac1c79edfe199dd
Ignore signature stripping protection for preinstalled APKs.

The current build process may currently strip APK Signature Scheme v2
signatures from prebuilt APKs to be installed on the system or vendor
partitions. However, it leaves intact the signature scheme rollback
protections introduced by APK Signature Scheme v2. Due to a bug, when
the system extracts signer certificates from preinstalled APKs, it
encounters the rollback protection and aborts the extraction process.
This manifests itself as some preinstalled packages not appearing as
installed.

This change makes the system ignore signature scheme rollback
protections when extracting certificates from preinstalled APKs. This
is fine because the process of extracting certificates from
preinstalled APKs does not care about validity/integrity of signatures
and the APKs. It only cares about extracting signer certificates.

Bug: 27829513
Change-Id: I3bed463e776b057e93a0fce915db4014946be1f9
core/java/android/content/pm/PackageParser.java
core/java/android/util/jar/StrictJarFile.java
core/java/android/util/jar/StrictJarVerifier.java