Merge "Fix that the update to v1 signed version fails if apk verity is enabled"
This commit is contained in:
@@ -397,15 +397,18 @@ public class ApkSignatureVerifier {
|
|||||||
/**
|
/**
|
||||||
* @return the verity root hash in the Signing Block.
|
* @return the verity root hash in the Signing Block.
|
||||||
*/
|
*/
|
||||||
public static byte[] getVerityRootHash(String apkPath)
|
public static byte[] getVerityRootHash(String apkPath) throws IOException, SecurityException {
|
||||||
throws IOException, SignatureNotFoundException, SecurityException {
|
|
||||||
// first try v3
|
// first try v3
|
||||||
try {
|
try {
|
||||||
return ApkSignatureSchemeV3Verifier.getVerityRootHash(apkPath);
|
return ApkSignatureSchemeV3Verifier.getVerityRootHash(apkPath);
|
||||||
} catch (SignatureNotFoundException e) {
|
} catch (SignatureNotFoundException e) {
|
||||||
// try older version
|
// try older version
|
||||||
}
|
}
|
||||||
return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
|
try {
|
||||||
|
return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
|
||||||
|
} catch (SignatureNotFoundException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user