Merge "Fix that the update to v1 signed version fails if apk verity is enabled" am: 0b3fe647ef

am: b6fd88c4fc

Change-Id: If43c23abdd7448610be9cd6aacd5b79e3a49c0a6
This commit is contained in:
Satoshi Sanno
2019-03-05 17:27:56 -08:00
committed by android-build-merger

View File

@@ -397,15 +397,18 @@ public class ApkSignatureVerifier {
/**
* @return the verity root hash in the Signing Block.
*/
public static byte[] getVerityRootHash(String apkPath)
throws IOException, SignatureNotFoundException, SecurityException {
public static byte[] getVerityRootHash(String apkPath) throws IOException, SecurityException {
// first try v3
try {
return ApkSignatureSchemeV3Verifier.getVerityRootHash(apkPath);
} catch (SignatureNotFoundException e) {
// try older version
}
return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
try {
return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
} catch (SignatureNotFoundException e) {
return null;
}
}
/**