> on ZIP files the zipinfo utility used to list files inside the archive
(may contain difference in file-ordering/permissions/timestamps/etc..), but
it is not used on APK files which are ZIP/JAR files.

The attached patch should solve the problem.

Thanks.
From 710493c1e7842a5ff9f8939aba902aa6837f80e3 Mon Sep 17 00:00:00 2001
From: Maria Glukhova <[email protected]>
Date: Mon, 9 Jan 2017 06:30:42 +0300
Subject: [PATCH] Zipinfo included in APK files comparison.

Closes: #850502
---
 diffoscope/comparators/apk.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/diffoscope/comparators/apk.py b/diffoscope/comparators/apk.py
index 636cfff..38fd3bc 100644
--- a/diffoscope/comparators/apk.py
+++ b/diffoscope/comparators/apk.py
@@ -24,9 +24,11 @@ import subprocess
 
 from diffoscope.tools import tool_required
 from diffoscope.tempfiles import get_temporary_directory
+from diffoscope.difference import Difference
 
 from .utils.file import File
 from .utils.archive import Archive
+from .zip import Zipinfo, ZipinfoVerbose
 
 logger = logging.getLogger(__name__)
 
@@ -93,3 +95,8 @@ class ApkFile(File):
     def recognizes(file):
         return ApkFile.RE_FILE_TYPE.match(file.magic_file_type) and \
             ApkFile.RE_FILE_EXTENSION.search(file.name)
+
+    def compare_details(self, other, source=None):
+        zipinfo_difference = Difference.from_command(Zipinfo, self.path, other.path) or \
+                             Difference.from_command(ZipinfoVerbose, self.path, other.path)
+        return [zipinfo_difference]
-- 
2.11.0

Reply via email to