INNER CODE UNIT · Java

CertHashChecker

patrickfav/uber-apk-signer · src/main/java/at/favre/tools/apksigner/signing/CertHashChecker.java:10

public class CertHashChecker {

    public Result check(AndroidApkSignerVerify.Result verifyResult, String[] hashes) {
        if (verifyResult == null) {
            throw new IllegalArgumentException("parameters must not be null");
        }

        if (hashes == null || !verifyResult.verified) {
            return null;
        }

        if (verifyResult.certInfoList.isEmpty()) {
            throw new IllegalArgumentException("no certs info found in verify result - strange...");
        }

        if (verifyResult.certInfoList.size() != hashes.length) {
            return new Result(false, "not the same count of signatures and provided check hashes (found " + verifyResult.certInfoList.size() + " signatures)", hashes);
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…