Merge "Create new instance of shared lineage signers to preserve capabilities" into sc-dev am: 71f64ff1ac am: 57244b6ebb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15508291

Change-Id: I09d11748055a19495feae106005b61ce99f2a843
This commit is contained in:
Michael Groover
2021-08-10 22:53:40 +00:00
committed by Automerger Merge Worker

View File

@@ -174,7 +174,16 @@ class PackageSignatures {
if (index >= 0 && index < readSignatures.size()) {
Signature sig = readSignatures.get(index);
if (sig != null) {
signatures.add(sig);
// An app using a shared signature in its signing lineage
// can have unique capabilities assigned to this previous
// signer; create a new instance of this Signature to ensure
// its flags do not overwrite those of the instance from
// readSignatures.
if (isPastSigs) {
signatures.add(new Signature(sig));
} else {
signatures.add(sig);
}
signatureParsed = true;
} else {
PackageManagerService.reportSettingsProblem(Log.WARN,