Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7298e1a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "BinaryTransparencyService: Fix printPackageInstallationInfo"

parents 308338f1 00001111
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -531,6 +531,7 @@ public class BinaryTransparencyService extends SystemService {
                        pw.println("|--> Pre-installed package install location: "
                                + origPackageFilepath);

                        if (!origPackageFilepath.equals(APEX_PRELOAD_LOCATION_ERROR)) {
                            if (useSha256) {
                                String sha256Digest = PackageUtils.computeSha256DigestForLargeFile(
                                        origPackageFilepath, PackageUtils.createLargeFileBuffer());
@@ -538,20 +539,22 @@ public class BinaryTransparencyService extends SystemService {
                                        + sha256Digest);
                            }


                            Map<Integer, byte[]> contentDigests = computeApkContentDigest(
                                    origPackageFilepath);
                            if (contentDigests == null) {
                            pw.println("ERROR: Failed to compute package content digest for "
                                    + origPackageFilepath);
                                pw.println("|--> ERROR: Failed to compute package content digest "
                                        + "for " + origPackageFilepath);
                            } else {
                                for (Map.Entry<Integer, byte[]> entry : contentDigests.entrySet()) {
                                    Integer algorithmId = entry.getKey();
                                    byte[] contentDigest = entry.getValue();
                                    pw.println("|--> Pre-installed package content digest: "
                                            + HexEncoding.encodeToString(contentDigest, false));
                                pw.println("|--> Pre-installed package content digest algorithm: "
                                        + translateContentDigestAlgorithmIdToString(algorithmId));
                                    pw.println("|--> Pre-installed package content digest "
                                            + "algorithm: "
                                            + translateContentDigestAlgorithmIdToString(
                                                    algorithmId));
                                }
                            }
                        }
                    }