From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Khaled Abdelmohsen Date: Mon, 24 Feb 2020 16:59:21 +0000 Subject: [PATCH] Create source stamp verifier Bug: 148005911 Test: gradlew test Change-Id: I7008c9567ad5e8b63e7f6ba192d38b10c5c9a2dc Merged-In: I7008c9567ad5e8b63e7f6ba192d38b10c5c9a2dc (cherry picked from commit a3970357d65d59b70c6ccf2c5c55000cb4310953) --- .../internal/apk/ApkSigningBlockUtils.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java b/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java index cc69af3..bc3ae48 100644 --- a/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java +++ b/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java @@ -1236,6 +1236,20 @@ public class ApkSigningBlockUtils { return false; } + public boolean containsWarnings() { + if (!mWarnings.isEmpty()) { + return true; + } + if (!signers.isEmpty()) { + for (SignerInfo signer : signers) { + if (signer.containsWarnings()) { + return true; + } + } + } + return false; + } + public void addError(ApkVerifier.Issue msg, Object... parameters) { mErrors.add(new ApkVerifier.IssueWithParams(msg, parameters)); } @@ -1280,6 +1294,10 @@ public class ApkSigningBlockUtils { return !mErrors.isEmpty(); } + public boolean containsWarnings() { + return !mWarnings.isEmpty(); + } + public List getErrors() { return mErrors; }