[diffoscope] 04/04: Additionally extract the classes.dex file from .apk files; apktool does not do this by default which was was preventing us recursing into it to find differences. Thanks to Hans-Christoph Steiner <hans at eds.org> for the report. (Closes: #890904)

Chris Lamb chris at chris-lamb.co.uk
Thu Mar 1 23:50:47 CET 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit b692cbd610341532f3d9f69dcff0decde8cfcb9b
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Mar 1 22:48:27 2018 +0000

    Additionally extract the classes.dex file from .apk files; apktool does not do this by default which was was preventing us recursing into it to find differences. Thanks to Hans-Christoph Steiner <hans at eds.org> for the report. (Closes: #890904)
---
 diffoscope/comparators/apk.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/diffoscope/comparators/apk.py b/diffoscope/comparators/apk.py
index 3d86a9c..dc72b10 100644
--- a/diffoscope/comparators/apk.py
+++ b/diffoscope/comparators/apk.py
@@ -41,6 +41,7 @@ class ApkContainer(Archive):
         return self._path
 
     @tool_required('apktool')
+    @tool_required('zipinfo')
     def open_archive(self):
         self._members = []
         self._unpacked = os.path.join(
@@ -56,6 +57,11 @@ class ApkContainer(Archive):
             'apktool', 'd', '-k', '-m', '-o', self._unpacked, self.source.path,
         ), shell=False, stderr=None, stdout=subprocess.PIPE)
 
+        # Additionally extract the classes.dex file; apktool does not do this.
+        subprocess.check_call((
+            'unzip', '-d', self._unpacked, self.source.path, 'classes.dex',
+        ), stderr=None, stdout=subprocess.PIPE)
+
         for root, _, files in os.walk(self._unpacked):
             current_dir = []
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list