use of com.android.apksig.SigningCertificateLineage.SignerCapabilities in project apksig by venshine.
the class SigningCertificateLineageTest method testCapabilitiesAreNotUpdatedWithDefaultValues.
@Test
public void testCapabilitiesAreNotUpdatedWithDefaultValues() throws Exception {
// This file contains the lineage with the first two rsa-2048 signers with the first signer
// having all of the capabilities set to false.
SigningCertificateLineage lineage = Resources.toSigningCertificateLineage(getClass(), "rsa-2048-lineage-no-capabilities-first-signer");
List<Boolean> expectedCapabilityValues = Arrays.asList(false, false, false, false, false);
SignerConfig oldSignerConfig = Resources.toLineageSignerConfig(getClass(), FIRST_RSA_2048_SIGNER_RESOURCE_NAME);
SignerCapabilities oldSignerCapabilities = lineage.getSignerCapabilities(oldSignerConfig);
assertExpectedCapabilityValues(oldSignerCapabilities, expectedCapabilityValues);
// The builder is called directly to ensure all of the capabilities are set to the default
// values and the caller configured flags are not modified in this SignerCapabilities.
SignerCapabilities newCapabilities = new SignerCapabilities.Builder().build();
lineage.updateSignerCapabilities(oldSignerConfig, newCapabilities);
SignerCapabilities updatedCapabilities = lineage.getSignerCapabilities(oldSignerConfig);
assertExpectedCapabilityValues(updatedCapabilities, expectedCapabilityValues);
}
Aggregations