diff options
| -rw-r--r-- | core/java/android/util/apk/ApkSignatureVerifier.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/util/apk/ApkSignatureVerifier.java b/core/java/android/util/apk/ApkSignatureVerifier.java index de9f55b09200..544cc1c76d4e 100644 --- a/core/java/android/util/apk/ApkSignatureVerifier.java +++ b/core/java/android/util/apk/ApkSignatureVerifier.java @@ -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; + } } /** |