diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 7934ffa8..b5b956a2 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -563,7 +563,6 @@ def parse_ipa(ipa_path, file_size, sha256): # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring ipa["versionCode"] = version_string_to_int(plist["CFBundleShortVersionString"]) ipa["versionName"] = plist["CFBundleShortVersionString"] - ipa["usage"] = {k: v for k, v in plist.items() if 'Usage' in k} return ipa diff --git a/tests/com.fake.IpaApp_1000000000001.ipa b/tests/com.fake.IpaApp_1000000000001.ipa new file mode 100644 index 00000000..d392cb94 Binary files /dev/null and b/tests/com.fake.IpaApp_1000000000001.ipa differ diff --git a/tests/update.TestCase b/tests/update.TestCase index 0bc78462..9d1dea23 100755 --- a/tests/update.TestCase +++ b/tests/update.TestCase @@ -1922,6 +1922,19 @@ class UpdateTest(unittest.TestCase): index['repo'][CATEGORIES_CONFIG_NAME], ) + def test_parse_ipa(self): + result = fdroidserver.update.parse_ipa('./com.fake.IpaApp_1000000000001.ipa', 'fake_size', 'fake_sha') + self.maxDiff = None + self.assertDictEqual(result, { + 'apkName': 'com.fake.IpaApp_1000000000001.ipa', + 'hash': 'fake_sha', + 'hashType': 'sha256', + 'packageName': 'org.onionshare.OnionShare', + 'size': 'fake_size', + 'versionCode': 1000000000001, + 'versionName': '1.0.1', + }) + class TestUpdateVersionStringToInt(unittest.TestCase):