[Git][reproducible-builds/diffoscope][master] apktool 2.5.0 changed the handling of output of XML schemas, so update and...

Chris Lamb gitlab at salsa.debian.org
Sat Apr 11 18:10:08 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
55dbcf59 by Chris Lamb at 2020-04-11T19:07:07+01:00
apktool 2.5.0 changed the handling of output of XML schemas, so update and restrict the corresponding test to match. (Closes: reproducible-builds/diffoscope#96)

- - - - -


2 changed files:

- tests/comparators/test_apk.py
- tests/data/apk_manifest_expected_diff


Changes:

=====================================
tests/comparators/test_apk.py
=====================================
@@ -19,11 +19,12 @@
 
 import sys
 import pytest
+import subprocess
 
 from diffoscope.comparators.apk import ApkFile
 
 from ..utils.data import load_fixture, get_data
-from ..utils.tools import skip_unless_tools_exist
+from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
 apk1 = load_fixture('test1.apk')
@@ -31,6 +32,14 @@ apk2 = load_fixture('test2.apk')
 apk3 = load_fixture('test3.apk')
 
 
+def apktool_version():
+    return (
+        subprocess.check_output(['apktool', '-version'])
+        .decode("utf-8")
+        .strip()
+    )
+
+
 def test_identification(apk1):
     assert isinstance(apk1, ApkFile)
 
@@ -63,7 +72,8 @@ def test_zipinfo(differences):
     assert differences[0].unified_diff == expected_diff
 
 
- at skip_unless_tools_exist('apktool', 'zipinfo')
+ at skip_unless_tools_exist('zipinfo')
+ at skip_unless_tool_is_at_least('apktool', apktool_version, '2.5.0')
 @pytest.mark.skipif(
     sys.version_info < (3, 8), reason="requires Python 3.8 or higher"
 )


=====================================
tests/data/apk_manifest_expected_diff
=====================================
@@ -1,11 +1,11 @@
 @@ -1,9 +1,9 @@
  <?xml version="1.0" encoding="utf-8"?>
--<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.any.any" platformBuildVersionCode="24" platformBuildVersionName="7.0.0">
-+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="2.0" package="com.any.any" platformBuildVersionCode="24" platformBuildVersionName="7.0.0">
-   <uses-permission android:name="android.permission.INTERNET"/>
-   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
-   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="" package="com.any.any" platformBuildVersionCode="24" platformBuildVersionName="7.0.0">
++<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="" package="com.any.any" platformBuildVersionCode="24" platformBuildVersionName="7.0.0">
+   <uses-permission android:name=""/>
+   <uses-permission android:name=""/>
+   <uses-permission android:name=""/>
    <application>
-     <activity android:name="com.any.any.SomeActivity">
+     <activity android:name="">
        <intent-filter>
-         <action android:name="android.intent.action.MAIN"/>
+         <action android:name=""/>



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/55dbcf59434ec1a6830341af6c92bd6b4af07323

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/55dbcf59434ec1a6830341af6c92bd6b4af07323
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200411/6e81aa0c/attachment.htm>


More information about the rb-commits mailing list